| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Otel.Gauges.Cache
Description
Shared state for gauge instruments and the refresh loop.
Synopsis
- data Snapshot = Snapshot {
- queues :: [QueueOverview]
- db :: Maybe PgDbHealth
- tables :: [PgTableHealth]
- concurrency :: [ConcurrencyPolicyView]
- rateLimits :: [RateLimitPolicyView]
- data Cached = Cached {}
- data Export
- live :: Export -> Maybe Cached
- lastScan :: Export -> Maybe Double
- retire :: Export -> Export
- data GaugeCache = GaugeCache {}
- data Baseline
- type SeriesKey = (Text, [(Text, Text)])
- newGaugeCache :: Double -> IO GaugeCache
- publishSnapshot :: GaugeCache -> Cached -> STM ()
- setReachable :: GaugeCache -> Bool -> STM ()
- retireCache :: GaugeCache -> STM ()
- riseSince :: SeriesKey -> Double -> Double -> HashMap SeriesKey Baseline -> (HashMap SeriesKey Baseline, Double)
Documentation
Values from one database scan.
Constructors
| Snapshot | |
Fields
| |
Instances
A snapshot and the monotonic time at which its scan started.
What the instruments export. Idle keeps the last reading's scan time for the
staleness series. Before the first scan it has none.
Source #data GaugeCache
Mutable gauge state and its registration time.
Constructors
| GaugeCache | |
Fields
| |
Source #newGaugeCache :: Double -> IO GaugeCache
Create an empty gauge cache for a registration starting at now.
Source #publishSnapshot :: GaugeCache -> Cached -> STM ()
Publish a snapshot to the observable instruments.
Source #setReachable :: GaugeCache -> Bool -> STM ()
Update the result of the last database operation.
Source #retireCache :: GaugeCache -> STM ()
Stop exporting the cached snapshot.
Source #riseSince :: SeriesKey -> Double -> Double -> HashMap SeriesKey Baseline -> (HashMap SeriesKey Baseline, Double)
What a total scanned at scannedAt adds to its series. The first reading and an
already counted reading add nothing. A reset counter adds the whole total. Any other
reading adds the difference.