metrics-0.3.0.2: High-performance application metric tracking

Copyright(c) Ian Duncan 2013
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.HealthCheck

Description

A simple interface through which simple status dashboards can be built.

import Data.HealthCheck
import Data.Metrics.Reporter.StdOut

healthCheck1 :: HealthCheck
healthCheck1 = healthCheck "benign_warm_fuzzy_thing" $
  return $ StatusReport Good Nothing

healthCheck2 :: HealthCheck
healthCheck2 = healthCheck "nuclear_missile_launcher" $
  return $ StatusReport Ugly $ Just "out of missiles"

main :: IO ()
main = printHealthChecks [ healthCheck1, healthCheck2 ]

Synopsis

Documentation

data HealthCheck Source

A simple discrete health reporter

Constructors

HealthCheck 

Fields

healthCheckStatusReport :: IO StatusReport

An action which determines the current status of the health check

healthCheckName :: Text

A unique identifier for the health check

type HealthChecks = [HealthCheck] Source

Clean up type signatures for bundling sets of health checks for reporting

healthCheck :: Text -> IO StatusReport -> HealthCheck Source

Create a health check.

data Status Source

Provides a simple status reporting mechanism for checking application health at a glance.

Constructors

Good

Everything appears to be going well.

Bad

Something is broken.

Ugly

There is some sort of non-critical issue that deserves attention.

Unknown

There is no information, either good or bad, at the moment. An example of this might be something like a loss of network connectivity to a non-crucial service.

data StatusReport Source

A report on the current status of a subsystem.

Constructors

StatusReport 

Fields

status :: Status

Current status

statusMessage :: Maybe Text

An optional message to display about the current status.

Instances