@ThreadSafe public class RepositoryStatistics extends Object implements RepositoryMonitor
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 |
|---|---|
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.
|
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()
RepositoryMonitorRepositoryMonitor.getHistory(DurationMetric, Window).getAvailableDurationMetrics in interface RepositoryMonitorRepositoryMonitor.getHistory(DurationMetric, Window),
RepositoryMonitor.getLongestRunning(DurationMetric)public Set<ValueMetric> getAvailableValueMetrics()
RepositoryMonitorRepositoryMonitor.getHistory(ValueMetric, Window).getAvailableValueMetrics in interface RepositoryMonitorRepositoryMonitor.getHistory(ValueMetric, Window)public Set<Window> getAvailableWindows()
RepositoryMonitorRepositoryMonitor.getHistory(DurationMetric, Window) and
RepositoryMonitor.getHistory(ValueMetric, Window).getAvailableWindows in interface RepositoryMonitorRepositoryMonitor.getHistory(DurationMetric, Window),
RepositoryMonitor.getHistory(ValueMetric, Window)public History getHistory(ValueMetric metric, Window windowInTime)
RepositoryMonitorgetHistory in interface RepositoryMonitormetric - 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)
RepositoryMonitorgetHistory in interface RepositoryMonitormetric - 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)
RepositoryMonitorgetLongestRunning in interface RepositoryMonitormetric - the duration metric; may not be nullRepositoryMonitor.getAvailableDurationMetrics()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-2014 JBoss, a division of Red Hat. All Rights Reserved.