Skip to content

Commit

Permalink
fix: avoid storing counts for non defined status codes (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos authored Aug 12, 2022
1 parent 56d95af commit 2927505
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/edge-gateway/src/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,11 @@ async function reportRaceResults (env, gatewayResponsePromises, winnerUrl) {
}

// Track count for status code per gateway
env.PUBLIC_RACE_STATUS_CODE.writeDataPoint({
blobs: [gwResponse.value?.url, `${gwResponse.value?.response?.status}`],
doubles: [1]
})
if (gwResponse.value?.response?.status && gwResponse.value?.url) {
env.PUBLIC_RACE_STATUS_CODE.writeDataPoint({
blobs: [gwResponse.value.url, `${gwResponse.value.response.status}`],
doubles: [1]
})
}
})
}

0 comments on commit 2927505

Please sign in to comment.