-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathmetrics.go
41 lines (38 loc) · 1.45 KB
/
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
33
34
35
36
37
38
39
40
41
package main
import (
"github.com/prometheus/client_golang/prometheus"
)
var (
peerJoinChannel = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "peer_join_channel_time_seconds",
Help: "peer join channel time",
},[]string{"container_name"})
peerInstallChaincode = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "peer_install_chaincode_time_seconds",
Help: "peer install chaincode time",
},[]string{"container_name"})
peerInstantiateChaincode = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "peer_instantiate_chaincode_time_seconds",
Help: "peer instantiate chaincode time",
},[]string{"container_name"})
peerInvokeChaincode = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "peer_invoke_chaincode_time_seconds",
Help: "peer invoke chaincode time",
},[]string{"container_name"})
peerQueryChaincode = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "peer_query_chaincode_time_seconds",
Help: "peer query chaincode time",
},[]string{"container_name"})
peerUpgradeChaincode = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "peer_upgrade_chaincode_time_seconds",
Help: "peer upgrade chaincode time",
},[]string{"container_name"})
)
func init() {
prometheus.MustRegister(peerJoinChannel)
prometheus.MustRegister(peerInstallChaincode)
prometheus.MustRegister(peerInstantiateChaincode)
prometheus.MustRegister(peerInvokeChaincode)
prometheus.MustRegister(peerQueryChaincode)
prometheus.MustRegister(peerUpgradeChaincode)
}