HistoricMetric

public class HistoricMetric

Class HistoricMetric. Provides historicmetric functionality for the Hytale server.

java.lang.Object > HistoricMetric

Field Summary

bufferSize

final int bufferSize

Field bufferSize.

values

final long[] values

Field values.

start

final int start

Field start.

nextIndex

final int nextIndex

Field nextIndex.

value

final long value

Field value.

periodsNanos

final long[] periodsNanos

Field periodsNanos.

periodAverages

final AverageCollector[] periodAverages

Field periodAverages.

startIndices

final int[] startIndices

Field startIndices.

timestamps

final long[] timestamps

Field timestamps.

oldestPossibleTimestamp

final long oldestPossibleTimestamp

Field oldestPossibleTimestamp.

average

final AverageCollector average

Field average.

oldValue

final long oldValue

Field oldValue.

length

final int length

Field length.

data

final long[] data

Field data.

last

final long last

Field last.

nanos

final long nanos

Field nanos.

Method Detail

HistoricMetric

public private HistoricMetric ()

Method HistoricMetric.

getPeriodsNanos

public long[] getPeriodsNanos ()

Method getPeriodsNanos.

calculateMin

public long calculateMin (final int periodIndex)

Method calculateMin.

Parameters:
final int periodIndex

getAverage

public double getAverage (final int periodIndex)

Method getAverage.

Parameters:
final int periodIndex

calculateMax

public long calculateMax (final int periodIndex)

Method calculateMax.

Parameters:
final int periodIndex

clear

public void clear ()

Method clear.

add

public void add (final long timestampNanos, final long value)

Method add.

Parameters:
final long timestampNanos
final long value

getTimestamps

public long[] getTimestamps (final int periodIndex)

Method getTimestamps.

Parameters:
final int periodIndex

getValues

public long[] getValues (final int periodIndex)

Method getValues.

Parameters:
final int periodIndex

getAllTimestamps

public long[] getAllTimestamps ()

Method getAllTimestamps.

getAllValues

public long[] getAllValues ()

Method getAllValues.

setAllTimestamps

public void setAllTimestamps (@Nonnull final long[] timestamps)

Method setAllTimestamps.

Parameters:
@Nonnull final long[] timestamps

setAllValues

public void setAllValues (@Nonnull final long[] values)

Method setAllValues.

Parameters:
@Nonnull final long[] values

getLastValue

public long getLastValue ()

Method getLastValue.

builder

static Builder builder (final long minimumInterval, @Nonnull final TimeUnit unit)

Method builder.

Parameters:
final long minimumInterval
@Nonnull final TimeUnit unit

KeyedCodec

public new KeyedCodec ("Timestamps", Codec.LONG_ARRAY)

Method KeyedCodec.

Parameters:
"Timestamps" "Timestamps"
Codec.LONG_ARRAY Codec.LONG_ARRAY

addPeriod

public Builder addPeriod (final long period, @Nonnull final TimeUnit unit)

Method addPeriod.

Parameters:
final long period
@Nonnull final TimeUnit unit

build

public HistoricMetric build ()

Method build.