Skip to content

Commit ca8ea5e

Browse files
author
Nikolas
committed
ExceptionFixes and UOM per_second handling
1 parent e86ef61 commit ca8ea5e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

PlugNpshell/exception.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AssumedOK: System.Exception {
1919
# To be thrown when the status of the check cannot be identified.
2020
# This is usually used when the check requires the result of a previous run and this is the first run.
2121
[string] $ErrorMessage
22-
ResultError([string]$Message) {
22+
AssumedOK([string]$Message) {
2323
$this.ErrorMessage = $Message
2424
}
2525
}

PlugNpshell/metric.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,12 @@ class Metric {
271271
$convertedMetric = [Metric]::ConvertValue($this.Value, $this.UOM, $this.SummaryPrecision, $this.SiBytesConversion)
272272
}
273273
$displayUOM = $convertedMetric.UOM
274+
if ( $displayUOM -eq 'per_second') {
275+
$displayUOM = '/s'
276+
}
274277
if ($this.DisplayInSummary) {
275278
$this.DisplayFormat = $this.DisplayFormat -Replace ('{name}', $this.DisplayName)
276-
$this.DisplayFormat = $this.DisplayFormat -Replace ('{unit}', $DisplayUOM)
279+
$this.DisplayFormat = $this.DisplayFormat -Replace ('{unit}', $displayUOM)
277280
$this.DisplayFormat = $this.DisplayFormat -Replace ('{value}', $convertedMetric.Value)
278281
$this.Summary = $this.DisplayFormat
279282
}

0 commit comments

Comments
 (0)