App Metrics Fork me on GitHub
Show / Hide Table of Contents

Interface IApdex

Apdex allows us to measure an apdex score which is a ratio of the number of satisfied and tolerating requests to the total requests made. Each satisfied request counts as one request, while each tolerating request counts as half a satisfied request.

Apdex tracks three response counts, counts based on samples measured by the chosen reservoir.

Satisfied, Tolerated and Frustrated request counts are calculated as follows using a user value of T seconds.

  • Satisfied: T or less
  • Tolerated: Greater than T or less than 4T
  • Frustrated: Greater than 4 T

Namespace:App.Metrics.Apdex.Abstractions
Assembly:cs.temp.dll.dll
Syntax
public interface IApdex : IResetableMetric

Methods

CurrentTime()

This is part of advanced timer API. Use Timer.NewContext() by default. Returns the current time in nanoseconds for computing elapsed time.

Declaration
long CurrentTime()
Returns
Type Description
System.Int64

value representing the current time in nanoseconds.

EndRecording()

This is part of advanced timer API. Use Apdex.NewContext() by default. Manually ends timing an action.

Declaration
long EndRecording()
Returns
Type Description
System.Int64

value representing the current time in nanoseconds.

NewContext()

Creates a new disposable instance and records the time it takes until the instance is disposed.

using(apdex.NewContext())
{
ExecuteMethodThatNeedsMonitoring();
}

Declaration
ApdexContext NewContext()
Returns
Type Description
ApdexContext

A disposable instance that will record the time passed until disposed.

StartRecording()

This is part of advanced apdex API. Use Apdex.NewContext() by default. Manually start timing an action.

Declaration
long StartRecording()
Returns
Type Description
System.Int64

value representing the current time in nanoseconds.

Track(Action)

Runs the action and records the time it took allowing us to calculate an apdex score.

Declaration
void Track(Action action)
Parameters
Type Name Description
System.Action action

Action to run and record time for.

Track(Int64)

This is part of advanced apdex API. Use Apdex.NewContext() by default. Manually record timer value use to calculate the apdex score.

Declaration
void Track(long duration)
Parameters
Type Name Description
System.Int64 duration

The value representing the manually measured time.

Track<T>(Func<T>)

Runs the action returning the result and records the time it took allowing us to calculate an apdex score.

Declaration
T Track<T>(Func<T> action)
Parameters
Type Name Description
System.Func<T> action

Action to run and record time for.

Returns
Type Description
T

The result of the action

Type Parameters
Name Description
T

Type of the value returned by the action

Back to top Copyright © 2017 Allan Hardy
Generated by DocFX