- java.lang.Object
-
- com.pervasive.datarush.monitoring.StatisticDefinition<CounterSupplier>
-
- com.pervasive.datarush.monitoring.CounterDefinition
-
- All Implemented Interfaces:
Serializable
public final class CounterDefinition extends StatisticDefinition<CounterSupplier>
Definition associated with aCounterSupplier
. Counters may aggregate by eitherCounterAggregator.SUM
,CounterAggregator.MIN
, orCounterAggregator.MAX
.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.pervasive.datarush.monitoring.StatisticDefinition
CATEGORY_GENERAL, CATEGORY_IO
-
-
Constructor Summary
Constructors Constructor Description CounterDefinition(String id, String displayName)
Creates a definition with default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CounterSupplier
aggregate(List<? extends StatisticSupplier> values)
Performs aggregation across statistics.CounterAggregator
aggregator()
Returns the aggregator to use for counter aggregation.CounterDefinition
aggregator(CounterAggregator aggregator)
Sets the aggregator to use for aggregationCounterSupplier
cast(StatisticSupplier value)
Casts theStatisticSupplier
to this definition, substituting a default value for null.CounterDefinition
category(String category)
Sets the categoryCounterSupplier
doFinalSnapshot(StatisticSupplier supplier)
CounterDefinition
nonPartitioned(boolean nonPartitioned)
Indicates that this statistic refers to a concept that is inherently non-parallel.String
shortName()
Returns a shortened name that can be used in some ui display contexts.CounterDefinition
shortName(String shortName)
Sets a shortened name that can be used in some ui display contexts.UnitOfMeasure
unitOfMeasure()
Returns the unit of measure.CounterDefinition
unitOfMeasure(UnitOfMeasure unitOfMeasure)
Sets the unit of measure.-
Methods inherited from class com.pervasive.datarush.monitoring.StatisticDefinition
category, cpuTime, displayName, duration, equals, finalSnapshot, hashCode, id, ioBytes, ioCount, nonPartitioned, toString
-
-
-
-
Constructor Detail
-
CounterDefinition
public CounterDefinition(String id, String displayName)
Creates a definition with default values. This definition aggregates byCounterAggregator.SUM
and an unspecified unit of measure.- Parameters:
id
- the id for the statisticdisplayName
- the display name of this statistic
-
-
Method Detail
-
aggregator
public CounterAggregator aggregator()
Returns the aggregator to use for counter aggregation.- Returns:
- the aggregator to use for counter aggregation.
-
unitOfMeasure
public UnitOfMeasure unitOfMeasure()
Returns the unit of measure.- Returns:
- the unit of measure.
-
shortName
public String shortName()
Returns a shortened name that can be used in some ui display contexts. By default this is the same asStatisticDefinition.displayName()
.- Returns:
- a short name
-
category
public CounterDefinition category(String category)
Description copied from class:StatisticDefinition
Sets the category- Specified by:
category
in classStatisticDefinition<CounterSupplier>
- Parameters:
category
- the category- Returns:
- a newly-created
StatisticDefinition
.
-
unitOfMeasure
public CounterDefinition unitOfMeasure(UnitOfMeasure unitOfMeasure)
Sets the unit of measure.- Parameters:
unitOfMeasure
- the unit of measure- Returns:
- a newly-created
CounterStatisticDefinition
.
-
shortName
public CounterDefinition shortName(String shortName)
Sets a shortened name that can be used in some ui display contexts. By default this is the same asStatisticDefinition.displayName()
.- Parameters:
shortName
- a short name- Returns:
- a newly-created
CounterStatisticDefinition
.
-
aggregator
public CounterDefinition aggregator(CounterAggregator aggregator)
Sets the aggregator to use for aggregation- Parameters:
aggregator
- the aggregator- Returns:
- a newly-created
CounterStatisticDefinition
.
-
aggregate
public CounterSupplier aggregate(List<? extends StatisticSupplier> values)
Description copied from class:StatisticDefinition
Performs aggregation across statistics. Statistics will be aggregated in a manner specific to the concrete definition.- Specified by:
aggregate
in classStatisticDefinition<CounterSupplier>
- Parameters:
values
- the values to aggregate- Returns:
- the aggregated value
-
doFinalSnapshot
public CounterSupplier doFinalSnapshot(StatisticSupplier supplier)
-
cast
public CounterSupplier cast(StatisticSupplier value)
Description copied from class:StatisticDefinition
Casts theStatisticSupplier
to this definition, substituting a default value for null.- Specified by:
cast
in classStatisticDefinition<CounterSupplier>
- Parameters:
value
- the value- Returns:
- a casted value or default if null.
-
nonPartitioned
public CounterDefinition nonPartitioned(boolean nonPartitioned)
Description copied from class:StatisticDefinition
Indicates that this statistic refers to a concept that is inherently non-parallel. An example would be planning statistics.- Specified by:
nonPartitioned
in classStatisticDefinition<CounterSupplier>
- Parameters:
nonPartitioned
- whether this statistic refers to a non-partitioned concept- Returns:
- a newly-created
StatisticDefinition
.
-
-