Package org.openspaces.admin.internal.pu
Class DefaultProcessingUnitStatistics
java.lang.Object
org.openspaces.admin.internal.pu.DefaultProcessingUnitStatistics
- All Implemented Interfaces:
ProcessingUnitStatistics,InternalProcessingUnitStatistics
public class DefaultProcessingUnitStatistics
extends Object
implements InternalProcessingUnitStatistics
This class performs 3 calculations on raw statistics: timeWindow, agentZones and instances
calculations in order to transform the raw statisticsId into the requested statisticsId
raw statisticsid read from pu instance (timestamp = now): ["mybean", "memory" ,
LastSampleTimeWindowStatisticsConfig, SingleInstanceStatisticsConfig("instance1"),
ExactZoneConfig("zone1")]
time calculated statisticsId (timestamp = now, but the calculator averaged the last 60 seconds):
["mybean", "memory" , AverageTimeWindowStatisticsConfig(60), SingleInstanceStatisticsConfig("instance1"),
ExactZoneConfig("zone1")]
zone calculated statisticsId (the zone is changed to reflect the requested statisticsId):
["mybean", "memory" , AverageTimeWindowStatisticsConfig(60), SingleInstanceStatisticsConfig("instance1"),
AtLeastOneZoneConfig("zone1")]
instances calculated statisticsId (the instances changed to reflect the average across all
instances) This is also the requested statisticId: ["mybean", "memory" ,
AverageTimeWindowStatisticsConfig(60), AverageInstancesStatisticsConfig ,
AtLeastOneZoneConfig("zone1")]
- Author:
- Itai Frenkel
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultProcessingUnitStatistics(long adminTimestamp, ProcessingUnitStatistics lastStatistics, int historySize) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStatistics(ProcessingUnitStatisticsId statisticsId, Object statisticsValue) Adds raw statistics valuesvoidcalculateStatistics(Iterable<ProcessingUnitStatisticsId> statisticsIds) Calculates new statistics based on previously added statistics and the specified statistics calculations and the list of instance UIDslongtoString()
-
Constructor Details
-
DefaultProcessingUnitStatistics
public DefaultProcessingUnitStatistics(long adminTimestamp, ProcessingUnitStatistics lastStatistics, int historySize)
-
-
Method Details
-
getAdminTimestamp
public long getAdminTimestamp()- Specified by:
getAdminTimestampin interfaceProcessingUnitStatistics- Returns:
- a timestamp that is in sync with where the admin API is running. Can return -1 if the clocks have are not sync yet.
-
getPrevious
- Specified by:
getPreviousin interfaceProcessingUnitStatistics- Returns:
- the previous processing unit statistics
-
getStatistics
- Specified by:
getStatisticsin interfaceProcessingUnitStatistics- Returns:
- the statistics value for a single instance or aggregation of the complete cluster. The value can be Double , Number, String or any other type (Object).
- See Also:
-
addStatistics
Description copied from interface:InternalProcessingUnitStatisticsAdds raw statistics values- Specified by:
addStatisticsin interfaceInternalProcessingUnitStatistics
-
calculateStatistics
Description copied from interface:InternalProcessingUnitStatisticsCalculates new statistics based on previously added statistics and the specified statistics calculations and the list of instance UIDs- Specified by:
calculateStatisticsin interfaceInternalProcessingUnitStatistics- See Also:
-
toString
-