forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.go
32 lines (26 loc) · 809 Bytes
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package comm
import "github.com/hyperledger/fabric/common/metrics"
var (
openConnCounterOpts = metrics.CounterOpts{
Namespace: "grpc",
Subsystem: "comm",
Name: "conn_opened",
Help: "gRPC connections opened. Open minus closed is the active number of connections.",
}
closedConnCounterOpts = metrics.CounterOpts{
Namespace: "grpc",
Subsystem: "comm",
Name: "conn_closed",
Help: "gRPC connections closed. Open minus closed is the active number of connections.",
}
)
func NewServerStatsHandler(p metrics.Provider) *ServerStatsHandler {
return &ServerStatsHandler{
OpenConnCounter: p.NewCounter(openConnCounterOpts),
ClosedConnCounter: p.NewCounter(closedConnCounterOpts),
}
}