test(inputs.postgresql): Fixing integration test (#15986)
This commit is contained in:
parent
a9a214e19a
commit
ae2e4467fd
|
|
@ -79,15 +79,14 @@ func TestPostgresqlGeneratesMetricsIntegration(t *testing.T) {
|
||||||
"temp_bytes",
|
"temp_bytes",
|
||||||
"deadlocks",
|
"deadlocks",
|
||||||
"buffers_alloc",
|
"buffers_alloc",
|
||||||
"buffers_backend",
|
|
||||||
"buffers_backend_fsync",
|
|
||||||
"buffers_checkpoint",
|
|
||||||
"buffers_clean",
|
"buffers_clean",
|
||||||
"checkpoints_req",
|
|
||||||
"checkpoints_timed",
|
|
||||||
"maxwritten_clean",
|
"maxwritten_clean",
|
||||||
"datid",
|
"datid",
|
||||||
"numbackends",
|
"numbackends",
|
||||||
|
"sessions",
|
||||||
|
"sessions_killed",
|
||||||
|
"sessions_fatal",
|
||||||
|
"sessions_abandoned",
|
||||||
}
|
}
|
||||||
|
|
||||||
int32Metrics := []string{}
|
int32Metrics := []string{}
|
||||||
|
|
@ -95,8 +94,9 @@ func TestPostgresqlGeneratesMetricsIntegration(t *testing.T) {
|
||||||
floatMetrics := []string{
|
floatMetrics := []string{
|
||||||
"blk_read_time",
|
"blk_read_time",
|
||||||
"blk_write_time",
|
"blk_write_time",
|
||||||
"checkpoint_write_time",
|
"active_time",
|
||||||
"checkpoint_sync_time",
|
"idle_in_transaction_time",
|
||||||
|
"session_time",
|
||||||
}
|
}
|
||||||
|
|
||||||
stringMetrics := []string{
|
stringMetrics := []string{
|
||||||
|
|
@ -106,22 +106,22 @@ func TestPostgresqlGeneratesMetricsIntegration(t *testing.T) {
|
||||||
metricsCounted := 0
|
metricsCounted := 0
|
||||||
|
|
||||||
for _, metric := range intMetrics {
|
for _, metric := range intMetrics {
|
||||||
require.True(t, acc.HasInt64Field("postgresql", metric))
|
require.True(t, acc.HasInt64Field("postgresql", metric), "%q not found in int metrics", metric)
|
||||||
metricsCounted++
|
metricsCounted++
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, metric := range int32Metrics {
|
for _, metric := range int32Metrics {
|
||||||
require.True(t, acc.HasInt32Field("postgresql", metric))
|
require.True(t, acc.HasInt32Field("postgresql", metric), "%q not found in int32 metrics", metric)
|
||||||
metricsCounted++
|
metricsCounted++
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, metric := range floatMetrics {
|
for _, metric := range floatMetrics {
|
||||||
require.True(t, acc.HasFloatField("postgresql", metric))
|
require.True(t, acc.HasFloatField("postgresql", metric), "%q not found in float metrics", metric)
|
||||||
metricsCounted++
|
metricsCounted++
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, metric := range stringMetrics {
|
for _, metric := range stringMetrics {
|
||||||
require.True(t, acc.HasStringField("postgresql", metric))
|
require.True(t, acc.HasStringField("postgresql", metric), "%q not found in string metrics", metric)
|
||||||
metricsCounted++
|
metricsCounted++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue