satellite/metabase: send metric about zombie segment deletion

We would like to verify if zombie object/segment works fine.
We need some metric for that. Figuring out number of deleted
objects is harder so let's for that later.

Change-Id: Ic99e2ce93256130b7c51f514824fddc009655075
This commit is contained in:
Michał Niewrzał 2021-09-28 13:00:08 +02:00 committed by Michal Niewrzal
parent 5f444c1fee
commit f2f8a9ca1e

View File

@ -255,12 +255,21 @@ func (db *DB) deleteInactiveObjectsAndSegments(ctx context.Context, objects []Ob
results := conn.SendBatch(ctx, &batch)
defer func() { err = errs.Combine(err, results.Close()) }()
var segmentsDeleted int64
var errlist errs.Group
for i := 0; i < batch.Len(); i++ {
_, err := results.Exec()
result, err := results.Exec()
errlist.Add(err)
if err == nil {
segmentsDeleted += result.RowsAffected()
}
}
// TODO calculate deleted objects
mon.Meter("zombie_segment_delete").Mark64(segmentsDeleted)
mon.Meter("segment_delete").Mark64(segmentsDeleted)
return errlist.Err()
})
if err != nil {