diff --git a/server/bin/dummy_job b/server/bin/dummy_job index 59ec70e6..b04c694a 100644 --- a/server/bin/dummy_job +++ b/server/bin/dummy_job @@ -9,7 +9,7 @@ async function run() { } async function main(){ - await runAndReport({func: run, metricName: "dummy_job"}) + await runAndReport({func: run, name: "dummy_job"}) } main() \ No newline at end of file diff --git a/server/metrics.js b/server/metrics.js index 619b657f..b8857f27 100644 --- a/server/metrics.js +++ b/server/metrics.js @@ -31,27 +31,35 @@ const report = async ({ metricName, unit = "None", value = 1.0, dims = [] }) => }; -async function runAndReport({metricName, func}) { +async function runAndReport({name, func}) { try { const res = await func() report({ - metricName, + metricName: "job", dims: [ { Name: "result", Value: "success", - } + }, + { + Name: "component", + Value: name, + }, ] }) return res } catch (e) { report({ - metricName, + metricName: "job", dims: [ { Name: "result", Value: "failed", - } + }, + { + Name: "component", + Value: name, + }, ] }) throw e