redis_svc_test.go 445 B

12345678910111213141516171819202122
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package redisreceiver
  4. import (
  5. "testing"
  6. "github.com/stretchr/testify/require"
  7. )
  8. func newFakeAPIParser() *redisSvc {
  9. return newRedisSvc(fakeClient{})
  10. }
  11. func TestParser(t *testing.T) {
  12. s := newFakeAPIParser()
  13. info, err := s.info()
  14. require.Nil(t, err)
  15. require.Equal(t, 130, len(info))
  16. require.Equal(t, "1.24", info["allocator_frag_ratio"]) // spot check
  17. }