update
This commit is contained in:
@@ -3,9 +3,6 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
)
|
||||
|
||||
func (id CartId) String() string {
|
||||
@@ -54,33 +51,6 @@ func NewRemoteGrain(id CartId, host string) (*RemoteGrain, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
var (
|
||||
remoteCartLatency = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "cart_remote_grain_calls_total_latency",
|
||||
Help: "The total latency of remote grains",
|
||||
})
|
||||
remoteCartCallsTotal = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "cart_remote_grain_calls_total",
|
||||
Help: "The total number of calls to remote grains",
|
||||
})
|
||||
)
|
||||
|
||||
// var start time.Time
|
||||
|
||||
// func MeasureLatency(fn func() (*CallResult, error)) (*CallResult, error) {
|
||||
// start = time.Now()
|
||||
// data, err := fn()
|
||||
// if err != nil {
|
||||
// return data, err
|
||||
// }
|
||||
// elapsed := time.Since(start).Milliseconds()
|
||||
// go func() {
|
||||
// remoteCartLatency.Add(float64(elapsed))
|
||||
// remoteCartCallsTotal.Inc()
|
||||
// }()
|
||||
// return data, nil
|
||||
// }
|
||||
|
||||
func (g *RemoteGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPayload, error) {
|
||||
|
||||
data, err := GetData(message.Write)
|
||||
|
||||
Reference in New Issue
Block a user