2020-02-17 12:17:02 +00:00
|
|
|
package server
|
2019-10-29 17:51:17 +00:00
|
|
|
|
|
|
|
import "github.com/prometheus/client_golang/prometheus"
|
|
|
|
|
|
|
|
// Metrics used in monitoring service.
|
|
|
|
var (
|
2020-02-21 14:56:28 +00:00
|
|
|
getapplicationlogCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getapplicationlog rpc endpoint",
|
|
|
|
Name: "getapplicationlog_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
2019-10-29 17:51:17 +00:00
|
|
|
getbestblockhashCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getbestblockhash rpc endpoint",
|
|
|
|
Name: "getbestblockhash_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
getbestblockCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getbestblock rpc endpoint",
|
|
|
|
Name: "getbestblock_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
getblockcountCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getblockcount rpc endpoint",
|
|
|
|
Name: "getblockcount_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
getblockHashCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getblockhash rpc endpoint",
|
|
|
|
Name: "getblockhash_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-03-04 17:35:37 +00:00
|
|
|
getblockheaderCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getblockheader rpc endpoint",
|
|
|
|
Name: "getblockheader_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-02-19 09:44:31 +00:00
|
|
|
getblocksysfeeCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getblocksysfee rpc endpoint",
|
|
|
|
Name: "getblocksysfee_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-02-26 12:42:04 +00:00
|
|
|
getclaimableCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getclaimable rpc endpoint",
|
|
|
|
Name: "getclaimable_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2019-10-29 17:51:17 +00:00
|
|
|
getconnectioncountCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getconnectioncount rpc endpoint",
|
|
|
|
Name: "getconnectioncount_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-02-15 16:53:08 +00:00
|
|
|
getcontractstateCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getcontractstate rpc endpoint",
|
|
|
|
Name: "getcontractstate_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-03-05 11:50:06 +00:00
|
|
|
getnep5balancesCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getnep5balances rpc endpoint",
|
|
|
|
Name: "getnep5balances_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-03-05 12:16:03 +00:00
|
|
|
getnep5transfersCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getnep5transfers rpc endpoint",
|
|
|
|
Name: "getnep5transfers_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2019-10-29 17:51:17 +00:00
|
|
|
getversionCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getversion rpc endpoint",
|
|
|
|
Name: "getversion_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
getpeersCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getpeers rpc endpoint",
|
|
|
|
Name: "getpeers_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-03-02 16:13:44 +00:00
|
|
|
getrawmempoolCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getrawmempool rpc endpoint",
|
|
|
|
Name: "getrawmempool_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2019-10-29 17:51:17 +00:00
|
|
|
validateaddressCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to validateaddress rpc endpoint",
|
|
|
|
Name: "validateaddress_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
getassetstateCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getassetstate rpc endpoint",
|
|
|
|
Name: "getassetstate_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
getaccountstateCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getaccountstate rpc endpoint",
|
|
|
|
Name: "getaccountstate_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-03-05 14:20:50 +00:00
|
|
|
gettransactionheightCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to gettransactionheight rpc endpoint",
|
|
|
|
Name: "gettransactionheight_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-02-06 12:02:03 +00:00
|
|
|
gettxoutCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to gettxout rpc endpoint",
|
|
|
|
Name: "gettxout_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2019-10-29 17:51:17 +00:00
|
|
|
getrawtransactionCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getrawtransaction rpc endpoint",
|
|
|
|
Name: "getrawtransaction_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2019-11-15 19:04:10 +00:00
|
|
|
getunspentsCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getunspents rpc endpoint",
|
|
|
|
Name: "getunspents_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2019-10-29 17:51:17 +00:00
|
|
|
sendrawtransactionCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to sendrawtransaction rpc endpoint",
|
|
|
|
Name: "sendrawtransaction_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
2020-01-30 08:03:44 +00:00
|
|
|
|
2020-03-02 17:01:32 +00:00
|
|
|
submitblockCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to submitblock rpc endpoint",
|
|
|
|
Name: "submitblock_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-01-30 08:03:44 +00:00
|
|
|
getstorageCalled = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Help: "Number of calls to getstorage rpc endpoint",
|
|
|
|
Name: "getstorage_called",
|
|
|
|
Namespace: "neogo",
|
|
|
|
},
|
|
|
|
)
|
2019-10-29 17:51:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
prometheus.MustRegister(
|
2020-02-21 14:56:28 +00:00
|
|
|
getapplicationlogCalled,
|
2019-10-29 17:51:17 +00:00
|
|
|
getbestblockhashCalled,
|
|
|
|
getbestblockCalled,
|
|
|
|
getblockcountCalled,
|
|
|
|
getblockHashCalled,
|
2020-03-04 17:35:37 +00:00
|
|
|
getblockheaderCalled,
|
2020-02-19 09:44:31 +00:00
|
|
|
getblocksysfeeCalled,
|
2019-10-29 17:51:17 +00:00
|
|
|
getconnectioncountCalled,
|
2020-02-15 16:53:08 +00:00
|
|
|
getcontractstateCalled,
|
2019-10-29 17:51:17 +00:00
|
|
|
getversionCalled,
|
|
|
|
getpeersCalled,
|
2020-03-02 16:13:44 +00:00
|
|
|
getrawmempoolCalled,
|
2019-10-29 17:51:17 +00:00
|
|
|
validateaddressCalled,
|
|
|
|
getassetstateCalled,
|
|
|
|
getaccountstateCalled,
|
2019-11-15 19:04:10 +00:00
|
|
|
getunspentsCalled,
|
2020-03-05 14:20:50 +00:00
|
|
|
gettransactionheightCalled,
|
2020-02-06 12:02:03 +00:00
|
|
|
gettxoutCalled,
|
2019-10-29 17:51:17 +00:00
|
|
|
getrawtransactionCalled,
|
|
|
|
sendrawtransactionCalled,
|
2020-03-02 17:01:32 +00:00
|
|
|
submitblockCalled,
|
2020-01-30 08:03:44 +00:00
|
|
|
getstorageCalled,
|
2019-10-29 17:51:17 +00:00
|
|
|
)
|
|
|
|
}
|