diff --git a/metrics/write.go b/metrics/write.go index 233d55b..9e15a6c 100644 --- a/metrics/write.go +++ b/metrics/write.go @@ -137,7 +137,7 @@ func (c *Client) write(ctx context.Context) error { // Download the pprofs during half of the iteration to get avarege readings. // Do that only when it is not set to take profiles at a given interval. - if len(c.config.PprofURLs) > 0 && c.config.RequestCount != -1 && ii == c.config.RequestCount/2 { + if len(c.config.PprofURLs) > 0 && c.config.RequestCount != -1 && left == c.config.RequestCount/2 { wgPprof.Add(1) go func() { download.URLs(c.config.PprofURLs, time.Now().Format("2-Jan-2006-15:04:05"))