Cleanup collectors (#826)

Fix up `replication` and `process_idle` Update input params to match
the rest of the collectors.

Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
Ben Kochie
2023-06-27 16:40:12 +02:00
committed by GitHub
parent 1a4e8993f6
commit 030a2a9bc7
3 changed files with 7 additions and 5 deletions

View File

@@ -29,6 +29,8 @@ func TestPgReplicationCollector(t *testing.T) {
}
defer db.Close()
inst := &instance{db: db}
columns := []string{"lag", "is_replica"}
rows := sqlmock.NewRows(columns).
AddRow(1000, 1)
@@ -39,7 +41,7 @@ func TestPgReplicationCollector(t *testing.T) {
defer close(ch)
c := PGReplicationCollector{}
if err := c.Update(context.Background(), db, ch); err != nil {
if err := c.Update(context.Background(), inst, ch); err != nil {
t.Errorf("Error calling PGReplicationCollector.Update: %s", err)
}
}()