Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms committed Jul 26, 2024
1 parent 6a49102 commit 7ae9b3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions services/horizon/internal/db2/history/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -972,9 +972,9 @@ type tableObjectFieldPair struct {
}

type LookupTableReapResult struct {
Offset int64 `json:"offset"`
RowsDeleted int64 `json:"rowsDeleted"`
Duration time.Duration `json:"duration"`
Offset int64
RowsDeleted int64
Duration time.Duration
}

// ReapLookupTables removes rows from lookup tables like history_claimable_balances
Expand Down
4 changes: 3 additions & 1 deletion services/horizon/internal/ingest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,9 @@ func (s *system) maybeReapLookupTables(lastIngestedLedger uint32) {
reapLog := log
for table, result := range results {
totalDeleted += result.RowsDeleted
reapLog = reapLog.WithField(table, result)
reapLog = reapLog.WithField(table+"_offset", result.Offset)
reapLog = reapLog.WithField(table+"_duration", result.Duration)
reapLog = reapLog.WithField(table+"_rows_deleted", result.RowsDeleted)
s.Metrics().RowsReapedByLookupTable.With(prometheus.Labels{"table": table}).Observe(float64(result.RowsDeleted))
s.Metrics().ReapDurationByLookupTable.With(prometheus.Labels{"table": table}).Observe(result.Duration.Seconds())
}
Expand Down

0 comments on commit 7ae9b3f

Please sign in to comment.