mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-30 06:51:30 +02:00
Fix checksum integer overflow in metrics
This commit is contained in:
parent
29eee409ef
commit
087f8fe84f
4 changed files with 23 additions and 13 deletions
|
@ -49,7 +49,7 @@ func Test_SetBuildInfo(t *testing.T) {
|
|||
}
|
||||
|
||||
SetBuildInfo("test_service")
|
||||
testMetricRetrieval(registry.registry.Read(), t, wantLabels, 1, "build_info")
|
||||
testMetricRetrieval(registry.registry.Read(), t, wantLabels, int64(1), "build_info")
|
||||
}
|
||||
|
||||
func Test_AddPolicyCountCallback(t *testing.T) {
|
||||
|
@ -65,11 +65,11 @@ func Test_AddPolicyCountCallback(t *testing.T) {
|
|||
func Test_SetConfigChecksum(t *testing.T) {
|
||||
registry = newMetricRegistry()
|
||||
|
||||
wantValue := int64(42)
|
||||
wantValue := uint64(42)
|
||||
wantLabels := []metricdata.LabelValue{{Value: "test_service", Present: true}}
|
||||
SetConfigChecksum("test_service", wantValue)
|
||||
|
||||
testMetricRetrieval(registry.registry.Read(), t, wantLabels, wantValue, "config_checksum_int64")
|
||||
testMetricRetrieval(registry.registry.Read(), t, wantLabels, float64(wantValue), "config_checksum_decimal")
|
||||
}
|
||||
|
||||
func Test_RegisterInfoMetrics(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue