public class ClientStatsContext
extends java.lang.Object
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.
Modifier and Type | Method and Description |
---|---|
ClientStatsContext |
fetch()
Fetch current statistics from the client internals.
|
ClientStatsContext |
fetchAndResetBaseline()
Fetch current statistics from the client internals and set them to be the current baseline.
|
java.util.Map<java.lang.Integer,ClientAffinityStats> |
getAffinityStats()
Get the client affinity stats.
|
ClientAffinityStats |
getAggregateAffinityStats()
Roll up the per-partition affinity stats and return the totals for each of the four
categories.
|
java.util.Map<java.lang.Long,java.util.Map<java.lang.String,ClientStats>> |
getCompleteStats()
Return a map of maps by connection id.
|
ClientStats |
getStats()
Return a
ClientStats that covers all procedures and
all connection ids. |
java.util.Map<java.lang.Long,ClientStats> |
getStatsByConnection()
Return a map of
ClientStats by connection id. |
java.util.Map<java.lang.String,ClientStats> |
getStatsByProc()
Return a map of
ClientStats by procedure name. |
ClientStats |
getStatsForProcedure(java.lang.String procedureName)
Return a
ClientStats instance for a specific procedure
name. |
public ClientStatsContext fetch()
ClientStats
instances returned from this
context.this
pointer for chaining calls.public ClientStatsContext fetchAndResetBaseline()
getStats(..)
methods on this instance will return 0 values for
all statistics until either fetch()
or fetchAndResetBaseline()
are called.public ClientStats getStats()
ClientStats
that covers all procedures and
all connection ids. The ClientStats
instance will
apply to the time period currently covered by the context.
If the merged ClientStats
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.ClientStats
instance.public java.util.Map<java.lang.String,ClientStats> getStatsByProc()
ClientStats
by procedure name. This will
roll up ClientStats
instances by connection id. Each
ClientStats
instance will apply to the time period
currently covered by the context.ClientStats
instances.public java.util.Map<java.lang.Long,ClientStats> getStatsByConnection()
ClientStats
by connection id. This will
roll up ClientStats
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 the
ClientStats
instance data. Each ClientStats
instance will apply to the time period currently covered by the
context.ClientStats
instances.public java.util.Map<java.lang.Long,java.util.Map<java.lang.String,ClientStats>> getCompleteStats()
ClientStats
instances. Note that connection id is
unique, while hostname and port may not be. Hostname and port will
be included in the ClientStats
instance data. Each
ClientStats
instance will apply to the time period currently
covered by the context. This is full set of data available from this
context instance.ClientStats
instances.public java.util.Map<java.lang.Integer,ClientAffinityStats> getAffinityStats()
ClientAffinityStats
instance.public ClientAffinityStats getAggregateAffinityStats()
ClientAffinityStats
instance covering all partitions.public ClientStats getStatsForProcedure(java.lang.String procedureName)
ClientStats
instance for a specific procedure
name. This will be rolled up across all connections. The
ClientStats
instance will apply to the time period
currently covered by the context.procedureName
- Name of the procedure.ClientStats
instance.