Skip to content

Commit

Permalink
Merge branch 'master' into settings
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-volkov committed Feb 25, 2024
2 parents 8294d71 + d7162ce commit 108c3be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 1

- Optional observability event stream, which can be interpreted into log records and metrics.
- Optional observability event stream added. Provides a flexible mechanism for monitoring the healthiness of the pool via logs and metrics.
- Configuration got isolated into a DSL, which will allow to provide new configurations without breaking backward compatibility.

# 0.10.1
Expand Down
14 changes: 12 additions & 2 deletions src/library/exposed/Hasql/Pool/Observation.hs
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
-- | Interface for processing observations of the status of the pool.
--
-- Provides a flexible mechanism for monitoring the healthiness of the pool via logs and metrics without any opinionated choices on the actual monitoring technologies.
-- Specific interpreters are encouraged to be created as extension libraries.
module Hasql.Pool.Observation where

import Hasql.Pool.Prelude

-- | An observation of a change of the state of a pool.
data Observation
= ConnectionObservation
= -- | Status of one of the pool's connections has changed.
ConnectionObservation
-- | Generated connection ID.
-- For grouping the observations by one connection.
UUID
-- | Connection status that it has entered.
-- | Status that the connection has entered.
ConnectionStatus
deriving (Show, Eq)

-- | Status of a connection.
data ConnectionStatus
= -- | Connection is being established.
--
-- This is the initial status of every connection.
ConnectingConnectionStatus
| -- | Connection is established and not occupied.
ReadyForUseConnectionStatus
Expand All @@ -24,6 +33,7 @@ data ConnectionStatus
TerminatedConnectionStatus ConnectionTerminationReason
deriving (Show, Eq)

-- | Explanation of why a connection was terminated.
data ConnectionTerminationReason
= -- | The age timeout of the connection has passed.
AgingConnectionTerminationReason
Expand Down

0 comments on commit 108c3be

Please sign in to comment.