aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/stats.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-08-21 09:47:36 -0700
committerchrislu <chris.lu@gmail.com>2023-08-21 09:47:36 -0700
commitc45665eb97778e3abc6c14e6bdc96f2360129e53 (patch)
treee0179d9f465d4710036774835cc6ab7c22afd091 /weed/s3api/stats.go
parent01d70c21f30988bffa37ffdcb6b80f1646293390 (diff)
parent88fca2b0da66c8753309b9d1a6d419f4184a3f44 (diff)
downloadseaweedfs-c45665eb97778e3abc6c14e6bdc96f2360129e53.tar.xz
seaweedfs-c45665eb97778e3abc6c14e6bdc96f2360129e53.zip
Merge branch 'master' of https://github.com/seaweedfs/seaweedfs
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 2b36478ad..369c3e0f6 100644
--- a/weed/s3api/stats.go
+++ b/weed/s3api/stats.go
@@ -43,3 +43,8 @@ func track(f http.HandlerFunc, action string) http.HandlerFunc {
stats_collect.S3RequestCounter.WithLabelValues(action, strconv.Itoa(recorder.Status), bucket).Inc()
}
}
+
+func TimeToFirstByte(action string, start time.Time, r *http.Request) {
+ bucket, _ := s3_constants.GetBucketAndObject(r)
+ stats_collect.S3TimeToFirstByteHistogram.WithLabelValues(action, bucket).Observe(float64(time.Since(start).Milliseconds()))
+}