Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICounters

Interface for performance counters that measure execution metrics.

The performance counters measure how code is performing: how fast or slow, how many transactions performed, how many objects are stored, what was the latest transaction time and so on.

They are critical to monitor and improve performance, scalability and reliability of code in production.

Hierarchy

  • ICounters

Implemented by

Index

Methods

beginTiming

  • beginTiming(name: string): Timing
  • Begins measurement of execution time interval. It returns Timing object which has to be called at Timing.endTiming to end the measurement and update the counter.

    Parameters

    • name: string

      a counter name of Interval type.

    Returns Timing

    a Timing callback object to end timing.

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