downloader: don't log complete files info (#9013)

This commit is contained in:
Alex Sharov 2023-12-18 15:28:20 +07:00 committed by GitHub
parent 6a1bb1dff1
commit 47c5f16a8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -370,16 +370,16 @@ func (d *Downloader) ReCalcStats(interval time.Duration) {
zeroProgress = append(zeroProgress, t.Name())
}
d.logger.Log(d.verbosity, "[snapshots] progress", "file", t.Name(), "progress", fmt.Sprintf("%.2f%%", progress), "peers", len(peersOfThisFile), "webseeds", len(weebseedPeersOfThisFile))
isDiagEnabled := diagnostics.TypeOf(diagnostics.SegmentDownloadStatistics{}).Enabled()
webseedRates, websRates := getWebseedsRatesForlogs(weebseedPeersOfThisFile, t.Name())
rates, peersRates := getPeersRatesForlogs(peersOfThisFile, t.Name())
// more detailed statistic: download rate of each peer (for each file)
if !t.Complete.Bool() && progress != 0 {
d.logger.Log(d.verbosity, "[snapshots] progress", "file", t.Name(), "progress", fmt.Sprintf("%.2f%%", progress), "peers", len(peersOfThisFile), "webseeds", len(weebseedPeersOfThisFile))
d.logger.Log(d.verbosity, "[snapshots] webseed peers", webseedRates...)
d.logger.Log(d.verbosity, "[snapshots] bittorrent peers", rates...)
}
isDiagEnabled := diagnostics.TypeOf(diagnostics.SegmentDownloadStatistics{}).Enabled()
if isDiagEnabled {
diagnostics.Send(diagnostics.SegmentDownloadStatistics{
Name: t.Name(),