aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/stats.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/s3api/stats.go')
-rw-r--r--weed/s3api/stats.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/s3api/stats.go b/weed/s3api/stats.go
index 973871bde..14c0ad150 100644
--- a/weed/s3api/stats.go
+++ b/weed/s3api/stats.go
@@ -37,6 +37,12 @@ func TimeToFirstByte(action string, start time.Time, r *http.Request) {
stats_collect.RecordBucketActiveTime(bucket)
}
+func BucketTrafficReceived(bytesReceived int64, r *http.Request) {
+ bucket, _ := s3_constants.GetBucketAndObject(r)
+ stats_collect.RecordBucketActiveTime(bucket)
+ stats_collect.S3BucketTrafficReceivedBytesCounter.WithLabelValues(bucket).Add(float64(bytesReceived))
+}
+
func BucketTrafficSent(bytesTransferred int64, r *http.Request) {
bucket, _ := s3_constants.GetBucketAndObject(r)
stats_collect.RecordBucketActiveTime(bucket)