Skip to content

Commit 9c1359e

Browse files
authored
Merge pull request #511 from Abirdcfly/master
fix: metric frontend_write_duration_seconds has wrong value
2 parents 87a6b6b + 868dc8e commit 9c1359e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/server/server.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ const (
106106
)
107107

108108
func (c *ProxyClientConnection) send(pkt *client.Packet) error {
109-
start := time.Now()
110-
defer metrics.Metrics.ObserveFrontendWriteLatency(time.Since(start))
109+
defer func(start time.Time) { metrics.Metrics.ObserveFrontendWriteLatency(time.Since(start)) }(time.Now())
111110
if c.Mode == "grpc" {
112111
return c.frontend.Send(pkt)
113112
}

0 commit comments

Comments
 (0)