public class ObservationProxyExecutionListener extends Object implements ProxyExecutionListener
| Constructor and Description |
|---|
ObservationProxyExecutionListener(io.micrometer.observation.ObservationRegistry observationRegistry,
io.r2dbc.spi.ConnectionFactory connectionFactory,
String connectionUrl)
Constructor that takes a connection url.
|
ObservationProxyExecutionListener(io.micrometer.observation.ObservationRegistry observationRegistry,
io.r2dbc.spi.ConnectionFactory connectionFactory,
String host,
Integer port)
Constructor that takes host and port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterQuery(QueryExecutionInfo executionInfo)
Called after executing a query (
Batch.execute() or Statement.execute()). |
void |
beforeQuery(QueryExecutionInfo executionInfo)
Called before executing a query (
Batch.execute() or Statement.execute()). |
void |
eachQueryResult(QueryExecutionInfo executionInfo)
Called on processing each query
Result. |
void |
setIncludeParameterValues(boolean includeParameterValues) |
void |
setQueryObservationConvention(QueryObservationConvention queryObservationConvention) |
void |
setQueryParametersTagProvider(QueryParametersTagProvider queryParametersTagProvider) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterMethod, beforeMethodpublic ObservationProxyExecutionListener(io.micrometer.observation.ObservationRegistry observationRegistry,
io.r2dbc.spi.ConnectionFactory connectionFactory,
@Nullable
String connectionUrl)
observationRegistry - observation registryconnectionFactory - connection factoryconnectionUrl - connection url string (optional)public ObservationProxyExecutionListener(io.micrometer.observation.ObservationRegistry observationRegistry,
io.r2dbc.spi.ConnectionFactory connectionFactory,
@Nullable
String host,
@Nullable
Integer port)
observationRegistry - observation registryconnectionFactory - connection factoryhost - hostport - port number (optional)public void beforeQuery(QueryExecutionInfo executionInfo)
ProxyExecutionListenerBatch.execute() or Statement.execute()).
Note: this callback is called when the publisher, result of the execute(), is being
subscribed. Not at the time of execute() is called,
beforeQuery in interface ProxyExecutionListenerexecutionInfo - query execution contextpublic void afterQuery(QueryExecutionInfo executionInfo)
ProxyExecutionListenerBatch.execute() or Statement.execute()).
The callback order is:
ProxyExecutionListener.beforeQuery(QueryExecutionInfo)
ProxyExecutionListener.eachQueryResult(QueryExecutionInfo) for 1st result
ProxyExecutionListener.eachQueryResult(QueryExecutionInfo) for 2nd result
ProxyExecutionListener.eachQueryResult(QueryExecutionInfo) for Nth result
ProxyExecutionListener.afterQuery(QueryExecutionInfo)
QueryExecutionInfo.getExecuteDuration() is available in this callback and it holds
the duration since ProxyExecutionListener.beforeQuery(QueryExecutionInfo).
Note: this callback is called when the publisher, result of the execute(), is being
subscribed. Not at the time of execute() is called,
afterQuery in interface ProxyExecutionListenerexecutionInfo - query execution contextpublic void eachQueryResult(QueryExecutionInfo executionInfo)
ProxyExecutionListenerResult.
While processing query results Result, this callback
is called per result.
QueryExecutionInfo.getCurrentMappedResult() contains the mapped result.
eachQueryResult in interface ProxyExecutionListenerexecutionInfo - query execution contextpublic void setIncludeParameterValues(boolean includeParameterValues)
public void setQueryParametersTagProvider(QueryParametersTagProvider queryParametersTagProvider)
public void setQueryObservationConvention(QueryObservationConvention queryObservationConvention)
Copyright © 2024. All rights reserved.