Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log state sync process every 10 secs rather than every 1 sec #7254

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public DetailedProgress(ulong chainId, byte[]? serializedInitialState)
internal void DisplayProgressReport(int pendingRequestsCount, BranchProgress branchProgress, ILogger logger)
{
TimeSpan sinceLastReport = DateTime.UtcNow - LastReportTime.small;
if (sinceLastReport > TimeSpan.FromSeconds(1))
if (sinceLastReport > TimeSpan.FromSeconds(10))
{
// decimal savedNodesPerSecond = 1000m * (SavedNodesCount - LastSavedNodesCount) / (decimal) sinceLastReport.TotalMilliseconds;
decimal savedKBytesPerSecond = 1000m * ((DataSize - _lastDataSize) / 1000m) / (decimal)sinceLastReport.TotalMilliseconds;
Expand Down Expand Up @@ -91,7 +91,7 @@ internal void DisplayProgressReport(int pendingRequestsCount, BranchProgress bra
logger.Info(stateSyncReport);
}
}
if (logger.IsDebug && DateTime.UtcNow - LastReportTime.full > TimeSpan.FromSeconds(10))
if (logger.IsDebug && DateTime.UtcNow - LastReportTime.full > TimeSpan.FromSeconds(100))
{
long allChecks = CheckWasInDependencies + CheckWasCached + StateWasThere + StateWasNotThere;
if (logger.IsDebug) logger.Debug($"OK {(decimal)OkCount / TotalRequestsCount:p2} | Emptish: {(decimal)EmptishCount / TotalRequestsCount:p2} | BadQuality: {(decimal)BadQualityCount / TotalRequestsCount:p2} | InvalidFormat: {(decimal)InvalidFormatCount / TotalRequestsCount:p2} | NotAssigned {(decimal)NotAssignedCount / TotalRequestsCount:p2}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class SyncReport : ISyncReport
private const int NoProgressStateSyncReportFrequency = 30;
private const int SyncAllocatedPeersReportFrequency = 30;
private const int SyncFullPeersReportFrequency = 120;
private static readonly TimeSpan _defaultReportingIntervals = TimeSpan.FromSeconds(5);
private static readonly TimeSpan _defaultReportingIntervals = TimeSpan.FromSeconds(10);

public SyncReport(ISyncPeerPool syncPeerPool, INodeStatsManager nodeStatsManager, ISyncConfig syncConfig, IPivot pivot, ILogManager logManager, ITimerFactory? timerFactory = null, double tickTime = 1000)
{
Expand Down