Class DefaultStatisticsData
java.lang.Object
de.hybris.platform.servicelayer.stats.DefaultStatisticsData
- All Implemented Interfaces:
StatisticsData
Class stores data collected by Collectors in a map.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDataCollector(String name) Method adds a new collector with key name.voidbalanceDataLevels(String name) Method checks, if ticks held in different levels still observe the defined borders.booleancontainsDataCollector(String name) Find out, whether the Data-Collector identified by name is registered.Object[][]getAllData(String name, int maxTicks, long utcOffset) Get all available data of the Data-Collector defined by name.floatgetCollectorValue(String name, long timestamp) Get one value of the collector called name at the given timestamp.intgetCurrentSize(String name) Get the current size of the data-collector called name.int[]getLevelSizes(String name) Returns the tick-amount in the different level-sizes as int-Array.Object[][]getTickAsArray(String name, long period, int maxTicks, long utcOffset) Get time-period of length period in ms from Collector name as Object Array.Object[][]getTimePeriodData(String name, long start, long end, long utcOffset) Get the data of a speciific period of time from start till end.protected voidprintStats(String name) booleanMethod for putting one collected dataset consisting of a timestamp and a value.booleanremoveDataCollector(String name) Removes a registered Data-Collector, defined by name.voidsetSizeLvl1Ms(long ms) Setter for the time-period ticks are stored in level-1.voidsetSizeLvl2Ms(long ms) Setter for the time-period, ticks are stored in level-2.voidsetSizeLvl3Ms(long ms) Setter for the time-period, ticks are stored in level-3.protected voidtrimAndAggregate(NavigableMap<Long, Float> fromMap, NavigableMap<Long, Float> toMap, long now, long millisToKeep, int ticksToRemoveAtOnce)
-
Constructor Details
-
DefaultStatisticsData
public DefaultStatisticsData()
-
-
Method Details
-
addDataCollector
Description copied from interface:StatisticsDataMethod adds a new collector with key name.- Specified by:
addDataCollectorin interfaceStatisticsData- Parameters:
name- The name of the collector.- Returns:
- boolean True, if added successfully.
-
removeDataCollector
Description copied from interface:StatisticsDataRemoves a registered Data-Collector, defined by name.- Specified by:
removeDataCollectorin interfaceStatisticsData- Parameters:
name- String The name, defining the collector to be removed.- Returns:
- boolean Indicating if Data-Collector has been removed sucessfull.
-
containsDataCollector
Description copied from interface:StatisticsDataFind out, whether the Data-Collector identified by name is registered.- Specified by:
containsDataCollectorin interfaceStatisticsData- Parameters:
name- String The name identifying the Data-Collector.- Returns:
- boolean Indicates if the Data-Collector with name is registered.
-
putData
Description copied from interface:StatisticsDataMethod for putting one collected dataset consisting of a timestamp and a value.- Specified by:
putDatain interfaceStatisticsData- Parameters:
name- The name of the data that are collected.timestamp- The time when the value has been collected, as milliseconds passed since 01.01.1970.value- The value that has been collected at specified time.
-
printStats
-
balanceDataLevels
Description copied from interface:StatisticsDataMethod checks, if ticks held in different levels still observe the defined borders. If one Level contains data that must not be held by this level, the data is transfered into the next level, or regarding third level, dumped. This method should be called when the data-collector returns a value that does not need to be stored, to make sure that even if there are no new ticks added to the map, the contained data does not antiquate.- Specified by:
balanceDataLevelsin interfaceStatisticsData- Parameters:
name- The name of the Collector that should be balanced.
-
getTimePeriodData
Description copied from interface:StatisticsDataGet the data of a speciific period of time from start till end.- Specified by:
getTimePeriodDatain interfaceStatisticsData- Parameters:
name- The name of the data you want to get.start- The start-timestamp for the data.end- The end-timestamp for the data.utcOffset- The difference between local client time and UTC-time (server time) in ms.- Returns:
- Map<Long, Float>, containing the data during the given time period.
-
getAllData
Description copied from interface:StatisticsDataGet all available data of the Data-Collector defined by name.- Specified by:
getAllDatain interfaceStatisticsData- Parameters:
name- String The name defining the Data-Collector you want to get the Data from.maxTicks- The maximum number of ticks that will be returned.utcOffset- The difference between local client time and UTC-time (server time) in ms.- Returns:
- Map<Long, Float> The Map containing all Key-Value pairs of the Data-Collector with name name.
-
getTickAsArray
Description copied from interface:StatisticsDataGet time-period of length period in ms from Collector name as Object Array.- Specified by:
getTickAsArrayin interfaceStatisticsData- Parameters:
name- The name identifying the DataCollector, which data is returned.period- Defines how long into past the time period should reach from now.maxTicks- Specifies the maximum number of Ticks that should be returned.utcOffset- The difference between local client time and UTC-time (server time) in ms.- Returns:
- The Object[][] containing the x- and y-value for drawing a diagram.
-
getCurrentSize
Description copied from interface:StatisticsDataGet the current size of the data-collector called name.- Specified by:
getCurrentSizein interfaceStatisticsData- Returns:
- The current size of the stored data for collector called name.
-
getLevelSizes
Returns the tick-amount in the different level-sizes as int-Array.- Parameters:
name- The name of the Collector, the level-sizes should be returned for.- Returns:
- Array containing the amount of ticks stored in the different levels.
-
setSizeLvl1Ms
public void setSizeLvl1Ms(long ms) Setter for the time-period ticks are stored in level-1. -
setSizeLvl2Ms
public void setSizeLvl2Ms(long ms) Setter for the time-period, ticks are stored in level-2. -
setSizeLvl3Ms
public void setSizeLvl3Ms(long ms) Setter for the time-period, ticks are stored in level-3. -
getCollectorValue
Description copied from interface:StatisticsDataGet one value of the collector called name at the given timestamp.- Specified by:
getCollectorValuein interfaceStatisticsData- Parameters:
name- The name of the collector.timestamp- The timestamp you want to have the value of.- Returns:
- The value of the collector at the given timestamp. -1 if no such collector or timestamp available.
-