SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix metrics
Chris Lu53e2e73de2ed
diff --git a/weed/storage/needle_map_metric.go b/weed/storage/needle_map_metric.goindex 5c251793c6..55b877db6e 100644--- a/weed/storage/needle_map_metric.go+++ b/weed/storage/needle_map_metric.go@@ -28,33 +28,33 @@ func (mm *mapMetric) logPut(key NeedleId, oldSize uint32, newSize uint32) {mm.LogDeletionCounter(oldSize)}}-func (mm mapMetric) LogFileCounter(newSize uint32) {+func (mm *mapMetric) LogFileCounter(newSize uint32) {atomic.AddUint32(&mm.FileCounter, 1)atomic.AddUint64(&mm.FileByteCounter, uint64(newSize))}-func (mm mapMetric) LogDeletionCounter(oldSize uint32) {+func (mm *mapMetric) LogDeletionCounter(oldSize uint32) {if oldSize > 0 {atomic.AddUint32(&mm.DeletionCounter, 1)atomic.AddUint64(&mm.DeletionByteCounter, uint64(oldSize))}}-func (mm mapMetric) ContentSize() uint64 {+func (mm *mapMetric) ContentSize() uint64 {return atomic.LoadUint64(&mm.FileByteCounter)}-func (mm mapMetric) DeletedSize() uint64 {+func (mm *mapMetric) DeletedSize() uint64 {return atomic.LoadUint64(&mm.DeletionByteCounter)}-func (mm mapMetric) FileCount() int {+func (mm *mapMetric) FileCount() int {return int(atomic.LoadUint32(&mm.FileCounter))}-func (mm mapMetric) DeletedCount() int {+func (mm *mapMetric) DeletedCount() int {return int(atomic.LoadUint32(&mm.DeletionCounter))}-func (mm mapMetric) MaxFileKey() NeedleId {+func (mm *mapMetric) MaxFileKey() NeedleId {t := uint64(mm.MaximumFileKey)return NeedleId(t)}-func (mm mapMetric) MaybeSetMaxFileKey(key NeedleId) {+func (mm *mapMetric) MaybeSetMaxFileKey(key NeedleId) {if key > mm.MaxFileKey() {atomic.StoreUint64(&mm.MaximumFileKey, uint64(key))}