Interface StatisticsData
- All Known Implementing Classes:
DefaultStatisticsData
public interface StatisticsData
Interface for data collected by StatisticsService.
-
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.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.booleanMethod for putting one collected dataset consisting of a timestamp and a value.booleanremoveDataCollector(String name) Removes a registered Data-Collector, defined by name.
-
Method Details
-
addDataCollector
Method adds a new collector with key name.- Parameters:
name- The name of the collector.- Returns:
- boolean True, if added successfully.
-
removeDataCollector
Removes a registered Data-Collector, defined by name.- Parameters:
name- String The name, defining the collector to be removed.- Returns:
- boolean Indicating if Data-Collector has been removed sucessfull.
-
containsDataCollector
Find out, whether the Data-Collector identified by name is registered.- Parameters:
name- String The name identifying the Data-Collector.- Returns:
- boolean Indicates if the Data-Collector with name is registered.
-
putData
Method for putting one collected dataset consisting of a timestamp and a value.- 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.
-
getTimePeriodData
Get the data of a speciific period of time from start till end.- 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
Get all available data of the Data-Collector defined by name.- Parameters:
name- String The name defining the Data-Collector you want to get the Data from.utcOffset- The difference between local client time and UTC-time (server time) in ms.maxTicks- The maximum number of ticks that will be returned.- Returns:
- Map<Long, Float> The Map containing all Key-Value pairs of the Data-Collector with name name.
-
getTickAsArray
Get time-period of length period in ms from Collector name as Object Array.- 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
Get the current size of the data-collector called name.- Returns:
- The current size of the stored data for collector called name.
-
balanceDataLevels
Method 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.- Parameters:
name- The name of the Collector that should be balanced.
-
getCollectorValue
Get one value of the collector called name at the given timestamp.- 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.
-