Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zak-pawel committed Oct 14, 2024
1 parent 89a2456 commit 1d1ce1f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
26 changes: 13 additions & 13 deletions plugins/inputs/ceph/ceph.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ import (
//go:embed sample.conf
var sampleConfig string

const (
measurement = "ceph"
typeMon = "monitor"
typeOsd = "osd"
typeMds = "mds"
typeRgw = "rgw"
osdPrefix = "ceph-osd"
monPrefix = "ceph-mon"
mdsPrefix = "ceph-mds"
rgwPrefix = "ceph-client"
sockSuffix = "asok"
)

type Ceph struct {
CephBinary string `toml:"ceph_binary"`
OsdPrefix string `toml:"osd_prefix"`
Expand All @@ -35,19 +48,6 @@ type Ceph struct {
schemaMaps map[socket]perfSchemaMap
}

const (
measurement = "ceph"
typeMon = "monitor"
typeOsd = "osd"
typeMds = "mds"
typeRgw = "rgw"
osdPrefix = "ceph-osd"
monPrefix = "ceph-mon"
mdsPrefix = "ceph-mds"
rgwPrefix = "ceph-client"
sockSuffix = "asok"
)

func (*Ceph) SampleConfig() string {
return sampleConfig
}
Expand Down
4 changes: 0 additions & 4 deletions plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,10 +798,6 @@ func (c *CiscoTelemetryMDT) parseContentField(
delete(tags, prefix)
}

func (c *CiscoTelemetryMDT) address() net.Addr {
return c.listener.Addr()
}

func init() {
inputs.Add("cisco_telemetry_mdt", func() telegraf.Input {
return &CiscoTelemetryMDT{
Expand Down
10 changes: 5 additions & 5 deletions plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ func TestTCPDialoutOverflow(t *testing.T) {
MsgLen uint32
}{MsgLen: uint32(1000000000)}

addr := c.address()
addr := c.listener.Addr()
conn, err := net.Dial(addr.Network(), addr.String())
require.NoError(t, err)
require.NoError(t, binary.Write(conn, binary.BigEndian, hdr))
Expand Down Expand Up @@ -1104,7 +1104,7 @@ func TestTCPDialoutMultiple(t *testing.T) {
MsgLen uint32
}{}

addr := c.address()
addr := c.listener.Addr()
conn, err := net.Dial(addr.Network(), addr.String())
require.NoError(t, err)

Expand Down Expand Up @@ -1186,7 +1186,7 @@ func TestGRPCDialoutError(t *testing.T) {
err := c.Start(acc)
require.NoError(t, err)

addr := c.address()
addr := c.listener.Addr()
conn, err := grpc.NewClient(addr.String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
client := mdtdialout.NewGRPCMdtDialoutClient(conn)
Expand Down Expand Up @@ -1220,7 +1220,7 @@ func TestGRPCDialoutMultiple(t *testing.T) {
require.NoError(t, err)
tel := mockTelemetryMessage()

addr := c.address()
addr := c.listener.Addr()
conn, err := grpc.NewClient(addr.String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
require.True(t, conn.WaitForStateChange(context.Background(), connectivity.Connecting))
Expand Down Expand Up @@ -1306,7 +1306,7 @@ func TestGRPCDialoutKeepalive(t *testing.T) {
err := c.Start(acc)
require.NoError(t, err)

addr := c.address()
addr := c.listener.Addr()
conn, err := grpc.NewClient(addr.String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
client := mdtdialout.NewGRPCMdtDialoutClient(conn)
Expand Down

0 comments on commit 1d1ce1f

Please sign in to comment.