|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datastax.driver.core.Metrics
public class Metrics
Metrics exposed by the driver.
The metrics exposed by this class use the Metrics library and you should refer its documentation for details on how to handle the exposed metric objects.
By default, metrics are exposed through JMX, which is very useful for development and browsing, but for production environments you may want to have a look at the reporters provided by the Metrics library which could be more efficient/adapted.
Nested Class Summary | |
---|---|
class |
Metrics.Errors
Metrics on errors encountered. |
Method Summary | |
---|---|
com.codahale.metrics.Gauge<Integer> |
getConnectedToHosts()
Returns the number of Cassandra hosts the driver is currently connected to (that is have at least one connection opened to). |
Metrics.Errors |
getErrorMetrics()
Returns an object regrouping metrics related to the errors encountered. |
com.codahale.metrics.Gauge<Integer> |
getKnownHosts()
Returns the number of Cassandra hosts currently known by the driver (that is whether they are currently considered up or down). |
com.codahale.metrics.Gauge<Integer> |
getOpenConnections()
Returns the total number of currently opened connections to Cassandra hosts. |
com.codahale.metrics.MetricRegistry |
getRegistry()
Returns the registry containing all metrics. |
com.codahale.metrics.Timer |
getRequestsTimer()
Returns metrics on the user requests performed on the Cluster. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public com.codahale.metrics.MetricRegistry getRegistry()
The metrics registry allows you to easily use the reporters that ships with Metrics or a custom written one.
For instance, if metrics
is this
object, you could export the
metrics to csv files using:
com.codahale.metrics.CsvReporter.forRegistry(metrics.getRegistry()).build(new File("measurements/")).start(1, TimeUnit.SECONDS);
public com.codahale.metrics.Timer getRequestsTimer()
This metric exposes
Timer
metric object exposing the rate and latency for
user requests.public Metrics.Errors getErrorMetrics()
public com.codahale.metrics.Gauge<Integer> getKnownHosts()
public com.codahale.metrics.Gauge<Integer> getConnectedToHosts()
public com.codahale.metrics.Gauge<Integer> getOpenConnections()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |