mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-08 04:14:29 +08:00
move error to a separate file
This file contains metric names for all errors The naming convention is ErrorSomeThing = "error.some.thing"
This commit is contained in:
@@ -45,7 +45,7 @@ func ReplicatedWrite(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOpt
|
||||
if s.GetVolume(volumeId) != nil {
|
||||
isUnchanged, err = s.WriteVolumeNeedle(volumeId, n, true, fsync)
|
||||
if err != nil {
|
||||
stats.VolumeServerRequestCounter.WithLabelValues("errorWriteToLocalDisk").Inc()
|
||||
stats.VolumeServerRequestCounter.WithLabelValues(stats.ErrorWriteToLocalDisk).Inc()
|
||||
err = fmt.Errorf("failed to write to local disk: %v", err)
|
||||
glog.V(0).Infoln(err)
|
||||
return
|
||||
@@ -76,7 +76,7 @@ func ReplicatedWrite(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOpt
|
||||
tmpMap := make(map[string]string)
|
||||
err := json.Unmarshal(n.Pairs, &tmpMap)
|
||||
if err != nil {
|
||||
stats.VolumeServerRequestCounter.WithLabelValues("errorUnmarshalPairs").Inc()
|
||||
stats.VolumeServerRequestCounter.WithLabelValues(stats.ErrorUnmarshalPairs).Inc()
|
||||
glog.V(0).Infoln("Unmarshal pairs error:", err)
|
||||
}
|
||||
for k, v := range tmpMap {
|
||||
@@ -98,7 +98,7 @@ func ReplicatedWrite(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOpt
|
||||
_, err := operation.UploadData(n.Data, uploadOption)
|
||||
return err
|
||||
}); err != nil {
|
||||
stats.VolumeServerRequestCounter.WithLabelValues("errorWriteToReplicas").Inc()
|
||||
stats.VolumeServerRequestCounter.WithLabelValues(stats.ErrorWriteToReplicas).Inc()
|
||||
err = fmt.Errorf("failed to write to replicas for volume %d: %v", volumeId, err)
|
||||
glog.V(0).Infoln(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user