Skip to content

Commit

Permalink
fix duration metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms committed Jul 31, 2024
1 parent 7791bac commit dcce5d0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions services/horizon/internal/ingest/reap.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ func (r *lookupTableReaper) deleteOrphanedRows(ctx context.Context) error {
r.rowsReapedByLookupTable.With(prometheus.Labels{"table": table}).
Observe(float64(rowsDeleted))
r.reapDurationByLookupTable.With(prometheus.Labels{"table": table, "type": "query"}).
Observe(float64(queryDuration))
Observe(float64(queryDuration.Seconds()))
r.reapDurationByLookupTable.With(prometheus.Labels{"table": table, "type": "delete"}).
Observe(float64(deleteDuration))
Observe(float64(deleteDuration.Seconds()))
r.reapDurationByLookupTable.With(prometheus.Labels{"table": table, "type": "total"}).
Observe(float64(queryDuration + deleteDuration))
Observe(float64((queryDuration + deleteDuration).Seconds()))

log.WithField("table", table).
WithField("offset", offset).
Expand All @@ -351,9 +351,9 @@ func (r *lookupTableReaper) deleteOrphanedRows(ctx context.Context) error {
r.rowsReapedByLookupTable.With(prometheus.Labels{"table": "total"}).
Observe(float64(totalDeleted))
r.reapDurationByLookupTable.With(prometheus.Labels{"table": "total", "type": "query"}).
Observe(float64(totalQueryDuration))
Observe(float64(totalQueryDuration.Seconds()))
r.reapDurationByLookupTable.With(prometheus.Labels{"table": "total", "type": "delete"}).
Observe(float64(totalDeleteDuration))
Observe(float64(totalDeleteDuration.Seconds()))
r.reapDurationByLookupTable.With(prometheus.Labels{"table": "total", "type": "total"}).
Observe(time.Since(reapStart).Seconds())
return nil
Expand Down

0 comments on commit dcce5d0

Please sign in to comment.