Safe Haskell | None |
---|---|
Language | Haskell2010 |
Counters used in telemetry collection. Additional counters can be added here.and serviced in Hasura.Server.Telemetry.
Synopsis
- data RequestDimensions = RequestDimensions {}
- data RequestTimings = RequestTimings {
- telemTimeIO :: !Seconds
- telemTimeTot :: !Seconds
- data RequestTimingsCount = RequestTimingsCount {
- telemTimeIO :: !Seconds
- telemTimeTot :: !Seconds
- telemCount :: !Word
- requestCounters :: IORef (HashMap (RequestDimensions, RunningTimeBucket) RequestTimingsCount)
- approxStartTime :: POSIXTime
- data QueryType
- data Locality
- = Empty
- | Local
- | Remote
- | Heterogeneous
- data Transport
- newtype RunningTimeBucket = RunningTimeBucket {}
- totalTimeBuckets :: [RunningTimeBucket]
- recordTimingMetric :: MonadIO m => RequestDimensions -> RequestTimings -> m ()
- data ServiceTimingMetrics = ServiceTimingMetrics {}
- data ServiceTimingMetric = ServiceTimingMetric {}
- dumpServiceTimingMetrics :: MonadIO m => m ServiceTimingMetrics
Documentation
data RequestDimensions Source #
The properties that characterize this request. The dimensions over which we collect metrics for each serviced request.
RequestDimensions | |
|
Instances
data RequestTimings Source #
Accumulated time metrics.
RequestTimings | |
|
Instances
Semigroup RequestTimings Source # | Sum |
Defined in Hasura.Server.Telemetry.Counters (<>) :: RequestTimings -> RequestTimings -> RequestTimings # sconcat :: NonEmpty RequestTimings -> RequestTimings # stimes :: Integral b => b -> RequestTimings -> RequestTimings # |
data RequestTimingsCount Source #
RequestTimings
along with the count
RequestTimingsCount | |
|
Instances
requestCounters :: IORef (HashMap (RequestDimensions, RunningTimeBucket) RequestTimingsCount) Source #
Internal. Counts and durations across many RequestDimensions
.
NOTE: We use the global mutable variable pattern for metric collection counters for convenience at collection site (don't wear hairshirts that discourage useful reporting).
approxStartTime :: POSIXTime Source #
Internal. Since these metrics are accumulated while graphql-engine is running and sent periodically, we need to include a tag that is unique for each start of hge. This lets us e.g. query for just the latest uploaded sample for each start of hge.
We use time rather than a UUID since having this be monotonic increasing is convenient.
Was this request a mutation (involved DB writes)?
Instances
Enum QueryType Source # | |
Defined in Hasura.Server.Telemetry.Counters succ :: QueryType -> QueryType # pred :: QueryType -> QueryType # fromEnum :: QueryType -> Int # enumFrom :: QueryType -> [QueryType] # enumFromThen :: QueryType -> QueryType -> [QueryType] # enumFromTo :: QueryType -> QueryType -> [QueryType] # enumFromThenTo :: QueryType -> QueryType -> QueryType -> [QueryType] # | |
Eq QueryType Source # | |
Ord QueryType Source # | |
Defined in Hasura.Server.Telemetry.Counters | |
Show QueryType Source # | |
Generic QueryType Source # | |
Hashable QueryType Source # | |
Defined in Hasura.Server.Telemetry.Counters | |
FromJSON QueryType Source # | |
Defined in Hasura.Server.Telemetry.Counters parseJSON :: Value -> Parser QueryType parseJSONList :: Value -> Parser [QueryType] | |
ToJSON QueryType Source # | |
Defined in Hasura.Server.Telemetry.Counters toEncoding :: QueryType -> Encoding toJSONList :: [QueryType] -> Value toEncodingList :: [QueryType] -> Encoding | |
type Rep QueryType Source # | |
Was this a PG local query, or did it involve remote execution?
Empty | No data was fetched |
Local | local DB data |
Remote | remote schema |
Heterogeneous | mixed |
Instances
Was this a query over http or websockets?
Instances
Enum Transport Source # | |
Defined in Hasura.Server.Telemetry.Counters succ :: Transport -> Transport # pred :: Transport -> Transport # fromEnum :: Transport -> Int # enumFrom :: Transport -> [Transport] # enumFromThen :: Transport -> Transport -> [Transport] # enumFromTo :: Transport -> Transport -> [Transport] # enumFromThenTo :: Transport -> Transport -> Transport -> [Transport] # | |
Eq Transport Source # | |
Ord Transport Source # | |
Defined in Hasura.Server.Telemetry.Counters | |
Show Transport Source # | |
Generic Transport Source # | |
Hashable Transport Source # | |
Defined in Hasura.Server.Telemetry.Counters | |
FromJSON Transport Source # | |
Defined in Hasura.Server.Telemetry.Counters parseJSON :: Value -> Parser Transport parseJSONList :: Value -> Parser [Transport] | |
ToJSON Transport Source # | |
Defined in Hasura.Server.Telemetry.Counters toEncoding :: Transport -> Encoding toJSONList :: [Transport] -> Value toEncodingList :: [Transport] -> Encoding | |
type Rep Transport Source # | |
newtype RunningTimeBucket Source #
The timings and counts here were from requests with total time longer than
$sel:bucketGreaterThan:RunningTimeBucket
(but less than any larger bucket cutoff times).
Instances
recordTimingMetric :: MonadIO m => RequestDimensions -> RequestTimings -> m () Source #
Save a timing metric sample in our in-memory store. These will be accumulated and uploaded periodically in Hasura.Server.Telemetry.
data ServiceTimingMetrics Source #
The final shape of this part of our metrics data JSON. This should allow reasonably efficient querying using GIN indexes and JSONB containment operations (which treat arrays as sets).
ServiceTimingMetrics | |
|
Instances
data ServiceTimingMetric Source #