add more metrics that only appear when a print job is running

This commit is contained in:
2022-04-18 20:18:00 -04:00
parent 385894d3c6
commit abb57a7ae9
2 changed files with 90 additions and 2 deletions

24
main_test.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"testing"
"time"
)
func TestParseDuration(t *testing.T) {
d := parseDuration(" 45s")
if d != (45 * time.Second) {
t.Log(d)
t.Fail()
}
d = parseDuration(" 10m 45s")
if d != (45*time.Second)+(10*time.Minute) {
t.Log(d)
t.Fail()
}
d = parseDuration(" 12h 10m 45s")
if d != (12*time.Hour)+(45*time.Second)+(10*time.Minute) {
t.Log(d)
t.Fail()
}
}