From 4369d8a6d7a2ced0de50e976be0ba67d3aac988b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Ewerl=C3=B6f?= Date: Mon, 23 Sep 2024 22:08:06 +0200 Subject: [PATCH] improve metric view --- models/metric.js | 7 +++++ views/metric-view.html | 70 ++++++++++++++++++++++++++---------------- 2 files changed, 50 insertions(+), 27 deletions(-) diff --git a/models/metric.js b/models/metric.js index 8a515a7..876078e 100644 --- a/models/metric.js +++ b/models/metric.js @@ -1,6 +1,9 @@ import { isInstance } from '../lib/validation.js' import { Service } from './service.js' import { Failure } from './failure.js' +import { config } from '../config.js' + +const lowestPriority = config.likelihood.possibleValues.length * config.impactLevel.possibleValues.length export class Metric { constructor(service, displayName = '', description = '', ...measuredFailures) { @@ -39,6 +42,10 @@ export class Metric { } } + get priority() { + return this.measuredFailures.reduce((acc, failure) => acc - failure.priority, lowestPriority) + } + toString() { return `${ this.service } ∡ ${this.displayName}` } diff --git a/views/metric-view.html b/views/metric-view.html index f069ac4..93ed0e6 100644 --- a/views/metric-view.html +++ b/views/metric-view.html @@ -1,5 +1,48 @@
+
+

Service

+

{{ metric.service }}

+

Symptoms

+ + + + + + + + + + + + + +
SymptomConsumption
+ + + {{ failure.symptom }} + + {{ failure.consumption }} +
+
+
+

+ Select all risks that this metric can help you identify. +

+

+ The goal is to be be on top of the risks meaning: instead of relying on manual detection (e.g. consumers calling you to report a problem), you can use this metric to detect the problem as soon as possible. +

+

+ The metrics detect symptoms. + The symptoms are ordered by their associated risk impact and likelihood. +

+

+ You can capture multiple symptoms with the same metric. +

+

Metric Name

@@ -20,33 +63,6 @@

Description

  • etc.
  • -
    -

    Symptoms

    -
    - -
    -
    -
    -

    - Select all risks that this metric can help you identify. -

    -

    - The goal is to be be on top of the risks meaning: instead of relying on manual detection (e.g. consumers calling you to report a problem), you can use this metric to detect the problem as soon as possible. -

    -

    - The metrics detect symptoms. - The symptoms are ordered by their associated risk impact and likelihood. -

    -

    - You can capture multiple symptoms with the same metric. -

    -