From cb9353acd5877f7ba197bfe1f365b89a0a4473f8 Mon Sep 17 00:00:00 2001 From: Eugene Kabanov Date: Mon, 4 Sep 2023 23:34:14 +0300 Subject: [PATCH] Fix issues. (#58) * Fix new(RestClientRef) declaration. * Fix metrics name issue. --- presto/client.nim | 6 +++--- presto/serverprivate.nim | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/presto/client.nim b/presto/client.nim index 5d96bd2..887d8c6 100644 --- a/presto/client.nim +++ b/presto/client.nim @@ -169,12 +169,12 @@ proc new*(t: typedesc[RestClientRef], bufferSize: int = 4096, userAgent = PrestoIdent, socketFlags: set[SocketFlags] = {} - ): RestResult[RestClientRef] = + ): RestClientRef = let session = HttpSessionRef.new(httpFlags, maxRedirections, connectTimeout, headersTimeout, bufferSize, maxConnections, idleTimeout, idlePeriod, socketFlags) - ok(RestClientRef(session: session, address: address, agent: userAgent, - flags: flags)) + RestClientRef(session: session, address: address, agent: userAgent, + flags: flags) proc new*(t: typedesc[RestClientRef], ta: TransportAddress, diff --git a/presto/serverprivate.nim b/presto/serverprivate.nim index 5ccfeea..b6046b6 100644 --- a/presto/serverprivate.nim +++ b/presto/serverprivate.nim @@ -69,7 +69,7 @@ when defined(metrics): endpoint = $route.routePath icode = 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, duration: Duration) =