Skip to content

Commit

Permalink
update logs and interval
Browse files Browse the repository at this point in the history
  • Loading branch information
area363 committed Sep 13, 2023
1 parent 5ebe70a commit 9be6f9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
10 changes: 2 additions & 8 deletions NineChronicles.Headless/Middleware/GrpcCaptureMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace NineChronicles.Headless.Middleware
{
public class GrpcCaptureMiddleware : Interceptor
{
private const int MultiAccountManagementTime = 15;
private const int MultiAccountTxInterval = 15;
private const int MultiAccountManagementTime = 30;
private const int MultiAccountTxInterval = 30;
private static Dictionary<Address, DateTimeOffset> _multiAccountTxIntervalTracker = new();
private static Dictionary<Address, DateTimeOffset> _multiAccountList = new();
private readonly ILogger _logger;
Expand Down Expand Up @@ -167,12 +167,6 @@ public override async Task<TResponse> UnaryServerHandler<TRequest, TResponse>(
_logger.Information($"[GRPC-REQUEST-CAPTURE] Agent {agent} is in managed status for the next {MultiAccountManagementTime - (DateTimeOffset.Now - _multiAccountList[agent]).Minutes} minutes.");
}
}

_logger.Information(
"[GRPC-REQUEST-CAPTURE] IP: {IP} List Count: {Count}, AgentAddresses: {Agent}",
ipAddress,
_ipSignerList[ipAddress].Count,
_ipSignerList[ipAddress]);
}
_logger.Information(
"[GRPC-REQUEST-CAPTURE] IP: {IP} Method: {Method} Agent: {Agent} Action: {Action}",
Expand Down
10 changes: 2 additions & 8 deletions NineChronicles.Headless/Middleware/HttpCaptureMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace NineChronicles.Headless.Middleware
{
public class HttpCaptureMiddleware
{
private const int MultiAccountManagementTime = 15;
private const int MultiAccountTxInterval = 15;
private const int MultiAccountManagementTime = 30;
private const int MultiAccountTxInterval = 30;
private static Dictionary<Address, DateTimeOffset> _multiAccountTxIntervalTracker = new();
private static Dictionary<Address, DateTimeOffset> _multiAccountList = new();
private readonly RequestDelegate _next;
Expand Down Expand Up @@ -127,12 +127,6 @@ public async Task InvokeAsync(HttpContext context)
_logger.Information($"[GRAPHQL-REQUEST-CAPTURE] Agent {agent} is in managed status for the next {MultiAccountManagementTime - (DateTimeOffset.Now - _multiAccountList[agent]).Minutes} minutes.");
}
}

_logger.Information(
"[GRAPHQL-REQUEST-CAPTURE] IP: {IP} List Count: {Count}, AgentAddresses: {Agent}",
context.Connection.RemoteIpAddress!.ToString(),
_ipSignerList[context.Connection.RemoteIpAddress!.ToString()].Count,
_ipSignerList[context.Connection.RemoteIpAddress!.ToString()]);
}
}
else
Expand Down

0 comments on commit 9be6f9b

Please sign in to comment.