Skip to content

Commit

Permalink
logs when queue is full (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongfei605 committed Jul 13, 2023
1 parent e6e7bd9 commit 1e9e32f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion writer/writers.go
Expand Up @@ -2,6 +2,7 @@ package writer

import (
"fmt"
"log"
"sort"
"strings"
"sync"
Expand Down Expand Up @@ -100,7 +101,10 @@ func WriteSamples(samples []*types.Sample) {
}
items = append(items, item)
}
writers.queue.PushFrontN(items)
flag := writers.queue.PushFrontN(items)
if !flag {
log.Printf("E! write %d samples failed, please increase queue size(%d)", len(items), writers.queue.Len())
}
}

// WriteTimeSeries write prompb.TimeSeries to all writers
Expand Down

0 comments on commit 1e9e32f

Please sign in to comment.