Fix issues. (#58)
* Fix new(RestClientRef) declaration. * Fix metrics name issue.
This commit is contained in:
parent
eee1f7ad04
commit
cb9353acd5
|
@ -169,12 +169,12 @@ proc new*(t: typedesc[RestClientRef],
|
||||||
bufferSize: int = 4096,
|
bufferSize: int = 4096,
|
||||||
userAgent = PrestoIdent,
|
userAgent = PrestoIdent,
|
||||||
socketFlags: set[SocketFlags] = {}
|
socketFlags: set[SocketFlags] = {}
|
||||||
): RestResult[RestClientRef] =
|
): RestClientRef =
|
||||||
let session = HttpSessionRef.new(httpFlags, maxRedirections, connectTimeout,
|
let session = HttpSessionRef.new(httpFlags, maxRedirections, connectTimeout,
|
||||||
headersTimeout, bufferSize, maxConnections,
|
headersTimeout, bufferSize, maxConnections,
|
||||||
idleTimeout, idlePeriod, socketFlags)
|
idleTimeout, idlePeriod, socketFlags)
|
||||||
ok(RestClientRef(session: session, address: address, agent: userAgent,
|
RestClientRef(session: session, address: address, agent: userAgent,
|
||||||
flags: flags))
|
flags: flags)
|
||||||
|
|
||||||
proc new*(t: typedesc[RestClientRef],
|
proc new*(t: typedesc[RestClientRef],
|
||||||
ta: TransportAddress,
|
ta: TransportAddress,
|
||||||
|
|
|
@ -69,7 +69,7 @@ when defined(metrics):
|
||||||
endpoint = $route.routePath
|
endpoint = $route.routePath
|
||||||
icode = toInt(code)
|
icode = toInt(code)
|
||||||
scode = Base10.toString(uint64(toInt(code)))
|
scode = Base10.toString(uint64(toInt(code)))
|
||||||
presto_client_response_status_count.inc(1, @[endpoint, scode])
|
presto_server_response_status_count.inc(1, @[endpoint, scode])
|
||||||
|
|
||||||
proc processStatusMetrics(route: RestRoute, code: HttpCode,
|
proc processStatusMetrics(route: RestRoute, code: HttpCode,
|
||||||
duration: Duration) =
|
duration: Duration) =
|
||||||
|
|
Loading…
Reference in New Issue