Skip to content

Commit

Permalink
CAD-1859 logging: more metrics & update to monitoring API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepfire committed Oct 22, 2020
1 parent 8a0c3d0 commit c47b480
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
32 changes: 16 additions & 16 deletions cabal.project
Expand Up @@ -226,57 +226,57 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: da2560342f3cded6ac76723fc35f64f467048a3a
--sha256: 1nxclgfgbvhx3pkp9369fdzcvrny0zf327h1vvq8k5sncw3idvk6
tag: 91c4bce60480abac24ef2dfe0f21d0489a12f22d
--sha256: 0n196n1p8apsxb4v85yvj83ppfhy0d5fn351440rml5vvgxynq6p
subdir: iohk-monitoring

source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: da2560342f3cded6ac76723fc35f64f467048a3a
--sha256: 1nxclgfgbvhx3pkp9369fdzcvrny0zf327h1vvq8k5sncw3idvk6
tag: 91c4bce60480abac24ef2dfe0f21d0489a12f22d
--sha256: 0n196n1p8apsxb4v85yvj83ppfhy0d5fn351440rml5vvgxynq6p
subdir: contra-tracer

source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: da2560342f3cded6ac76723fc35f64f467048a3a
--sha256: 1nxclgfgbvhx3pkp9369fdzcvrny0zf327h1vvq8k5sncw3idvk6
tag: 91c4bce60480abac24ef2dfe0f21d0489a12f22d
--sha256: 0n196n1p8apsxb4v85yvj83ppfhy0d5fn351440rml5vvgxynq6p
subdir: plugins/scribe-systemd

source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: da2560342f3cded6ac76723fc35f64f467048a3a
--sha256: 1nxclgfgbvhx3pkp9369fdzcvrny0zf327h1vvq8k5sncw3idvk6
tag: 91c4bce60480abac24ef2dfe0f21d0489a12f22d
--sha256: 0n196n1p8apsxb4v85yvj83ppfhy0d5fn351440rml5vvgxynq6p
subdir: plugins/backend-aggregation

source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: da2560342f3cded6ac76723fc35f64f467048a3a
--sha256: 1nxclgfgbvhx3pkp9369fdzcvrny0zf327h1vvq8k5sncw3idvk6
tag: 91c4bce60480abac24ef2dfe0f21d0489a12f22d
--sha256: 0n196n1p8apsxb4v85yvj83ppfhy0d5fn351440rml5vvgxynq6p
subdir: plugins/backend-ekg

source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: da2560342f3cded6ac76723fc35f64f467048a3a
--sha256: 1nxclgfgbvhx3pkp9369fdzcvrny0zf327h1vvq8k5sncw3idvk6
tag: 91c4bce60480abac24ef2dfe0f21d0489a12f22d
--sha256: 0n196n1p8apsxb4v85yvj83ppfhy0d5fn351440rml5vvgxynq6p
subdir: plugins/backend-monitoring

source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: da2560342f3cded6ac76723fc35f64f467048a3a
--sha256: 1nxclgfgbvhx3pkp9369fdzcvrny0zf327h1vvq8k5sncw3idvk6
tag: 91c4bce60480abac24ef2dfe0f21d0489a12f22d
--sha256: 0n196n1p8apsxb4v85yvj83ppfhy0d5fn351440rml5vvgxynq6p
subdir: plugins/backend-trace-forwarder

source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: da2560342f3cded6ac76723fc35f64f467048a3a
--sha256: 1nxclgfgbvhx3pkp9369fdzcvrny0zf327h1vvq8k5sncw3idvk6
tag: 91c4bce60480abac24ef2dfe0f21d0489a12f22d
--sha256: 0n196n1p8apsxb4v85yvj83ppfhy0d5fn351440rml5vvgxynq6p
subdir: tracer-transformers

source-repository-package
Expand Down
24 changes: 13 additions & 11 deletions cardano-node/src/Cardano/Node/Configuration/Logging.hs
Expand Up @@ -247,18 +247,20 @@ instance Transformable Text IO ProcessStats where
trTransformer = trStructured

instance ToObject ProcessStats where
toObject _verb commonStats =
toObject _verb stats =
mkObject $
[ "kind" .= String "resourceStats"
, "ticksCpu" .= toJSON (psCentiSecsCpu commonStats)
, "ticksGc" .= toJSON (psCentiSecsGC commonStats)
, "rss" .= toJSON (psRSS commonStats)
] ++ case commonStats of
linux@ProcessStatsLinux{} ->
[ "ticksIOWait" .= toJSON (psCentiSecsIOWait linux)
, "threads" .= toJSON (psThreads linux)
]
_ -> []
[ "kind" .= String "resourceStats"
, "ticksCpu" .= toJSON (psCentiCpu stats)
, "ticksGc" .= toJSON (psCentiGC stats)
, "ticksMut" .= toJSON (psCentiMut stats)
, "gcsMajor" .= toJSON (psGcsMajor stats)
, "gcsMinor" .= toJSON (psGcsMinor stats)
, "alloc" .= toJSON (psAlloc stats)
, "live" .= toJSON (psLive stats)
, "rss" .= toJSON (psRSS stats)
, "ticksBlkIO" .= toJSON (psCentiBlkIO stats)
, "threads" .= toJSON (psThreads stats)
]

shutdownLoggingLayer :: LoggingLayer -> IO ()
shutdownLoggingLayer = shutdown . llSwitchboard

0 comments on commit c47b480

Please sign in to comment.