mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
align
This commit is contained in:
parent
df9cc31a0a
commit
2a5629dd28
|
@ -4,7 +4,8 @@ package stats
|
||||||
// The naming convention is ErrorSomeThing = "error.some.thing"
|
// The naming convention is ErrorSomeThing = "error.some.thing"
|
||||||
const (
|
const (
|
||||||
// volume server
|
// volume server
|
||||||
LocalWrite = "localWrite"
|
WriteToLocalDisk = "writeToLocalDisk"
|
||||||
|
WriteToReplicas = "writeToReplicas"
|
||||||
ReplicatedWrite = "replicatedWrite"
|
ReplicatedWrite = "replicatedWrite"
|
||||||
ErrorSizeMismatchOffsetSize = "errorSizeMismatchOffsetSize"
|
ErrorSizeMismatchOffsetSize = "errorSizeMismatchOffsetSize"
|
||||||
ErrorSizeMismatch = "errorSizeMismatch"
|
ErrorSizeMismatch = "errorSizeMismatch"
|
||||||
|
|
|
@ -46,7 +46,7 @@ func ReplicatedWrite(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOpt
|
||||||
if s.GetVolume(volumeId) != nil {
|
if s.GetVolume(volumeId) != nil {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
isUnchanged, err = s.WriteVolumeNeedle(volumeId, n, true, fsync)
|
isUnchanged, err = s.WriteVolumeNeedle(volumeId, n, true, fsync)
|
||||||
stats.VolumeServerRequestHistogram.WithLabelValues(stats.LocalWrite).Observe(time.Since(start).Seconds())
|
stats.VolumeServerRequestHistogram.WithLabelValues(stats.WriteToLocalDisk).Observe(time.Since(start).Seconds())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
stats.VolumeServerRequestCounter.WithLabelValues(stats.ErrorWriteToLocalDisk).Inc()
|
stats.VolumeServerRequestCounter.WithLabelValues(stats.ErrorWriteToLocalDisk).Inc()
|
||||||
err = fmt.Errorf("failed to write to local disk: %v", err)
|
err = fmt.Errorf("failed to write to local disk: %v", err)
|
||||||
|
@ -102,7 +102,7 @@ func ReplicatedWrite(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOpt
|
||||||
_, err := operation.UploadData(n.Data, uploadOption)
|
_, err := operation.UploadData(n.Data, uploadOption)
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
stats.VolumeServerRequestHistogram.WithLabelValues(stats.ReplicatedWrite).Observe(time.Since(start).Seconds())
|
stats.VolumeServerRequestHistogram.WithLabelValues(stats.WriteToReplicas).Observe(time.Since(start).Seconds())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
stats.VolumeServerRequestCounter.WithLabelValues(stats.ErrorWriteToReplicas).Inc()
|
stats.VolumeServerRequestCounter.WithLabelValues(stats.ErrorWriteToReplicas).Inc()
|
||||||
err = fmt.Errorf("failed to write to replicas for volume %d: %v", volumeId, err)
|
err = fmt.Errorf("failed to write to replicas for volume %d: %v", volumeId, err)
|
||||||
|
|
Loading…
Reference in a new issue