prysm-pulse/beacon-chain/sync/initial-sync/metrics.go
Raul Jordan eb900a8193
Refactor Initial Sync, Enable Catching Up to Chain (#2111)
* refactor initial sync to prevent reorg infinite loops

* lint

* fixed build

* passing tests

* tests passing

* terence suggestion

* new attempt

* clean up and refactor sync service

* complete the new initial sync logic

* revert head

* init sync working

* config for blockchain receive block

* all works

* builds

* fix a few more tests

* init sync tests pass

* revert scripts

* revert accounts changes

* lint

* lint2

* travis lint

* fix build

* fix single use argument

* any peer

* imports spacing

* imports

* ready for a rolling restart

* add todo

* fork choice in blocks when exiting sync

* readd finalized state root to requests

* successful build

* revert blockchain config

* old config reversion

* initial sync tests pass

* initial sync full test works

* lint

* use the new block processing api

* new proto defs

* init sync functions again

* remove sync polling

* tests fixed

* fixed catching up with chain

* tests pass

* spacing

* lint

* goimports

* add changes

* add lock and conditional to prevent multiple goroutines

* make reg sync synchronous

* add

* fixed the parent block issue

* fix errors in chain service

* tests pass

* check nil block

* typo

* fix nil state

* merge & conflicts

* revert synchronus reg sync

* add more spans to state db

* fix lint

* lint
2019-04-03 10:13:19 -05:00

35 lines
1.0 KiB
Go

package initialsync
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
// Metrics
sentBatchedBlockReq = promauto.NewCounter(prometheus.CounterOpts{
Name: "initsync_sent_batched_block_req",
Help: "The number of sent batched block req",
})
batchedBlockReq = promauto.NewCounter(prometheus.CounterOpts{
Name: "initsync_batched_block_req",
Help: "The number of received batch blocks responses",
})
recBlock = promauto.NewCounter(prometheus.CounterOpts{
Name: "initsync_received_blocks",
Help: "The number of received blocks",
})
recBlockAnnounce = promauto.NewCounter(prometheus.CounterOpts{
Name: "initsync_received_block_announce",
Help: "The number of received block announce",
})
stateReq = promauto.NewCounter(prometheus.CounterOpts{
Name: "initsync_state_req",
Help: "The number of sent state requests",
})
recState = promauto.NewCounter(prometheus.CounterOpts{
Name: "initsync_received_state",
Help: "The number of received state",
})
)