@ThreadSafe public class RepositoryStatistics extends Object implements RepositoryMonitor, ChangeSetListener
active sessions
- the number of sessions that are open during the window;active queries
- the number of queries that were executing during the window;workspaces
- the number of workspaces in existence during the window;listeners
- the number of listeners registered during the window;session-scoped locks
- the number of locks held by sessions during the
window;non-scoped locks
- the number of non-scoped locks held during the window;
save operations
- the number of Session save operations performed the window;changed nodes
- the number of nodes that were created, updated, or deleted during
the window;session lifetime
- the duration of the sessions closed during the window;query execution time
- the duration of queries that finished during the
window;sequencer execution time
- the duration of sequencing operations
completed during the window;history
for a particular metric during a specified window, where the
window is comprised of the statistics
(the average value, minimum value, maximum value, variance, standard
deviation, number of samples, and time interval of the statistics) for:
To use, simply instantiate and start
it by supplying a
ScheduledExecutorService
instance, which is used to create a periodic task that runs every 5 seconds to roll up
measured metrics into the various statistic windows. When completed, simply call stop()
to have the object clean up
after itself.
Modifier and Type | Class and Description |
---|---|
static class |
RepositoryStatistics.DurationActivityImpl
The
RepositoryStatistics.MetricHistory specialization used for recording the statistics for activities with measured durations. |
protected static class |
RepositoryStatistics.DurationHistory |
protected static class |
RepositoryStatistics.MetricHistory
Abstract base class for the
RepositoryStatistics.ValueHistory and RepositoryStatistics.DurationHistory classes. |
protected static class |
RepositoryStatistics.ValueHistory
The
RepositoryStatistics.MetricHistory specialization used for recording the statistics for running values. |
Modifier and Type | Field and Description |
---|---|
static long |
CAPTURE_INTERVAL_IN_SECONDS
The frequency at which the metric values are rolled into statistics.
|
protected static long |
DURATION_OF_24_HOURS_WINDOW_IN_SECONDS |
protected static long |
DURATION_OF_52_WEEKS_WINDOW_IN_SECONDS |
protected static long |
DURATION_OF_60_MINUTES_WINDOW_IN_SECONDS |
protected static long |
DURATION_OF_60_SECONDS_WINDOW_IN_SECONDS |
protected static long |
DURATION_OF_7_DAYS_WINDOW_IN_SECONDS |
static int |
MAXIMUM_LONG_RUNNING_QUERY_COUNT
The maximum number of longest-running queries to retain.
|
static int |
MAXIMUM_LONG_RUNNING_SEQUENCING_COUNT
The maximum number of longest-running sequencing operations to retain.
|
static int |
MAXIMUM_LONG_RUNNING_SESSION_COUNT
The maximum number of longest-running sessions to retain.
|
ALL_DURATION_METRICS, ALL_VALUE_METRICS, ALL_WINDOWS, EMPTY_MONITOR
Modifier and Type | Method and Description |
---|---|
void |
decrement(ValueMetric metric)
Record an decrement in a value, called by the code that knows when and how the metric changes.
|
Set<DurationMetric> |
getAvailableDurationMetrics()
Get the DurationMetric enumerations that are available for use by the caller with
RepositoryMonitor.getHistory(DurationMetric, Window) . |
Set<ValueMetric> |
getAvailableValueMetrics()
Get the ValueMetric enumerations that are available for use by the caller with
RepositoryMonitor.getHistory(ValueMetric, Window) . |
Set<Window> |
getAvailableWindows()
Get the Window enumerations that are available for use by the caller with
RepositoryMonitor.getHistory(DurationMetric, Window) and
RepositoryMonitor.getHistory(ValueMetric, Window) . |
History |
getHistory(DurationMetric metric,
Window windowInTime)
Get the statics for the specified duration metric during the given window in time.
|
History |
getHistory(ValueMetric metric,
Window windowInTime)
Get the statics for the specified value metric during the given window in time.
|
DurationActivity[] |
getLongestRunning(DurationMetric metric)
Get the longest-running activities recorded for the specified metric.
|
void |
increment(ValueMetric metric)
Record an increment in a value, called by the code that knows when and how the metric changes.
|
void |
increment(ValueMetric metric,
long incrementalValue)
Record an incremental change to a value, called by the code that knows when and how the metric changes.
|
void |
notify(ChangeSet changeSet)
Notifies a listener of the given changes.
|
void |
set(ValueMetric metric,
long value)
Record a specific value for a metric, called by the code that knows when and how the metric changes.
|
static Statistics |
statisticsFor(long value)
Utility method to construct the statistics for a series of values.
|
static Statistics |
statisticsFor(long[] values)
Utility method to construct the statistics for a series of values.
|
static Statistics |
statisticsFor(Statistics[] statistics)
Utility method to construct the composite statistics for a series of sampled statistics.
|
public static final int MAXIMUM_LONG_RUNNING_QUERY_COUNT
public static final int MAXIMUM_LONG_RUNNING_SEQUENCING_COUNT
public static final int MAXIMUM_LONG_RUNNING_SESSION_COUNT
public static final long CAPTURE_INTERVAL_IN_SECONDS
protected static final long DURATION_OF_52_WEEKS_WINDOW_IN_SECONDS
protected static final long DURATION_OF_7_DAYS_WINDOW_IN_SECONDS
protected static final long DURATION_OF_24_HOURS_WINDOW_IN_SECONDS
protected static final long DURATION_OF_60_MINUTES_WINDOW_IN_SECONDS
protected static final long DURATION_OF_60_SECONDS_WINDOW_IN_SECONDS
public Set<DurationMetric> getAvailableDurationMetrics()
RepositoryMonitor
RepositoryMonitor.getHistory(DurationMetric, Window)
.getAvailableDurationMetrics
in interface RepositoryMonitor
RepositoryMonitor.getHistory(DurationMetric, Window)
,
RepositoryMonitor.getLongestRunning(DurationMetric)
public Set<ValueMetric> getAvailableValueMetrics()
RepositoryMonitor
RepositoryMonitor.getHistory(ValueMetric, Window)
.getAvailableValueMetrics
in interface RepositoryMonitor
RepositoryMonitor.getHistory(ValueMetric, Window)
public Set<Window> getAvailableWindows()
RepositoryMonitor
RepositoryMonitor.getHistory(DurationMetric, Window)
and
RepositoryMonitor.getHistory(ValueMetric, Window)
.getAvailableWindows
in interface RepositoryMonitor
RepositoryMonitor.getHistory(DurationMetric, Window)
,
RepositoryMonitor.getHistory(ValueMetric, Window)
public History getHistory(ValueMetric metric, Window windowInTime)
RepositoryMonitor
getHistory
in interface RepositoryMonitor
metric
- the value metric; may not be nullwindowInTime
- the window specifying which statistics are to be returned; may not be nullRepositoryMonitor.getAvailableValueMetrics()
,
RepositoryMonitor.getAvailableWindows()
public History getHistory(DurationMetric metric, Window windowInTime)
RepositoryMonitor
getHistory
in interface RepositoryMonitor
metric
- the duration metric; may not be nullwindowInTime
- the window specifying which statistics are to be returned; may not be nullRepositoryMonitor.getAvailableDurationMetrics()
,
RepositoryMonitor.getAvailableWindows()
public DurationActivity[] getLongestRunning(DurationMetric metric)
RepositoryMonitor
getLongestRunning
in interface RepositoryMonitor
metric
- the duration metric; may not be nullRepositoryMonitor.getAvailableDurationMetrics()
public void increment(ValueMetric metric, long incrementalValue)
metric
- the metric; may not be nullincrementalValue
- the positive or negative incrementincrement(ValueMetric)
,
decrement(ValueMetric)
,
recordDuration(DurationMetric, long, TimeUnit, Map)
public void increment(ValueMetric metric)
metric
- the metric; may not be nullincrement(ValueMetric, long)
,
decrement(ValueMetric)
,
recordDuration(DurationMetric, long, TimeUnit, Map)
public void set(ValueMetric metric, long value)
metric
- the metric; may not be nullvalue
- the value for the metricincrement(ValueMetric, long)
,
decrement(ValueMetric)
,
recordDuration(DurationMetric, long, TimeUnit, Map)
public void decrement(ValueMetric metric)
metric
- the metric; may not be nullincrement(ValueMetric)
,
increment(ValueMetric, long)
,
recordDuration(DurationMetric, long, TimeUnit, Map)
public void notify(ChangeSet changeSet)
ChangeSetListener
notify
in interface ChangeSetListener
changeSet
- a non-null
ChangeSet
public static Statistics statisticsFor(long value)
value
- the single valuepublic static Statistics statisticsFor(long[] values)
values
- the values; the array reference may not be null but the array may be emptypublic static Statistics statisticsFor(Statistics[] statistics)
statistics
- the sample statistics that are to be combined; the array reference may not be null but the array may be
emptyCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.