From 0832c96c116f4c3a28bd22a0cdd287a3b0764c7b Mon Sep 17 00:00:00 2001 From: iximeow Date: Thu, 29 Dec 2022 19:08:01 +0000 Subject: record and present metrics --- src/ci_driver.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/ci_driver.rs') 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); } -- cgit v1.1