Skip to content

Commit

Permalink
Fix compilation issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheatfate committed Aug 2, 2023
1 parent 080b289 commit c40e4a7
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions presto/client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -532,21 +532,22 @@ template closeObjects(o1, o2, o3, o4: untyped): untyped =
await o4.closeWait()
o4 = nil

proc processStatusMetrics(ep: string, status: int) =
let sts = Base10.toString(uint64(status))
case status
of 100 .. 199:
presto_client_1xx_response_count.inc(1, @[ep, sts])
of 200 .. 299:
presto_client_2xx_response_count.inc(1, @[ep, sts])
of 300 .. 399:
presto_client_3xx_response_count.inc(1, @[ep, sts])
of 400 .. 499:
presto_client_4xx_response_count.inc(1, @[ep, sts])
of 500 .. 599:
presto_client_5xx_response_count.inc(1, @[ep, sts])
else:
presto_client_xxx_response_count.inc(1, @[ep, sts])
when defined(metrics):
proc processStatusMetrics(ep: string, status: int) =
let sts = Base10.toString(uint64(status))
case status
of 100 .. 199:
presto_client_1xx_response_count.inc(1, @[ep, sts])
of 200 .. 299:
presto_client_2xx_response_count.inc(1, @[ep, sts])
of 300 .. 399:
presto_client_3xx_response_count.inc(1, @[ep, sts])
of 400 .. 499:
presto_client_4xx_response_count.inc(1, @[ep, sts])
of 500 .. 599:
presto_client_5xx_response_count.inc(1, @[ep, sts])
else:
presto_client_xxx_response_count.inc(1, @[ep, sts])

proc processHttpResponseMetrics(response: HttpClientResponseRef,
endpoint: Opt[string],
Expand Down

0 comments on commit c40e4a7

Please sign in to comment.