Skip to content

Commit

Permalink
Resolve conflicts with influxdata#6905
Browse files Browse the repository at this point in the history
# Conflicts:
#	plugins/inputs/mongodb/mongodb_data_test.go
  • Loading branch information
denispershin committed Mar 23, 2020
1 parent a480877 commit 800f602
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions plugins/inputs/mongodb/mongodb_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,35 @@ func TestAddLatencyStats(t *testing.T) {
}
}

func TestAddCommandsStats(t *testing.T) {
d := NewMongodbData(
&StatLine{
DeleteCommandTotal: 73,
DeleteCommandFailed: 364,
FindCommandTotal: 113,
FindCommandFailed: 201,
FindAndModifyCommandTotal: 7,
FindAndModifyCommandFailed: 55,
GetMoreCommandTotal: 4,
GetMoreCommandFailed: 55,
InsertCommandTotal: 34,
InsertCommandFailed: 65,
UpdateCommandTotal: 23,
UpdateCommandFailed: 6,
},
tags,
)

var acc testutil.Accumulator

d.AddDefaultStats()
d.flush(&acc)

for key := range DefaultCommandsStats {
assert.True(t, acc.HasInt64Field("mongodb", key))
}
}

func TestAddShardHostStats(t *testing.T) {
expectedHosts := []string{"hostA", "hostB"}
hostStatLines := map[string]ShardHostStatLine{}
Expand Down Expand Up @@ -299,6 +328,18 @@ func TestStateTag(t *testing.T) {
"connections_current": int64(0),
"connections_available": int64(0),
"connections_total_created": int64(0),
"delete_command_total": int64(0),
"delete_command_failed": int64(0),
"find_command_total": int64(0),
"find_command_failed": int64(0),
"find_and_modify_command_total": int64(0),
"find_and_modify_command_failed": int64(0),
"get_more_command_total": int64(0),
"get_more_command_failed": int64(0),
"insert_command_total": int64(0),
"insert_command_failed": int64(0),
"update_command_total": int64(0),
"update_command_failed": int64(0),
}
acc.AssertContainsTaggedFields(t, "mongodb", fields, stateTags)
}

0 comments on commit 800f602

Please sign in to comment.