Skip to content

Commit

Permalink
download: Add timer to HTTP request
Browse files Browse the repository at this point in the history
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
  • Loading branch information
tsandall committed Dec 8, 2021
1 parent e8d1b5f commit d93a2b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions download/download.go
Expand Up @@ -278,7 +278,9 @@ func (d *Downloader) download(ctx context.Context, m metrics.Metrics) (*download
}
}

m.Timer(metrics.BundleRequest).Start()
resp, err := d.client.Do(ctx, "GET", d.path)
m.Timer(metrics.BundleRequest).Stop()
if err != nil {
return nil, errors.Wrap(err, "request failed")
}
Expand Down
1 change: 1 addition & 0 deletions metrics/metrics.go
Expand Up @@ -19,6 +19,7 @@ import (

// Well-known metric names.
const (
BundleRequest = "bundle_request"
ServerHandler = "server_handler"
ServerQueryCacheHit = "server_query_cache_hit"
SDKDecisionEval = "sdk_decision_eval"
Expand Down

0 comments on commit d93a2b9

Please sign in to comment.