Table of Contents

Method FromJsonString

Namespace
Skyline.DataMiner.Utils.Rates.Protocol
Assembly
Skyline.DataMiner.Utils.Rates.Protocol.dll

FromJsonString(string, TimeSpan, TimeSpan, RateBase)

Deserializes a JSON String to a SnmpRate64 instance.
Throws a JsonReaderException if the given rateHelperSerialized is an invalid string representation of a SnmpRate64 instance.

public static SnmpRate64 FromJsonString(string rateHelperSerialized, TimeSpan minDelta, TimeSpan maxDelta, RateBase rateBase = RateBase.Second)

Parameters

rateHelperSerialized string

Serialized SnmpRate64 instance.

minDelta TimeSpan

Minimum TimeSpan necessary between 2 counters when calculating a rate.
Counters will be buffered until this minimum delta is met.

maxDelta TimeSpan

Maximum TimeSpan allowed between 2 counters when calculating a rate.

rateBase RateBase

Choose whether the rate should be calculated per second, minute, hour or day.

Returns

SnmpRate64

If the rateHelperSerialized is valid, a new instance of the SnmpRate64 class with all data found in rateHelperSerialized.
Otherwise, throws a JsonReaderException.