cmd/strelaypoolsrv: Prevent scraped metrics moving backwards (#5068)
This commit is contained in:
committed by
Jakob Borg
parent
5161f03f02
commit
93fdd1c012
21
cmd/strelaypoolsrv/stats_test.go
Normal file
21
cmd/strelaypoolsrv/stats_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright (C) 2015 Audrius Butkevicius and Contributors (see the CONTRIBUTORS file).
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMerge(t *testing.T) {
|
||||
if mergeValue(1001, 1000) != 1001 {
|
||||
t.Error("the computer says no")
|
||||
}
|
||||
|
||||
if mergeValue(999, 1000) != 1000 {
|
||||
t.Error("the computer says no")
|
||||
}
|
||||
|
||||
if mergeValue(1, 1000) != 1 {
|
||||
t.Error("the computer says no")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user