de38c531d5
* Allow the application to process events in parallel there is a main thread that tracks incoming messages, but then it spawns goroutines to actually process each slot so that they can happen concurrently. * Control knownGaps in existing test * Use Interfaces for different fork version Use interfaces for `SignedBeaconBlock` and `BeaconState`, this allows the application to determine the correct forked struct. In the test we also use a switch condition to properly serve the correct mimics. * Utilize new ipld-ethcl-db repository * Add final tests * Update timeout and secret * Update token * Update docker compose * Update expected inserts
36 lines
1.2 KiB
Go
36 lines
1.2 KiB
Go
package beaconclient
|
|
|
|
import (
|
|
"sync/atomic"
|
|
)
|
|
|
|
// Wrapper function to increment inserts. If we want to use mutexes later we can easily update all
|
|
// occurrences here.
|
|
func (m *BeaconClientMetrics) IncrementHeadTrackingInserts(inc uint64) {
|
|
atomic.AddUint64(&m.HeadTrackingInserts, inc)
|
|
}
|
|
|
|
// Wrapper function to increment reorgs. If we want to use mutexes later we can easily update all
|
|
// occurrences here.
|
|
func (m *BeaconClientMetrics) IncrementHeadTrackingReorgs(inc uint64) {
|
|
atomic.AddUint64(&m.HeadTrackingReorgs, inc)
|
|
}
|
|
|
|
// Wrapper function to increment known gaps. If we want to use mutexes later we can easily update all
|
|
// occurrences here.
|
|
func (m *BeaconClientMetrics) IncrementHeadTrackingKnownGaps(inc uint64) {
|
|
atomic.AddUint64(&m.HeadTrackingKnownGaps, inc)
|
|
}
|
|
|
|
// Wrapper function to increment head errors. If we want to use mutexes later we can easily update all
|
|
// occurrences here.
|
|
func (m *BeaconClientMetrics) IncrementHeadError(inc uint64) {
|
|
atomic.AddUint64(&m.HeadError, inc)
|
|
}
|
|
|
|
// Wrapper function to increment reorg errors. If we want to use mutexes later we can easily update all
|
|
// occurrences here.
|
|
func (m *BeaconClientMetrics) IncrementHeadReorgError(inc uint64) {
|
|
atomic.AddUint64(&m.HeadReorgError, inc)
|
|
}
|