-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathstats_test.go
More file actions
31 lines (23 loc) · 811 Bytes
/
stats_test.go
File metadata and controls
31 lines (23 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package monitor_test
import (
"testing"
"github.com/influxdata/influxdb/monitor"
"github.com/influxdata/influxdb/pkg/limiter"
"github.com/influxdata/influxdb/tsdb"
"github.com/stretchr/testify/require"
)
func TestDiagnostics_Stats(t *testing.T) {
s := monitor.New(nil, monitor.Config{}, &tsdb.Config{})
compactLimiter := limiter.NewRate(100, 100)
s.WithCompactThroughputLimiter(compactLimiter)
require.NoError(t, s.Open(), "opening monitor")
defer func() {
require.NoError(t, s.Close(), "closing monitor")
}()
d, err := s.Diagnostics()
require.NoError(t, err, "getting diagnostics")
diags, ok := d["stats"]
require.True(t, ok, "expected stats diagnostic client to be registered")
got, exp := diags.Columns, []string{"compact-throughput-usage-percentage"}
require.Equal(t, exp, got)
}