mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: fix reporting Discord response metrics to influxdb
This commit is contained in:
parent
24a549341e
commit
48d4009c69
3 changed files with 9 additions and 8 deletions
|
|
@ -209,12 +209,11 @@ namespace Myriad.Rest
|
|||
|
||||
await HandleApiError(response, ignoreNotFound);
|
||||
|
||||
if (OnResponseEvent != null)
|
||||
OnResponseEvent.Invoke(null, (
|
||||
GetEndpointMetricsName(response.RequestMessage!),
|
||||
(int)response.StatusCode,
|
||||
stopwatch.ElapsedTicks
|
||||
));
|
||||
OnResponseEvent?.Invoke(null, (
|
||||
GetEndpointMetricsName(response.RequestMessage!),
|
||||
(int)response.StatusCode,
|
||||
stopwatch.ElapsedTicks
|
||||
));
|
||||
|
||||
return response;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Myriad.Rest
|
|||
public DiscordApiClient(string token, ILogger logger, string? baseUrl = null)
|
||||
{
|
||||
_client = new BaseRestClient(UserAgent, token, logger, baseUrl ?? DefaultApiBaseUrl);
|
||||
_client.OnResponseEvent += OnResponseEvent;
|
||||
_client.OnResponseEvent += (_, ev) => OnResponseEvent?.Invoke(null, ev);
|
||||
}
|
||||
|
||||
public EventHandler<(string, int, long)> OnResponseEvent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue