diff options
author | iximeow <git@iximeow.net> | 2022-12-29 19:08:01 +0000 |
---|---|---|
committer | iximeow <git@iximeow.net> | 2022-12-29 19:08:01 +0000 |
commit | 0832c96c116f4c3a28bd22a0cdd287a3b0764c7b (patch) | |
tree | 9b58beaf733a7ded11eb8519d37d41653f1e77fe /src/ci_driver.rs | |
parent | e28b277980763b88d2828812bff2c0b9546d3d25 (diff) |
record and present metrics
Diffstat (limited to 'src/ci_driver.rs')
-rw-r--r-- | src/ci_driver.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ci_driver.rs b/src/ci_driver.rs index 47892d6..d0e56cb 100644 --- a/src/ci_driver.rs +++ b/src/ci_driver.rs @@ -243,6 +243,17 @@ impl ClientJob { "object_id": "10", })).await.unwrap(); }, + "metric" => { + let name = msg.as_object().unwrap().get("name").unwrap().as_str().unwrap(); + let value = msg.as_object().unwrap().get("value").unwrap().as_str().unwrap(); + + self.dbctx.insert_metric(self.job.id, name, value) + .expect("TODO handle metric insert error?"); + } + "command" => { + // record information about commands, start/stop, etc. probably also allow + // artifacts to be attached to commands and default to attaching stdout/stderr? + } other => { eprintln!("unhandled message kind {:?} ({:?})", msg_kind, msg); } |