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:
parent
5f444c1fee
commit
f2f8a9ca1e
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user