aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/stats.go
diff options
context:
space:
mode:
authorHadi Zamani <130847170+hadizamani021@users.noreply.github.com>2025-01-16 19:53:35 +0330
committerGitHub <noreply@github.com>2025-01-16 08:23:35 -0800
commitc7ae969c06476655bcb0268ca2fd8061bbd6e975 (patch)
treefc597a76c76db8c5f3caea1900684860f383f68d /weed/s3api/stats.go
parentaa299462f2c4ea857ee6997ec25eedd812904212 (diff)
downloadseaweedfs-c7ae969c06476655bcb0268ca2fd8061bbd6e975.tar.xz
seaweedfs-c7ae969c06476655bcb0268ca2fd8061bbd6e975.zip
Add bucket's traffic metrics (#6444)
* Add bucket's traffic metrics * Add bucket traffic to dashboards * Fix bucket metrics help messages * Fix variable names
Diffstat (limited to 'weed/s3api/stats.go')
-rw-r--r--weed/s3api/stats.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/s3api/stats.go b/weed/s3api/stats.go
index 616862958..64a02bed9 100644
--- a/weed/s3api/stats.go
+++ b/weed/s3api/stats.go
@@ -35,3 +35,8 @@ func TimeToFirstByte(action string, start time.Time, r *http.Request) {
stats_collect.S3TimeToFirstByteHistogram.WithLabelValues(action, bucket).Observe(float64(time.Since(start).Milliseconds()))
stats_collect.RecordBucketActiveTime(bucket)
}
+
+func BucketTrafficSent(bytesTransferred int64, r *http.Request) {
+ bucket, _ := s3_constants.GetBucketAndObject(r)
+ stats_collect.S3BucketTrafficSentBytesCounter.WithLabelValues(bucket).Add(float64(bytesTransferred))
+}