diff --git a/modular/p2p/p2pnode/approval.go b/modular/p2p/p2pnode/approval.go index 96aa75fe8..935c47b46 100644 --- a/modular/p2p/p2pnode/approval.go +++ b/modular/p2p/p2pnode/approval.go @@ -154,7 +154,7 @@ func (a *ApprovalProtocol) onGetApprovalRequest(s network.Stream) { req.SetApprovedSignature(signature) req.SetApprovedSpOperatorAddress(a.node.baseApp.OperateAddress()) err = a.node.sendToPeer(ctx, s.Conn().RemotePeer(), GetApprovalResponse, req) - log.Infof("%s response to %s approval request, error: %s", + log.Infof("%s response to %s approval request, error: %v", s.Conn().LocalPeer(), s.Conn().RemotePeer(), err) } diff --git a/pkg/metrics/metric_items.go b/pkg/metrics/metric_items.go index 6875c322a..51275639c 100644 --- a/pkg/metrics/metric_items.go +++ b/pkg/metrics/metric_items.go @@ -21,11 +21,11 @@ var MetricsItems = []prometheus.Collector{ TaskInQueueTimeHistogram, // PieceStore metrics category PutPieceTimeHistogram, - PutPieceTimeCounter, + PutPieceTotalNumberCounter, GetPieceTimeHistogram, - GetPieceTimeCounter, + GetPieceTotalNumberCounter, DeletePieceTimeHistogram, - DeletePieceTimeCounter, + DeletePieceTotalNumberCounter, PieceUsageAmountGauge, // Front module metrics category UploadObjectSizeHistogram, @@ -70,7 +70,7 @@ var MetricsItems = []prometheus.Collector{ DispatchGcObjectTaskCounter, // Signer metrics category SealObjectTimeHistogram, - // Spdb metrics category + // SPDB metrics category SPDBTimeHistogram, // BlockSyncer metrics category BlockHeightLagGauge, @@ -106,7 +106,7 @@ var ( Help: "Track the time of putting piece data to piece store.", Buckets: prometheus.DefBuckets, }, []string{"put_piece_store_time"}) - PutPieceTimeCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ + PutPieceTotalNumberCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "put_piece_store_number", Help: "Track the total number of putting piece data to piece store.", }, []string{"put_piece_store_number"}) @@ -115,7 +115,7 @@ var ( Help: "Track the time of getting piece data to piece store.", Buckets: prometheus.DefBuckets, }, []string{"get_piece_store_time"}) - GetPieceTimeCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ + GetPieceTotalNumberCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "get_piece_store_number", Help: "Track the total number of getting piece data to piece store.", }, []string{"get_piece_store_number"}) @@ -124,7 +124,7 @@ var ( Help: "Track the time of deleting piece data to piece store.", Buckets: prometheus.DefBuckets, }, []string{"delete_piece_store_time"}) - DeletePieceTimeCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ + DeletePieceTotalNumberCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "delete_piece_store_number", Help: "Track the total number of deleting piece data to piece store.", }, []string{"delete_piece_store_number"}) diff --git a/store/piecestore/client/piece_store_client.go b/store/piecestore/client/piece_store_client.go index 16203a142..3aab07b83 100644 --- a/store/piecestore/client/piece_store_client.go +++ b/store/piecestore/client/piece_store_client.go @@ -43,7 +43,7 @@ func (client *StoreClient) GetPiece(ctx context.Context, key string, offset, lim defer func() { metrics.GetPieceTimeHistogram.WithLabelValues(client.name).Observe( time.Since(startTime).Seconds()) - metrics.GetPieceTimeCounter.WithLabelValues(client.name).Inc() + metrics.GetPieceTotalNumberCounter.WithLabelValues(client.name).Inc() }() rc, err := client.ps.Get(ctx, key, offset, limit) @@ -69,7 +69,7 @@ func (client *StoreClient) PutPiece(ctx context.Context, key string, value []byt defer func() { metrics.PutPieceTimeHistogram.WithLabelValues(client.name).Observe( time.Since(startTime).Seconds()) - metrics.PutPieceTimeCounter.WithLabelValues(client.name).Inc() + metrics.PutPieceTotalNumberCounter.WithLabelValues(client.name).Inc() if err != nil { metrics.PieceUsageAmountGauge.WithLabelValues(client.name).Add(float64(len(value))) } @@ -88,7 +88,7 @@ func (client *StoreClient) DeletePiece(ctx context.Context, key string) error { defer func() { metrics.DeletePieceTimeHistogram.WithLabelValues(client.name).Observe( time.Since(startTime).Seconds()) - metrics.DeletePieceTimeCounter.WithLabelValues(client.name).Inc() + metrics.DeletePieceTotalNumberCounter.WithLabelValues(client.name).Inc() if err != nil { metrics.PieceUsageAmountGauge.WithLabelValues(client.name).Add(0 - float64(valSize)) }