1616package com .datastax .driver .core ;
1717
1818/**
19- * Interface for object that are interested in tracking the latencies
19+ * Interface for objects that are interested in tracking the latencies
2020 * of the driver queries to each Cassandra nodes.
2121 * <p>
2222 * An implementation of this interface can be registered against a Cluster
2323 * object trough the {@link Cluster#register} method, after which the
24- * {@code update} will be called after each query of the driver to a Cassandra
24+ * {@link # update(Host, Statement, Exception, long)} method will be called after each query of the driver to a Cassandra
2525 * host with the latency/duration (in nanoseconds) of this operation.
2626 */
2727public interface LatencyTracker {
@@ -31,15 +31,21 @@ public interface LatencyTracker {
3131 * the duration of that operation.
3232 * <p>
3333 * Note that there is no guarantee that this method won't be called
34- * concurrently by multiple thread , so implementations should synchronize
34+ * concurrently by multiple threads , so implementations should synchronize
3535 * internally if need be.
3636 *
37- * @param host the Cassandra host on which a request has been performed.
38- * @param newLatencyNanos the latency in nanoseconds of the operation. This
39- * latency corresponds to the time elapsed between when the query was send
40- * to {@code host} and when the response was received by the driver (or the
41- * operation timed out, in which {@code newLatencyNanos} will approximately
42- * be the timeout value).
37+ * @param host The Cassandra host on which a request has been performed.
38+ * This parameter is never {@code null}.
39+ * @param statement The {@link com.datastax.driver.core.Statement} that has been executed.
40+ * This parameter is never {@code null}.
41+ * @param exception An {@link Exception} thrown when receiving the response, or {@code null}
42+ * if the response was successful.
43+ * @param newLatencyNanos the latency in nanoseconds of the operation.
44+ * This latency corresponds to the time elapsed between
45+ * when the query was sent to {@code host} and
46+ * when the response was received by the driver
47+ * (or the operation timed out, in which {@code newLatencyNanos}
48+ * will approximately be the timeout value).
4349 */
44- public void update (Host host , long newLatencyNanos );
50+ public void update (Host host , Statement statement , Exception exception , long newLatencyNanos );
4551}
0 commit comments