Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NullCounters

Dummy implementation of performance counters that doesn't do anything.

It can be used in testing or in situations when counters is required but shall be disabled.

see

ICounters

Hierarchy

  • NullCounters

Implements

Index

Constructors

constructor

  • Creates a new instance of the counter.

    Returns NullCounters

Methods

beginTiming

increment

  • increment(name: string, value: number): void
  • Increments counter by given value.

    Parameters

    • name: string

      a counter name of Increment type.

    • value: number

      a value to add to the counter.

    Returns void

incrementOne

  • incrementOne(name: string): void
  • Increments counter by 1.

    Parameters

    • name: string

      a counter name of Increment type.

    Returns void

last

  • last(name: string, value: number): void
  • Records the last calculated measurement value.

    Usually this method is used by metrics calculated externally.

    Parameters

    • name: string

      a counter name of Last type.

    • value: number

      a last value to record.

    Returns void

stats

  • stats(name: string, value: number): void
  • Calculates min/average/max statistics based on the current and previous values.

    Parameters

    • name: string

      a counter name of Statistics type

    • value: number

      a value to update statistics

    Returns void

timestamp

  • timestamp(name: string, value: Date): void
  • Records the given timestamp.

    Parameters

    • name: string

      a counter name of Timestamp type.

    • value: Date

      a timestamp to record.

    Returns void

timestampNow

  • timestampNow(name: string): void
  • Records the current time as a timestamp.

    Parameters

    • name: string

      a counter name of Timestamp type.

    Returns void

Generated using TypeDoc