Add additional metrics and reverse metric names option to openldap (#3722)

This commit is contained in:
Andy Cobaugh
2018-02-05 15:48:41 -05:00
committed by Daniel Nelson
parent 3e37f9f591
commit 1ab0153cb5
3 changed files with 101 additions and 46 deletions

View File

@@ -148,3 +148,24 @@ func commonTests(t *testing.T, o *Openldap, acc *testutil.Accumulator) {
assert.Equal(t, strconv.Itoa(o.Port), acc.TagValue("openldap", "port"), "Has a tag value of port=o.Port")
assert.True(t, acc.HasInt64Field("openldap", "total_connections"), "Has an integer field called total_connections")
}
func TestOpenldapReverseMetrics(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
o := &Openldap{
Host: testutil.GetLocalHost(),
Port: 389,
Ssl: "",
InsecureSkipVerify: true,
BindDn: "cn=manager,cn=config",
BindPassword: "secret",
ReverseMetricNames: true,
}
var acc testutil.Accumulator
err := o.Gather(&acc)
require.NoError(t, err)
assert.True(t, acc.HasInt64Field("openldap", "connections_total"), "Has an integer field called connections_total")
}