Skip to content

Commit

Permalink
pcs: Fix timing metric
Browse files Browse the repository at this point in the history
Change-Id: Ife4a089ba341761608575aa2f2462822ffd5e905
  • Loading branch information
johngian committed Oct 18, 2022
1 parent 4a5e62a commit 6d95dff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v1/pcs/stored_endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PCSEndpoint {
.tap((res) => {
res.headers['x-restbase-sunset'] = true;
this._injectCacheControl.bind(this);
hyper.metrics.timing([
hyper.metrics.endTiming([
'pcs_getContent_latency',
'pcs_getContent_latency_no_storage',
`pcs_getContent_latency_${rp.domain}`
Expand All @@ -39,7 +39,7 @@ class PCSEndpoint {
return this._fetchFromPCSAndStore(hyper, req)
.tap(() => {
this._injectCacheControl.bind(this);
hyper.metrics.timing([
hyper.metrics.endTiming([
'pcs_getContent_latency',
'pcs_getContent_latency_no_cache',
`pcs_getContent_latency_${rp.domain}`
Expand All @@ -60,7 +60,7 @@ class PCSEndpoint {
.catch({ status: 404 }, () => this._fetchFromPCSAndStore(hyper, req))
.tap(() => {
this._injectCacheControl.bind(this);
hyper.metrics.timing([
hyper.metrics.endTiming([
'pcs_getContent_latency',
'pcs_getContent_latency_cached',
`pcs_getContent_latency_${rp.domain}`
Expand Down Expand Up @@ -111,7 +111,7 @@ class PCSEndpoint {
headers: {
'accept-language': req.headers['accept-language']
}
}).tap(() => hyper.metrics.timing([
}).tap(() => hyper.metrics.endTiming([
'pcs_fetch_latency',
`pcs_fetch_latency_${rp.domain}`
], startTime));
Expand Down

0 comments on commit 6d95dff

Please sign in to comment.