[volume] refactor and add metrics for flight upload and download data limit condition (#6920)

* refactor concurrentDownloadLimit

* fix loop

* fix cmdServer

* fix: resolve conversation pr 6920

* Changes logging function (#6919)

* updated logging methods for stores

* updated logging methods for stores

* updated logging methods for filer

* updated logging methods for uploader and http_util

* updated logging methods for weed server

---------

Co-authored-by: akosov <a.kosov@kryptonite.ru>

* Improve lock ring (#6921)

* fix flaky lock ring test

* add more tests

* fix: build

* fix: rm import util/version

* fix: serverOptions

* refactoring

---------

Co-authored-by: Aleksey Kosov <rusyak777@list.ru>
Co-authored-by: akosov <a.kosov@kryptonite.ru>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: chrislu <chris.lu@gmail.com>
This commit is contained in:
Konstantin Lebedev
2025-07-03 06:03:49 +05:00
committed by GitHub
parent 1db7c2b8aa
commit 93007c1842
10 changed files with 410 additions and 134 deletions

View File

@@ -278,6 +278,38 @@ var (
Help: "Resource usage",
}, []string{"name", "type"})
VolumeServerConcurrentDownloadLimit = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: Namespace,
Subsystem: "volumeServer",
Name: "concurrent_download_limit",
Help: "Limit total concurrent download size.",
})
VolumeServerConcurrentUploadLimit = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: Namespace,
Subsystem: "volumeServer",
Name: "concurrent_upload_limit",
Help: "Limit total concurrent upload size.",
})
VolumeServerInFlightDownloadSize = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: Namespace,
Subsystem: "volumeServer",
Name: "in_flight_download_size",
Help: "In flight total download size.",
})
VolumeServerInFlightUploadSize = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: Namespace,
Subsystem: "volumeServer",
Name: "in_flight_upload_size",
Help: "In flight total upload size.",
})
S3RequestCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: Namespace,
@@ -387,6 +419,10 @@ func init() {
Gather.MustRegister(VolumeServerReadOnlyVolumeGauge)
Gather.MustRegister(VolumeServerDiskSizeGauge)
Gather.MustRegister(VolumeServerResourceGauge)
Gather.MustRegister(VolumeServerConcurrentDownloadLimit)
Gather.MustRegister(VolumeServerConcurrentUploadLimit)
Gather.MustRegister(VolumeServerInFlightDownloadSize)
Gather.MustRegister(VolumeServerInFlightUploadSize)
Gather.MustRegister(S3RequestCounter)
Gather.MustRegister(S3HandlerCounter)

View File

@@ -4,8 +4,15 @@ package stats
// The naming convention is ErrorSomeThing = "error.some.thing"
const (
// volume server
WriteToLocalDisk = "writeToLocalDisk"
WriteToReplicas = "writeToReplicas"
WriteToLocalDisk = "writeToLocalDisk"
WriteToReplicas = "writeToReplicas"
DownloadLimitCond = "downloadLimitCondition"
UploadLimitCond = "uploadLimitCondition"
ReadProxyReq = "readProxyRequest"
ReadRedirectReq = "readRedirectRequest"
EmptyReadProxyLoc = "emptyReadProxyLocaction"
FailedReadProxyReq = "failedReadProxyRequest"
ErrorSizeMismatchOffsetSize = "errorSizeMismatchOffsetSize"
ErrorSizeMismatch = "errorSizeMismatch"
ErrorCRC = "errorCRC"