steve.wei
8 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
8 additions and
8 deletions
-
weed/stats/metrics.go
-
weed/storage/erasure_coding/ec_shard.go
-
weed/storage/volume.go
-
weed/storage/volume_loading.go
-
weed/storage/volume_vacuum.go
|
|
@ -194,7 +194,7 @@ var ( |
|
|
|
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 24), |
|
|
|
}, []string{"type"}) |
|
|
|
|
|
|
|
VolumeServerVolumeCounter = prometheus.NewGaugeVec( |
|
|
|
VolumeServerVolumeGauge = prometheus.NewGaugeVec( |
|
|
|
prometheus.GaugeOpts{ |
|
|
|
Namespace: Namespace, |
|
|
|
Subsystem: "volumeServer", |
|
|
@ -291,7 +291,7 @@ func init() { |
|
|
|
Gather.MustRegister(VolumeServerVacuumingCompactCounter) |
|
|
|
Gather.MustRegister(VolumeServerVacuumingCommitCounter) |
|
|
|
Gather.MustRegister(VolumeServerVacuumingHistogram) |
|
|
|
Gather.MustRegister(VolumeServerVolumeCounter) |
|
|
|
Gather.MustRegister(VolumeServerVolumeGauge) |
|
|
|
Gather.MustRegister(VolumeServerMaxVolumeCounter) |
|
|
|
Gather.MustRegister(VolumeServerReadOnlyVolumeGauge) |
|
|
|
Gather.MustRegister(VolumeServerDiskSizeGauge) |
|
|
@ -354,5 +354,5 @@ func DeleteCollectionMetrics(collection string) { |
|
|
|
for _, volume_type := range readOnlyVolumeTypes { |
|
|
|
VolumeServerReadOnlyVolumeGauge.DeleteLabelValues(collection, volume_type) |
|
|
|
} |
|
|
|
VolumeServerVolumeCounter.DeleteLabelValues(collection, "volume") |
|
|
|
VolumeServerVolumeGauge.DeleteLabelValues(collection, "volume") |
|
|
|
} |
|
|
@ -44,7 +44,7 @@ func NewEcVolumeShard(diskType types.DiskType, dirname string, collection string |
|
|
|
} |
|
|
|
v.ecdFileSize = ecdFi.Size() |
|
|
|
|
|
|
|
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "ec_shards").Inc() |
|
|
|
stats.VolumeServerVolumeGauge.WithLabelValues(v.Collection, "ec_shards").Inc() |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
@ -88,7 +88,7 @@ func (shard *EcVolumeShard) Close() { |
|
|
|
|
|
|
|
func (shard *EcVolumeShard) Destroy() { |
|
|
|
os.Remove(shard.FileName() + ToExt(int(shard.ShardId))) |
|
|
|
stats.VolumeServerVolumeCounter.WithLabelValues(shard.Collection, "ec_shards").Dec() |
|
|
|
stats.VolumeServerVolumeGauge.WithLabelValues(shard.Collection, "ec_shards").Dec() |
|
|
|
} |
|
|
|
|
|
|
|
func (shard *EcVolumeShard) ReadAt(buf []byte, offset int64) (int, error) { |
|
|
|
|
|
@ -246,7 +246,7 @@ func (v *Volume) doClose() { |
|
|
|
glog.Warningf("Volume Close fail to sync volume %d", v.Id) |
|
|
|
} |
|
|
|
v.DataBackend = nil |
|
|
|
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Dec() |
|
|
|
stats.VolumeServerVolumeGauge.WithLabelValues(v.Collection, "volume").Dec() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -201,7 +201,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Inc() |
|
|
|
stats.VolumeServerVolumeGauge.WithLabelValues(v.Collection, "volume").Inc() |
|
|
|
|
|
|
|
if err == nil { |
|
|
|
hasLoadedVolume = true |
|
|
|
|
|
@ -124,7 +124,7 @@ func (v *Volume) CommitCompact() error { |
|
|
|
} |
|
|
|
} |
|
|
|
v.DataBackend = nil |
|
|
|
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Dec() |
|
|
|
stats.VolumeServerVolumeGauge.WithLabelValues(v.Collection, "volume").Dec() |
|
|
|
|
|
|
|
var e error |
|
|
|
if e = v.makeupDiff(v.FileName(".cpd"), v.FileName(".cpx"), v.FileName(".dat"), v.FileName(".idx")); e != nil { |
|
|
|