| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Logging.Monitoring.Accounting
Description
Bounded, process-local timing state. Replayed events seed identities, never invent start times or increment process counters.
Synopsis
- data SnapshotKey head = SnapshotKey {
- headIdentity :: head
- version :: Natural
- number :: Natural
- data Accounting head txid = Accounting {
- timers :: Map txid Double
- orderedTimers :: Map (Double, txid) ()
- latestInput :: Maybe Word64
- confirmed :: Maybe (SnapshotKey head)
- inFlight :: Maybe (SnapshotKey head, Maybe Double, [txid])
- empty :: Accounting head txid
- request :: Ord txid => Int -> Double -> Double -> Word64 -> txid -> Accounting head txid -> (Bool, Int, Accounting head txid)
- prune :: Ord txid => Int -> Double -> Double -> Accounting head txid -> (Int, Accounting head txid)
- forget :: Ord txid => txid -> Accounting head txid -> Accounting head txid
- clearPending :: Accounting head txid -> Accounting head txid
- startSnapshot :: Eq head => SnapshotKey head -> Maybe Double -> [txid] -> Accounting head txid -> Accounting head txid
- confirmSnapshot :: (Eq head, Ord txid) => Double -> SnapshotKey head -> [txid] -> Accounting head txid -> (Bool, Maybe Double, [Double], Accounting head txid)
Documentation
data SnapshotKey head Source #
Constructors
| SnapshotKey | |
Fields
| |
Instances
| Show head => Show (SnapshotKey head) Source # | |
Defined in Hydra.Logging.Monitoring.Accounting | |
| Eq head => Eq (SnapshotKey head) Source # | |
Defined in Hydra.Logging.Monitoring.Accounting Methods (==) :: SnapshotKey head -> SnapshotKey head -> Bool Source # (/=) :: SnapshotKey head -> SnapshotKey head -> Bool Source # | |
data Accounting head txid Source #
Constructors
| Accounting | |
Fields
| |
Instances
| (Show txid, Show head) => Show (Accounting head txid) Source # | |
Defined in Hydra.Logging.Monitoring.Accounting | |
| (Eq txid, Eq head) => Eq (Accounting head txid) Source # | |
Defined in Hydra.Logging.Monitoring.Accounting Methods (==) :: Accounting head txid -> Accounting head txid -> Bool Source # (/=) :: Accounting head txid -> Accounting head txid -> Bool Source # | |
empty :: Accounting head txid Source #
request :: Ord txid => Int -> Double -> Double -> Word64 -> txid -> Accounting head txid -> (Bool, Int, Accounting head txid) Source #
Admission order is monotone. Retries and parked inputs retain their ID, so one high-water mark distinguishes first processing without a set of IDs.
prune :: Ord txid => Int -> Double -> Double -> Accounting head txid -> (Int, Accounting head txid) Source #
forget :: Ord txid => txid -> Accounting head txid -> Accounting head txid Source #
clearPending :: Accounting head txid -> Accounting head txid Source #
startSnapshot :: Eq head => SnapshotKey head -> Maybe Double -> [txid] -> Accounting head txid -> Accounting head txid Source #
confirmSnapshot :: (Eq head, Ord txid) => Double -> SnapshotKey head -> [txid] -> Accounting head txid -> (Bool, Maybe Double, [Double], Accounting head txid) Source #
Returns transactions and durations only when the confirmed number advances within this head. A version bump at the same number does not confirm the transactions again. An unrelated adoption cannot consume a pending timer.