mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
Migrate from snapClient.VolumesnapshotV1alpha1Client to
snapClient.SnapshotV1alpha1Client and also update kube dependency Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
3bc6771df8
commit
22ff5c0911
16
vendor/k8s.io/kubernetes/pkg/volume/util/metrics.go
generated
vendored
16
vendor/k8s.io/kubernetes/pkg/volume/util/metrics.go
generated
vendored
@ -54,6 +54,15 @@ var storageOperationStatusMetric = prometheus.NewCounterVec(
|
||||
[]string{"volume_plugin", "operation_name", "status"},
|
||||
)
|
||||
|
||||
var storageOperationEndToEndLatencyMetric = prometheus.NewHistogramVec(
|
||||
prometheus.HistogramOpts{
|
||||
Name: "volume_operation_total_seconds",
|
||||
Help: "Storage operation end to end duration in seconds",
|
||||
Buckets: []float64{.1, .25, .5, 1, 2.5, 5, 10, 15, 25, 50, 120, 300, 600},
|
||||
},
|
||||
[]string{"plugin_name", "operation_name"},
|
||||
)
|
||||
|
||||
func init() {
|
||||
registerMetrics()
|
||||
}
|
||||
@ -62,6 +71,7 @@ func registerMetrics() {
|
||||
prometheus.MustRegister(storageOperationMetric)
|
||||
prometheus.MustRegister(storageOperationErrorMetric)
|
||||
prometheus.MustRegister(storageOperationStatusMetric)
|
||||
prometheus.MustRegister(storageOperationEndToEndLatencyMetric)
|
||||
}
|
||||
|
||||
// OperationCompleteHook returns a hook to call when an operation is completed
|
||||
@ -95,3 +105,9 @@ func GetFullQualifiedPluginNameForVolume(pluginName string, spec *volume.Spec) s
|
||||
}
|
||||
return pluginName
|
||||
}
|
||||
|
||||
// RecordOperationLatencyMetric records the end to end latency for certain operation
|
||||
// into metric volume_operation_total_seconds
|
||||
func RecordOperationLatencyMetric(plugin, operationName string, secondsTaken float64) {
|
||||
storageOperationEndToEndLatencyMetric.WithLabelValues(plugin, operationName).Observe(secondsTaken)
|
||||
}
|
||||
|
Reference in New Issue
Block a user