Skip to content

Commit

Permalink
Update metrics/write.go
Browse files Browse the repository at this point in the history
Co-authored-by: Bartlomiej Plotka <[email protected]>
Signed-off-by: Juraj Michálek <[email protected]>
  • Loading branch information
jmichalek132 and bwplotka authored Sep 27, 2024
1 parent a45c05e commit 71894ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion metrics/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ func (c *Client) write(ctx context.Context) error {
log.Printf("Sending: %v timeseries, %v samples, %v timeseries per request, %v delay between requests\n", len(tss), c.config.RequestCount, c.config.BatchSize, c.config.RequestInterval)
ticker := time.NewTicker(c.config.RequestInterval)
defer ticker.Stop()
for ii := 0; c.config.RequestCount == -1 || ii < c.config.RequestCount; ii++ {
left := c.config.RequestCount // left equal to -1 means infinite amount of requests.
for left != 0 {
left--
if ctx.Err() != nil {
return ctx.Err()
}
Expand Down

0 comments on commit 71894ca

Please sign in to comment.