ekg-core-0.1.1.0: Tracking of system metrics

Safe Haskell | Safe
Language | Haskell2010

System.Metrics.Gauge

Description

This module defines a type for mutable, integer-valued gauges. Gauges are variable values and can be used to track e.g. the current number of concurrent connections. All operations on gauges are thread-safe.

Synopsis

- data Gauge
- new :: IO Gauge
- read :: Gauge -> IO Int64
- inc :: Gauge -> IO ()
- dec :: Gauge -> IO ()
- add :: Gauge -> Int64 -> IO ()
- subtract :: Gauge -> Int64 -> IO ()
- set :: Gauge -> Int64 -> IO ()

# Documentation

data Gauge Source

A mutable, integer-valued gauge.

new :: IO Gauge Source

Create a new, zero initialized, gauge.

read :: Gauge -> IO Int64 Source

Get the current value of the gauge.

inc :: Gauge -> IO () Source

Increase the gauge by one.

dec :: Gauge -> IO () Source

Decrease the gauge by one.

add :: Gauge -> Int64 -> IO () Source

Increase the gauge by the given amount.

subtract :: Gauge -> Int64 -> IO () Source

Decrease the gauge by the given amount.

set :: Gauge -> Int64 -> IO () Source

Set the gauge to the given value.