Package jetbrains.buildServer.metrics
Class IntervalStatistic
- java.lang.Object
-
- jetbrains.buildServer.metrics.IntervalStatistic
-
public class IntervalStatistic extends java.lang.Object
This class accumulate N last values for some statistic gathered during specified intervals. For instance, if there is some statistic, like count errors or number of bytes written to disk, instance of this class can be created to hold values for this statistic during the last 10 minutes, 1 hour, 1 day, 1 year and all times.- Since:
- 2018.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IntervalStatistic.Metric
-
Constructor Summary
Constructors Constructor Description IntervalStatistic(TimeService timeService, java.lang.String periods)
Create statistic
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long amount)
Adds specified amount to the statisticvoid
add(long time, long amount)
Adds specified amount to the statisticjava.util.List<IntervalStatistic.Metric>
get()
The statistics are recalculatedvoid
inc()
increase statistics by onevoid
inc(long time)
increase statistics by one
-
-
-
Constructor Detail
-
IntervalStatistic
public IntervalStatistic(@NotNull TimeService timeService, @Nullable java.lang.String periods)
Create statistic- Parameters:
timeService
- time service, it will be used to obtain current time; can`t be nullperiods
- human readable configuration with ";" delimiter, like "10m; 1h; 1d; 30d; 1y"
-
-
Method Detail
-
add
public void add(long time, long amount)
Adds specified amount to the statistic- Parameters:
time
- amount timeamount
- amount to add
-
add
public void add(long amount)
Adds specified amount to the statistic- Parameters:
amount
- amount to add
-
get
public java.util.List<IntervalStatistic.Metric> get()
The statistics are recalculated- Returns:
- statistics
-
inc
public void inc()
increase statistics by one
-
inc
public void inc(long time)
increase statistics by one- Parameters:
time
- statistic time
-
-