Skip to content

Commit

Permalink
Add complete block duration
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <number101010@gmail.com>
  • Loading branch information
joe-elliott committed Apr 29, 2021
1 parent 4900314 commit 021a9b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/ingester/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,15 @@ func (i *Ingester) handleComplete(op *flushOp) (retry bool, err error) {
return false, nil
}

level.Debug(log.Logger).Log("msg", "completing block", "userid", op.userID)
start := time.Now()
level.Info(log.Logger).Log("msg", "completing block", "userid", op.userID, "blockID", op.blockID)
instance, err := i.getOrCreateInstance(op.userID)
if err != nil {
return false, err
}

err = instance.CompleteBlock(op.blockID)
level.Info(log.Logger).Log("msg", "block completed", "userid", op.userID, "blockID", op.blockID, "duration", time.Since(start))
if err != nil {
handleFailedOp(op, err)

Expand Down
1 change: 1 addition & 0 deletions tempodb/encoding/appender_buffered.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (a *bufferedAppender) RecordsForID(id common.ID) []common.Record {
for bytes.Equal(a.records[i].ID, id) {
sliceRecords = append(sliceRecords, a.records[i])

i++
if i >= len(a.records) {
break
}
Expand Down
1 change: 1 addition & 0 deletions tempodb/encoding/appender_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (a *recordAppender) RecordsForID(id common.ID) []common.Record {
for bytes.Equal(a.records[i].ID, id) {
sliceRecords = append(sliceRecords, a.records[i])

i++
if i >= len(a.records) {
break
}
Expand Down

0 comments on commit 021a9b4

Please sign in to comment.