-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from nikita-volkov/observability
Observability
- Loading branch information
Showing
6 changed files
with
126 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module Hasql.Pool.Observation where | ||
|
||
import Hasql.Pool.Prelude | ||
|
||
data Observation | ||
= ConnectionObservation | ||
-- | Generated connection ID. | ||
-- For grouping the observations by one connection. | ||
UUID | ||
-- | Connection status that it has entered. | ||
ConnectionStatus | ||
deriving (Show, Eq) | ||
|
||
data ConnectionStatus | ||
= -- | Connection is being established. | ||
ConnectingConnectionStatus | ||
| -- | Connection is established and not occupied. | ||
ReadyForUseConnectionStatus | ||
| -- | Is being used by some session. | ||
-- | ||
-- After it's done the status will transition to 'ReadyForUseConnectionStatus' or 'TerminatedConnectionStatus'. | ||
InUseConnectionStatus | ||
| -- | Connection terminated. | ||
TerminatedConnectionStatus ConnectionTerminationReason | ||
deriving (Show, Eq) | ||
|
||
data ConnectionTerminationReason | ||
= -- | The age timeout of the connection has passed. | ||
AgingConnectionTerminationReason | ||
| -- | The timeout of how long a connection may remain idle in the pool has passed. | ||
IdlenessConnectionTerminationReason | ||
| -- | Connectivity issues with the server. | ||
NetworkErrorConnectionTerminationReason (Maybe Text) | ||
| -- | User has invoked the 'Hasql.Pool.release' procedure. | ||
ReleaseConnectionTerminationReason | ||
deriving (Show, Eq) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters