MetricValue Class

  • java.lang.Object
    • com.azure.resourcemanager.monitor.models.MetricValue

Implements

public final class MetricValue
implements JsonSerializable<MetricValue>

Represents a metric value.

Constructor Summary

Constructor Description
MetricValue()

Creates an instance of MetricValue class.

Method Summary

Modifier and Type Method and Description
Double average()

Get the average property: the average value in the time range.

Double count()

Get the count property: the number of samples in the time range.

static MetricValue fromJson(JsonReader jsonReader)

Reads an instance of MetricValue from the JsonReader.

Double maximum()

Get the maximum property: the greatest value in the time range.

Double minimum()

Get the minimum property: the least value in the time range.

OffsetDateTime timestamp()

Get the timestamp property: the timestamp for the metric value in ISO 8601 format.

JsonWriter toJson(JsonWriter jsonWriter)
Double total()

Get the total property: the sum of all of the values in the time range.

void validate()

Validates the instance.

MetricValue withAverage(Double average)

Set the average property: the average value in the time range.

MetricValue withCount(Double count)

Set the count property: the number of samples in the time range.

MetricValue withMaximum(Double maximum)

Set the maximum property: the greatest value in the time range.

MetricValue withMinimum(Double minimum)

Set the minimum property: the least value in the time range.

MetricValue withTimestamp(OffsetDateTime timestamp)

Set the timestamp property: the timestamp for the metric value in ISO 8601 format.

MetricValue withTotal(Double total)

Set the total property: the sum of all of the values in the time range.

Methods inherited from java.lang.Object

Constructor Details

MetricValue

public MetricValue()

Creates an instance of MetricValue class.

Method Details

average

public Double average()

Get the average property: the average value in the time range.

Returns:

the average value.

count

public Double count()

Get the count property: the number of samples in the time range. Can be used to determine the number of values that contributed to the average value.

Returns:

the count value.

fromJson

public static MetricValue fromJson(JsonReader jsonReader)

Reads an instance of MetricValue from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MetricValue if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

maximum

public Double maximum()

Get the maximum property: the greatest value in the time range.

Returns:

the maximum value.

minimum

public Double minimum()

Get the minimum property: the least value in the time range.

Returns:

the minimum value.

timestamp

public OffsetDateTime timestamp()

Get the timestamp property: the timestamp for the metric value in ISO 8601 format.

Returns:

the timestamp value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

total

public Double total()

Get the total property: the sum of all of the values in the time range.

Returns:

the total value.

validate

public void validate()

Validates the instance.

withAverage

public MetricValue withAverage(Double average)

Set the average property: the average value in the time range.

Parameters:

average - the average value to set.

Returns:

the MetricValue object itself.

withCount

public MetricValue withCount(Double count)

Set the count property: the number of samples in the time range. Can be used to determine the number of values that contributed to the average value.

Parameters:

count - the count value to set.

Returns:

the MetricValue object itself.

withMaximum

public MetricValue withMaximum(Double maximum)

Set the maximum property: the greatest value in the time range.

Parameters:

maximum - the maximum value to set.

Returns:

the MetricValue object itself.

withMinimum

public MetricValue withMinimum(Double minimum)

Set the minimum property: the least value in the time range.

Parameters:

minimum - the minimum value to set.

Returns:

the MetricValue object itself.

withTimestamp

public MetricValue withTimestamp(OffsetDateTime timestamp)

Set the timestamp property: the timestamp for the metric value in ISO 8601 format.

Parameters:

timestamp - the timestamp value to set.

Returns:

the MetricValue object itself.

withTotal

public MetricValue withTotal(Double total)

Set the total property: the sum of all of the values in the time range.

Parameters:

total - the total value to set.

Returns:

the MetricValue object itself.

Applies to