| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Otel.Gauges.Cache
Description
Internal to the arbiter packages. Not covered by the PVP.
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 {
- export :: TVar Export
- databaseReachable :: TVar (Maybe Bool)
- registeredAt :: Double
- newGaugeCache :: Double -> IO GaugeCache
- publishSnapshot :: GaugeCache -> Cached -> STM ()
- setReachable :: GaugeCache -> Bool -> STM ()
- retireCache :: GaugeCache -> STM ()
- type SeriesKey = (Text, [(Text, Text)])
- data Baseline
- 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.
Instrument export state. Idle retains the last scan time, if available.
data GaugeCacheSource #
Mutable gauge state and its registration time.
Constructors
| GaugeCache | |
Fields
| |
newGaugeCache :: Double -> IO GaugeCacheSource #
Create an empty gauge cache for a registration starting at now.
publishSnapshot :: GaugeCache -> Cached -> STM ()Source #
Publish a snapshot to the observable instruments.
setReachable :: GaugeCache -> Bool -> STM ()Source #
Record whether the last gauge scan reached the database.
retireCache :: GaugeCache -> STM ()Source #
Stop exporting the cached snapshot.
riseSince :: SeriesKey -> Double -> Double -> HashMap SeriesKey Baseline -> (HashMap SeriesKey Baseline, Double)Source #
Arguments
| :: SeriesKey | |
| -> Double | Monotonic time the total was scanned at. |
| -> Double | The scanned total. |
| -> HashMap SeriesKey Baseline | |
| -> (HashMap SeriesKey Baseline, Double) |
What a scanned total adds to its series.