metrics-0.4.0.1: High-performance application metric tracking

Copyright(c) Ian Duncan 2013
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
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 #

A simple discrete health reporter

Constructors

HealthCheck 

Fields

type HealthChecks = [HealthCheck] #

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

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

Create a health check.

data Status #

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 #

A report on the current status of a subsystem.

Constructors

StatusReport 

Fields