Table of Contents

Method FromJsonString

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

FromJsonString(string, TimeSpan, TimeSpan, RateBase)

Deserializes a JSON string to a Rate32OnDateTime instance.

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

Parameters

rateHelperSerialized string

Serialized Rate32OnDateTime 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

Rate32OnDateTime

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

Exceptions

JsonReaderException

rateHelperSerialized is an invalid string representation of a Rate32OnDateTime instance.