Package org.voltdb.client
Class ClientStatsContext
java.lang.Object
org.voltdb.client.ClientStatsContext
An object to store and manipulate statistics information from the VoltDB Java client. Each instance has a set of timestamped baseline statistics and a set of timestamped current statistics. Given these two sets of data, this object can return statistics covering the period between the baseline data and current data.
An instance is created using Client.createStatsContext()
.
Mutliple instances can coexist, each covering a different time
period. See the Voter example in /examples for an example of using
one context for long term stats and another for short term updates.
-
Method Summary
Modifier and TypeMethodDescriptionfetch()
Fetch current statistics from the client internals.Fetch current statistics from the client internals and set them to be the current baseline.Get the client affinity stats.Roll up the per-partition affinity stats and return the totals for each of the four categories.Return a map of maps by connection id.getStats()
Return aClientStats
that covers all procedures and all connection ids.Return a map ofClientStats
by connection id.Return a map ofClientStats
by procedure name.getStatsForProcedure
(String procedureName) Return aClientStats
instance for a specific procedure name.void
-
Method Details
-
fetch
Fetch current statistics from the client internals. Don't update the baseline. This will increase the range covered by anyClientStats
instances returned from this context.- Returns:
- A
this
pointer for chaining calls.
-
fetchAndResetBaseline
Fetch current statistics from the client internals and set them to be the current baseline. Subsequent calls togetStats(..)
methods on this instance will return 0 values for all statistics until eitherfetch()
orfetchAndResetBaseline()
are called.- Returns:
- A new ClientStatsContext object that uses the newly fetched stats with the old baseline.
-
getStats
Return aClientStats
that covers all procedures and all connection ids. TheClientStats
instance will apply to the time period currently covered by the context. If the mergedClientStats
has no recorded transactions then we force the timestamps to the context's range, to avoid strange results from the start time being after the end time.- Returns:
- A
ClientStats
instance.
-
getStatsByProc
Return a map ofClientStats
by procedure name. This will roll upClientStats
instances by connection id. EachClientStats
instance will apply to the time period currently covered by the context.- Returns:
- A map from procedure name to
ClientStats
instances.
-
getStatsByConnection
Return a map ofClientStats
by connection id. This will roll upClientStats
instances by procedure name for each connection. Note that connection id is unique, while hostname and port may not be. Hostname and port will be included in theClientStats
instance data. EachClientStats
instance will apply to the time period currently covered by the context.- Returns:
- A map from connection id to
ClientStats
instances.
-
getCompleteStats
Return a map of maps by connection id. Each sub-map maps procedure names toClientStats
instances. Note that connection id is unique, while hostname and port may not be. Hostname and port will be included in theClientStats
instance data. EachClientStats
instance will apply to the time period currently covered by the context. This is full set of data available from this context instance.- Returns:
- A map from connection id to
ClientStats
instances.
-
getAffinityStats
Get the client affinity stats. Will only be populated if client affinity is enabled.- Returns:
- A map from an internal partition id to a
ClientAffinityStats
instance.
-
getAggregateAffinityStats
Roll up the per-partition affinity stats and return the totals for each of the four categories. Will only be populated if client affinity is enabled.- Returns:
- A
ClientAffinityStats
instance covering all partitions.
-
getStatsForProcedure
Return aClientStats
instance for a specific procedure name. This will be rolled up across all connections. TheClientStats
instance will apply to the time period currently covered by the context.- Parameters:
procedureName
- Name of the procedure.- Returns:
- A
ClientStats
instance.
-
getConnectionRequestStats
-
resetConnectionRequestStats
public void resetConnectionRequestStats()
-