Module datarush.commons
Class StatisticDefinition<T extends StatisticSupplier>
java.lang.Object
com.pervasive.datarush.monitoring.StatisticDefinition<T>
- Type Parameters:
T- the type ofStatisticSupplierassociated with this statistic.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AccumulatedTimerDefinition,CounterDefinition,GaugeDefinition,IntervalTimerDefinition
public abstract class StatisticDefinition<T extends StatisticSupplier>
extends Object
implements Serializable
Provides metadata for a statistic including including display name controls
how the statistic is to be aggregated across partitions.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabstract Taggregate(List<? extends StatisticSupplier> values) Performs aggregation across statistics.abstract Tcast(StatisticSupplier value) Casts theStatisticSupplierto this definition, substituting a default value for null.final Stringcategory()Returns a category for this statistic type.abstract StatisticDefinition<T>Sets the categorystatic CounterDefinitioncpuTime()A statistic that provides the cpu time in milliseconds.final StringReturns a display name for this statistic type.static IntervalTimerDefinitionduration()A statistic that provides the total time that an operation has been running.final booleanTwoStatisticDefinition's are considered equal iff their ids are equal.final TfinalSnapshot(StatisticSupplier supplier) Returns a snapshot view of the given statistics with all statistics appropriate for a graph that is in a terminated state.final inthashCode()Returns a hashCode for this definition based on itsid()final Stringid()Returns a unique identifier for this statistic type.static CounterDefinitionioBytes(String provider, IOChannelOperation operation) A statistic that provides the number of io bytes.static CounterDefinitionioCount(String provider, IOChannelOperation operation) A statistic that provides the number of io operations.final booleanIndicates that this statistic refers to a concept that is inherently non-parallel.abstract StatisticDefinition<T>nonPartitioned(boolean nonPartitioned) Indicates that this statistic refers to a concept that is inherently non-parallel.toString()
-
Field Details
-
CATEGORY_GENERAL
The name of the default category- See Also:
-
CATEGORY_IO
The name of the category for I/O related statistics- See Also:
-
-
Method Details
-
duration
A statistic that provides the total time that an operation has been running. This statistic aggregates in the same way thatIntervalTimerDefinition's always aggregate:- The min start time is calculated across all partitions
- The max stop time (or current time if timer is still running)is calculated across all partitions
- The interval is calculated by subtracting min start time from max stop time
- Returns:
- total time duration
-
cpuTime
A statistic that provides the cpu time in milliseconds. The counter will beStatisticState.FINISHEDwhen the operator finishes execution. This statistic aggregates horizontally by summation. This statistic aggregates vertically (within a composite) by summation as well.- Returns:
- cpuTime in milliSeconds
-
ioBytes
A statistic that provides the number of io bytes. This statistic is broken down by filesystem provider type.- Parameters:
provider- the filesystem provideroperation- the read/write operation- Returns:
- the definition
-
ioCount
A statistic that provides the number of io operations. This statistic is broken down by filesystem provider type.- Parameters:
provider- the filesystem provideroperation- the read/write operation- Returns:
- the definition
-
id
Returns a unique identifier for this statistic type.- Returns:
- a unique identifier for this statistic type.
-
displayName
Returns a display name for this statistic type.- Returns:
- a display for this statistic type.
-
category
Returns a category for this statistic type.- Returns:
- a category for this statistic type.
-
nonPartitioned
public final boolean nonPartitioned()Indicates that this statistic refers to a concept that is inherently non-parallel. An example would be planning statistics.- Returns:
- whether this statistic refers to a non-partitioned concept
-
hashCode
public final int hashCode()Returns a hashCode for this definition based on itsid() -
equals
TwoStatisticDefinition's are considered equal iff their ids are equal.- Overrides:
equalsin classObject- Returns:
- other is a
StatisticDefinitionof the same name as this.
-
toString
-
category
Sets the category- Parameters:
category- the category- Returns:
- a newly-created
StatisticDefinition.
-
nonPartitioned
Indicates that this statistic refers to a concept that is inherently non-parallel. An example would be planning statistics.- Parameters:
nonPartitioned- whether this statistic refers to a non-partitioned concept- Returns:
- a newly-created
StatisticDefinition.
-
cast
Casts theStatisticSupplierto this definition, substituting a default value for null.- Parameters:
value- the value- Returns:
- a casted value or default if null.
- Throws:
ClassCastException- if the supplier is not of typeT
-
finalSnapshot
Returns a snapshot view of the given statistics with all statistics appropriate for a graph that is in a terminated state.- Parameters:
supplier- the original statistic- Returns:
- a snapshot view of the original statistic
- Throws:
ClassCastException- if the supplier is not of typeT
-
aggregate
Performs aggregation across statistics. Statistics will be aggregated in a manner specific to the concrete definition.- Parameters:
values- the values to aggregate- Returns:
- the aggregated value
- Throws:
ClassCastException- if any of the values are not of typeT
-