fix: DownloadPeerDuration observe cost by milliseconds (#3255)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
c40cba5208
commit
8237c94671
|
|
@ -1 +1 @@
|
|||
Subproject commit 0b365fafdecf9f8d009ab49c7e22ec95e627de8b
|
||||
Subproject commit 6d13d8808b763662971cc7aa4b0525b2f4866276
|
||||
|
|
@ -1014,7 +1014,7 @@ func (v *V2) handleDownloadPeerFinishedRequest(ctx context.Context, peerID strin
|
|||
metrics.DownloadPeerCount.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
||||
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name()).Inc()
|
||||
// TODO to be determined which traffic type to use, temporarily use TrafficType_REMOTE_PEER instead
|
||||
metrics.DownloadPeerDuration.WithLabelValues(metrics.CalculateSizeLevel(peer.Task.ContentLength.Load()).String()).Observe(float64(peer.Cost.Load()))
|
||||
metrics.DownloadPeerDuration.WithLabelValues(metrics.CalculateSizeLevel(peer.Task.ContentLength.Load()).String()).Observe(float64(peer.Cost.Load().Milliseconds()))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1047,7 +1047,7 @@ func (v *V2) handleDownloadPeerBackToSourceFinishedRequest(ctx context.Context,
|
|||
metrics.DownloadPeerCount.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
||||
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name()).Inc()
|
||||
// TODO to be determined which traffic type to use, temporarily use TrafficType_REMOTE_PEER instead
|
||||
metrics.DownloadPeerDuration.WithLabelValues(metrics.CalculateSizeLevel(peer.Task.ContentLength.Load()).String()).Observe(float64(peer.Cost.Load()))
|
||||
metrics.DownloadPeerDuration.WithLabelValues(metrics.CalculateSizeLevel(peer.Task.ContentLength.Load()).String()).Observe(float64(peer.Cost.Load().Milliseconds()))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue