Skip to content

Commit

Permalink
refactor: use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed May 10, 2022
1 parent 3860ad7 commit 63c7f2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/edge-gateway/src/durable-objects/gateway-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
responseTimeHistogram,
createResponseTimeHistogramObject,
} from '../utils/histogram.js'
import { HTTP_STATUS_SUCCESS } from '../constants.js'

/**
* @typedef {Object} GatewayMetrics
Expand All @@ -19,7 +20,6 @@ import {
*/

const GATEWAY_METRICS_ID = 'gateway_metrics'
const SUCCESS_STATUS = 200

/**
* Durable Object for keeping Metrics state of a gateway.
Expand Down Expand Up @@ -87,7 +87,7 @@ export class GatewayMetrics1 {
}

// Only update response time histogram if response is successful
if (stats.status === SUCCESS_STATUS) {
if (stats.status === HTTP_STATUS_SUCCESS) {
this._updateSuccessfulResponseTimeHistogram(stats)
}
}
Expand Down

0 comments on commit 63c7f2e

Please sign in to comment.