Skip to content

Commit

Permalink
test timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mamari90 committed Feb 1, 2024
1 parent fa6faa3 commit 13def94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/synthetic-monitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function apiResponseElaborator(metricContext){
let durationOk = duration <= metricContext.monitoringConfiguration.durationLimit
apiMetrics['duration'] = duration;
apiMetrics['success'] = statusCodeOk && durationOk;
apiMetrics['message'] = !statusCodeOk ? `${response.statusText}` : (!durationOk ? `time limit exceeded: ${duration} > ${metricContext.monitoringConfiguration.durationLimit}` : `${response.statusText}`)
apiMetrics['message'] = !statusCodeOk ? `status code not valid: ${response.statusText}` : (!durationOk ? `time limit exceeded: ${duration} > ${metricContext.monitoringConfiguration.durationLimit}` : `${response.statusText}`)
apiMetrics['httpStatus'] = response.status
apiMetrics['targetStatus'] = statusCodeOk ? 1 : 0
apiMetrics['targetTlsVersion'] = extractTlsVersion(response[TLS_VERSION_KEY]);
Expand Down Expand Up @@ -263,6 +263,7 @@ function buildRequest(monitoringConfiguration){
validateStatus: function (status) {
return true; //every status code should be treated as a valid code (it will be checked later)
}
timeout: 30
}

if (monitoringConfiguration.headers) {
Expand Down

0 comments on commit 13def94

Please sign in to comment.