Table of Contents

Class RequestMetrics

Namespace
Amazon.Runtime.Internal.Util
Assembly
AWSSDK.Core.dll
public class RequestMetrics : IRequestMetrics
Inheritance
RequestMetrics
Implements
Inherited Members

Constructors

RequestMetrics()

Constructs an empty, disabled metrics object

public RequestMetrics()

Properties

Counters

Counters being tracked

public Dictionary<Metric, long> Counters { get; set; }

Property Value

Dictionary<Metric, long>

IsEnabled

Whether metrics are enabled for the request

public bool IsEnabled { get; }

Property Value

bool

Properties

Collection of properties being tracked

public Dictionary<Metric, List<object>> Properties { get; set; }

Property Value

Dictionary<Metric, List<object>>

Timings

Timings for metrics being tracked

public Dictionary<Metric, List<IMetricsTiming>> Timings { get; set; }

Property Value

Dictionary<Metric, List<IMetricsTiming>>

Methods

AddProperty(Metric, object)

Adds a property for a metric. If there are multiple, the object is added as a new item in a list.

public void AddProperty(Metric metric, object property)

Parameters

metric Metric
property object

GetErrors()

Returns errors associated with the metric, including if there are still any timing events in-flight.

public string GetErrors()

Returns

string

IncrementCounter(Metric)

Increments a specific metric counter. If counter doesn't exist yet, it is set to 1.

public void IncrementCounter(Metric metric)

Parameters

metric Metric

SetCounter(Metric, long)

Sets a counter for a specific metric.

public void SetCounter(Metric metric, long value)

Parameters

metric Metric
value long

StartEvent(Metric)

Starts timing an event. Logs an exception if an event of the same type was started but not stopped.

public TimingEvent StartEvent(Metric metric)

Parameters

metric Metric

Returns

TimingEvent

StopEvent(Metric)

Stops timing an event. Logs an exception if the event wasn't started.

public Timing StopEvent(Metric metric)

Parameters

metric Metric

Returns

Timing

ToJSON()

Return a JSON represenation of the current metrics

public string ToJSON()

Returns

string

ToString()

Returns a string representation of the current metrics.

public override string ToString()

Returns

string