From 67a292d135d542768a97be0b7caf044252c5136d Mon Sep 17 00:00:00 2001 From: Isaac Hess Date: Fri, 17 Jul 2020 10:21:42 -0600 Subject: [PATCH] satellite/satellitedb: Monitor node tallies We are adding a monkit evaluation for the total sum of data stored on the nodes before it is inserted into the database. This will give us a time-series history of total data stored so we can see it change over time. Change-Id: I41145a2d7a09c8e63b42ae578bd081035b60e529 --- monkit.lock | 1 + satellite/satellitedb/storagenodeaccounting.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/monkit.lock b/monkit.lock index 13c2ad570..5f91b52f9 100644 --- a/monkit.lock +++ b/monkit.lock @@ -93,6 +93,7 @@ storj.io/storj/satellite/repair/repairer."time_for_repair" FloatVal storj.io/storj/satellite/repair/repairer."time_since_checker_queue" FloatVal storj.io/storj/satellite/satellitedb."audit_reputation_alpha" FloatVal storj.io/storj/satellite/satellitedb."audit_reputation_beta" FloatVal +storj.io/storj/satellite/satellitedb."nodetallies.totalsum" IntVal storj.io/storj/satellite/satellitedb."unknown_audit_reputation_alpha" FloatVal storj.io/storj/satellite/satellitedb."unknown_audit_reputation_beta" FloatVal storj.io/storj/storage/filestore."open_file_in_trash" Meter diff --git a/satellite/satellitedb/storagenodeaccounting.go b/satellite/satellitedb/storagenodeaccounting.go index 2c72d2540..ecf4e7a47 100644 --- a/satellite/satellitedb/storagenodeaccounting.go +++ b/satellite/satellitedb/storagenodeaccounting.go @@ -31,10 +31,13 @@ func (db *StoragenodeAccounting) SaveTallies(ctx context.Context, latestTally ti } var nodeIDs []storj.NodeID var totals []float64 + var totalSum float64 for id, total := range nodeData { nodeIDs = append(nodeIDs, id) totals = append(totals, total) + totalSum += total } + mon.IntVal("nodetallies.totalsum").Observe(int64(totalSum)) //locked err = db.db.WithTx(ctx, func(ctx context.Context, tx *dbx.Tx) error { _, err = tx.Tx.ExecContext(ctx, db.db.Rebind(`