mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
add functions to server telemetry (#1500)
This commit is contained in:
parent
32387ba964
commit
4ae44f7b5d
@ -33,9 +33,9 @@ Server
|
||||
~~~~~~
|
||||
|
||||
The server periodically sends the number of tables, views, relationships,
|
||||
permission rules, event triggers and remote schemas tracked by GraphQL Engine,
|
||||
along with randomly generated UUID per database and per instance. The
|
||||
server version is also sent.
|
||||
permission rules, custom SQL functions, event triggers and remote schemas
|
||||
tracked by GraphQL Engine, along with randomly generated UUID per database and
|
||||
per instance. The server version is also sent.
|
||||
|
||||
Here is a sample row from the telemetry database:
|
||||
|
||||
@ -50,6 +50,7 @@ Here is a sample row from the telemetry database:
|
||||
"metrics": {
|
||||
"views": 1,
|
||||
"tables": 2,
|
||||
"functions": 1,
|
||||
"permissions": {
|
||||
"roles": 1,
|
||||
"delete": 2,
|
||||
|
@ -63,6 +63,7 @@ data Metrics
|
||||
, _mtPermissions :: !PermissionMetric
|
||||
, _mtEventTriggers :: !Int
|
||||
, _mtRemoteSchemas :: !Int
|
||||
, _mtFunctions :: !Int
|
||||
} deriving (Show, Eq)
|
||||
$(A.deriveJSON (A.aesonDrop 3 A.snakeCase) ''Metrics)
|
||||
|
||||
@ -141,8 +142,9 @@ computeMetrics sc =
|
||||
evtTriggers = Map.size $ Map.filter (not . Map.null)
|
||||
$ Map.map tiEventTriggerInfoMap usrTbls
|
||||
rmSchemas = Map.size $ scRemoteResolvers sc
|
||||
funcs = Map.size $ Map.filter (not . fiSystemDefined) $ scFunctions sc
|
||||
|
||||
in Metrics nTables nViews relMetrics permMetrics evtTriggers rmSchemas
|
||||
in Metrics nTables nViews relMetrics permMetrics evtTriggers rmSchemas funcs
|
||||
|
||||
where
|
||||
usrTbls = Map.filter (not . tiSystemDefined) $ scTables sc
|
||||
|
Loading…
Reference in New Issue
Block a user