mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
downloader: better logging (#8183)
This commit is contained in:
parent
2158b4916d
commit
3813a5ea10
@ -200,17 +200,19 @@ Loop:
|
|||||||
}
|
}
|
||||||
dbg.ReadMemStats(&m)
|
dbg.ReadMemStats(&m)
|
||||||
downloadTimeLeft := calculateTime(stats.BytesTotal-stats.BytesCompleted, stats.DownloadRate)
|
downloadTimeLeft := calculateTime(stats.BytesTotal-stats.BytesCompleted, stats.DownloadRate)
|
||||||
log.Info(fmt.Sprintf("[%s] download", logPrefix),
|
suffix := "downloading archives"
|
||||||
|
if stats.Progress > 0 && stats.DownloadRate == 0 {
|
||||||
|
suffix += "verifying archives"
|
||||||
|
}
|
||||||
|
log.Info(fmt.Sprintf("[%s] %s", logPrefix, suffix),
|
||||||
"progress", fmt.Sprintf("%.2f%% %s/%s", stats.Progress, common.ByteCount(stats.BytesCompleted), common.ByteCount(stats.BytesTotal)),
|
"progress", fmt.Sprintf("%.2f%% %s/%s", stats.Progress, common.ByteCount(stats.BytesCompleted), common.ByteCount(stats.BytesTotal)),
|
||||||
"download-time-left", downloadTimeLeft,
|
"time-left", downloadTimeLeft,
|
||||||
"total-download-time", time.Since(downloadStartTime).Round(time.Second).String(),
|
"total-time", time.Since(downloadStartTime).Round(time.Second).String(),
|
||||||
"download", common.ByteCount(stats.DownloadRate)+"/s",
|
"download", common.ByteCount(stats.DownloadRate)+"/s",
|
||||||
"upload", common.ByteCount(stats.UploadRate)+"/s",
|
"upload", common.ByteCount(stats.UploadRate)+"/s",
|
||||||
)
|
|
||||||
log.Info(fmt.Sprintf("[%s] download", logPrefix),
|
|
||||||
"peers", stats.PeersUnique,
|
"peers", stats.PeersUnique,
|
||||||
"connections", stats.ConnectionsTotal,
|
|
||||||
"files", stats.FilesTotal,
|
"files", stats.FilesTotal,
|
||||||
|
"connections", stats.ConnectionsTotal,
|
||||||
"alloc", common.ByteCount(m.Alloc), "sys", common.ByteCount(m.Sys),
|
"alloc", common.ByteCount(m.Alloc), "sys", common.ByteCount(m.Sys),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user