Skip to content

Commit

Permalink
APIGOV-25897-update status text code ranges (#664)
Browse files Browse the repository at this point in the history
* update status text code ranges

* APIGOV-25897 - cleanup from review
  • Loading branch information
jcollins-axway authored Jul 17, 2023
1 parent 71a659c commit d14d6be
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/transaction/metric/metricscollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,16 +777,14 @@ func (c *collector) cleanupMetricCounter(histogram metrics.Histogram, v4Data V4D

func (c *collector) getStatusText(statusCode string) string {
httpStatusCode, _ := strconv.Atoi(statusCode)
statusText := "Unknown"
switch {
case httpStatusCode >= 200 && httpStatusCode < 400:
statusText = "Success"
case httpStatusCode >= 100 && httpStatusCode < 400:
return "Success"
case httpStatusCode >= 400 && httpStatusCode < 500:
statusText = "Failure"
case httpStatusCode >= 500 && httpStatusCode < 511:
statusText = "Exception"
return "Failure"
default:
return "Exception"
}
return statusText
}

func (c *collector) getConsumerOrgID(ri *v1.ResourceInstance) string {
Expand Down

0 comments on commit d14d6be

Please sign in to comment.