tpl/debug: Add average and median to timer output

This commit is contained in:
Bjørn Erik Pedersen
2023-10-21 15:41:21 +02:00
parent 5160c7efa5
commit 46bdc03885
2 changed files with 20 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ func TestTimer(t *testing.T) {
baseURL = "https://example.org/"
disableKinds = ["taxonomy", "term"]
-- layouts/index.html --
{{ range seq 2 }}
{{ range seq 5 }}
{{ $t := debug.Timer "foo" }}
{{ seq 1 1000 }}
{{ $t.Stop }}
@@ -41,5 +41,5 @@ disableKinds = ["taxonomy", "term"]
},
).Build()
b.AssertLogContains("imer: name \"foo\" count '\\x02' duration")
b.AssertLogContains("imer: name \"foo\" count '\\x05' duration")
}