feat: remove traffic_type in DownloadPeerDuration metric (#2357)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
f2130509d1
commit
71f13df1f0
|
|
@ -244,7 +244,7 @@ var (
|
||||||
Name: "download_peer_duration_milliseconds",
|
Name: "download_peer_duration_milliseconds",
|
||||||
Help: "Histogram of the time each peer downloading.",
|
Help: "Histogram of the time each peer downloading.",
|
||||||
Buckets: []float64{100, 200, 500, 1000, 1500, 2 * 1000, 3 * 1000, 5 * 1000, 10 * 1000, 20 * 1000, 60 * 1000, 120 * 1000, 300 * 1000},
|
Buckets: []float64{100, 200, 500, 1000, 1500, 2 * 1000, 3 * 1000, 5 * 1000, 10 * 1000, 20 * 1000, 60 * 1000, 120 * 1000, 300 * 1000},
|
||||||
}, []string{"priority", "task_type", "task_tag", "task_app", "host_type", "traffic_type"})
|
}, []string{"priority", "task_type", "task_tag", "task_app", "host_type"})
|
||||||
|
|
||||||
ConcurrentScheduleGauge = promauto.NewGauge(prometheus.GaugeOpts{
|
ConcurrentScheduleGauge = promauto.NewGauge(prometheus.GaugeOpts{
|
||||||
Namespace: types.MetricsNamespace,
|
Namespace: types.MetricsNamespace,
|
||||||
|
|
|
||||||
|
|
@ -317,12 +317,12 @@ func (v *V1) ReportPeerResult(ctx context.Context, req *schedulerv1.PeerResult)
|
||||||
v.handleTaskSuccess(ctx, peer.Task, req)
|
v.handleTaskSuccess(ctx, peer.Task, req)
|
||||||
v.handlePeerSuccess(ctx, peer)
|
v.handlePeerSuccess(ctx, peer)
|
||||||
metrics.DownloadPeerDuration.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
metrics.DownloadPeerDuration.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
||||||
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name(), commonv2.TrafficType_BACK_TO_SOURCE.String()).Observe(float64(req.Cost))
|
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name()).Observe(float64(req.Cost))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
metrics.DownloadPeerDuration.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
metrics.DownloadPeerDuration.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
||||||
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name(), commonv2.TrafficType_REMOTE_PEER.String()).Observe(float64(req.Cost))
|
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name()).Observe(float64(req.Cost))
|
||||||
|
|
||||||
go v.createDownloadRecord(peer, parents, req)
|
go v.createDownloadRecord(peer, parents, req)
|
||||||
v.handlePeerSuccess(ctx, peer)
|
v.handlePeerSuccess(ctx, peer)
|
||||||
|
|
|
||||||
|
|
@ -797,7 +797,7 @@ func (v *V2) handleDownloadPeerFinishedRequest(ctx context.Context, peerID strin
|
||||||
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name()).Inc()
|
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
|
// TODO to be determined which traffic type to use, temporarily use TrafficType_REMOTE_PEER instead
|
||||||
metrics.DownloadPeerDuration.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
metrics.DownloadPeerDuration.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
||||||
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name(), commonv2.TrafficType_REMOTE_PEER.String()).Observe(float64(peer.Cost.Load()))
|
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name()).Observe(float64(peer.Cost.Load()))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -848,7 +848,7 @@ func (v *V2) handleDownloadPeerBackToSourceFinishedRequest(ctx context.Context,
|
||||||
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name()).Inc()
|
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
|
// TODO to be determined which traffic type to use, temporarily use TrafficType_REMOTE_PEER instead
|
||||||
metrics.DownloadPeerDuration.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
metrics.DownloadPeerDuration.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
||||||
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name(), commonv2.TrafficType_REMOTE_PEER.String()).Observe(float64(peer.Cost.Load()))
|
peer.Task.Tag, peer.Task.Application, peer.Host.Type.Name()).Observe(float64(peer.Cost.Load()))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue