func (s *Server) ReportPeerResult(ctx context.Context, req *scheduler.PeerResult) (*empty.Empty, error) {
	metrics.DownloadCount.Inc()
	if req.Success {
		metrics.P2PTraffic.Add(float64(req.Traffic))
		metrics.PeerTaskDownloadDuration.Observe(float64(req.Cost))
	} else {
		metrics.DownloadFailureCount.Inc()
	}

	return new(empty.Empty), s.service.ReportPeerResult(ctx, req)
}
// ReportPeerResult handles peer result reported by dfdaemon
ReportPeerResult handles peer result reported by dfdaemon
// ReportPeerResult handles peer result reported by dfdaemon
func (s *Server) ReportPeerResult(ctx context.Context, req *scheduler.PeerResult) (*empty.Empty, error) {
	metrics.DownloadCount.Inc()
	if req.Success {
		metrics.P2PTraffic.Add(float64(req.Traffic))
		metrics.PeerTaskDownloadDuration.Observe(float64(req.Cost))
	} else {
		metrics.DownloadFailureCount.Inc()
	}
	return new(empty.Empty), s.service.ReportPeerResult(ctx, req)
}
func ( s * Server ) ReportPeerResult ( ctx context . Context , req * scheduler . PeerResult ) ( * empty . Empty , error ) { metrics . DownloadCount . Inc ( ) if req . Success { metrics . P2PTraffic . Add ( float64 ( req . Traffic ) ) metrics . PeerTaskDownloadDuration . Observe ( float64 ( req . Cost ) ) } else { metrics . DownloadFailureCount . Inc ( ) } return new ( empty . Empty ) , s . service . ReportPeerResult ( ctx , req ) }
ReportPeerResult handles peer result reported by dfdaemon
ReportPeerResult handles peer result reported by dfdaemon