stats

package
v0.11.7-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2023 License: GPL-3.0, LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockRequestHandlerStats

type BlockRequestHandlerStats interface {
	IncBlockRequest()
	IncMissingBlockHash()
	UpdateBlocksReturned(num uint16)
	UpdateBlockRequestProcessingTime(duration time.Duration)
}

type CodeRequestHandlerStats

type CodeRequestHandlerStats interface {
	IncCodeRequest()
	IncMissingCodeHash()
	IncTooManyHashesRequested()
	IncDuplicateHashesRequested()
	UpdateCodeReadTime(duration time.Duration)
	UpdateCodeBytesReturned(bytes uint32)
}

type HandlerStats

HandlerStats reports prometheus metrics for the state sync handlers

func NewHandlerStats

func NewHandlerStats(enabled bool) HandlerStats

func NewNoopHandlerStats

func NewNoopHandlerStats() HandlerStats

type LeafsRequestHandlerStats

type LeafsRequestHandlerStats interface {
	IncLeafsRequest()
	IncInvalidLeafsRequest()
	UpdateLeafsReturned(numLeafs uint16)
	UpdateLeafsRequestProcessingTime(duration time.Duration)
	UpdateReadLeafsTime(duration time.Duration)
	UpdateSnapshotReadTime(duration time.Duration)
	UpdateGenerateRangeProofTime(duration time.Duration)
	UpdateRangeProofValsReturned(numProofVals int64)
	IncMissingRoot()
	IncTrieError()
	IncProofError()
	IncSnapshotReadError()
	IncSnapshotReadAttempt()
	IncSnapshotReadSuccess()
	IncSnapshotSegmentValid()
	IncSnapshotSegmentInvalid()
}

type MockHandlerStats

type MockHandlerStats struct {
	BlockRequestCount,
	MissingBlockHashCount,
	BlocksReturnedSum uint32
	BlockRequestProcessingTimeSum time.Duration

	CodeRequestCount,
	MissingCodeHashCount,
	TooManyHashesRequested,
	DuplicateHashesRequested,
	CodeBytesReturnedSum uint32
	CodeReadTimeSum time.Duration

	LeafsRequestCount,
	InvalidLeafsRequestCount,
	LeafsReturnedSum,
	MissingRootCount,
	TrieErrorCount,
	ProofErrorCount,
	SnapshotReadErrorCount,
	SnapshotReadAttemptCount,
	SnapshotReadSuccessCount,
	SnapshotSegmentValidCount,
	SnapshotSegmentInvalidCount uint32
	ProofValsReturned int64
	LeafsReadTime,
	SnapshotReadTime,
	GenerateRangeProofTime,
	LeafRequestProcessingTimeSum time.Duration
	// contains filtered or unexported fields
}

MockHandlerStats is mock for capturing and asserting on handler metrics in test

func (*MockHandlerStats) IncBlockRequest

func (m *MockHandlerStats) IncBlockRequest()

func (*MockHandlerStats) IncCodeRequest

func (m *MockHandlerStats) IncCodeRequest()

func (*MockHandlerStats) IncDuplicateHashesRequested

func (m *MockHandlerStats) IncDuplicateHashesRequested()

func (*MockHandlerStats) IncInvalidLeafsRequest

func (m *MockHandlerStats) IncInvalidLeafsRequest()

func (*MockHandlerStats) IncLeafsRequest

func (m *MockHandlerStats) IncLeafsRequest()

func (*MockHandlerStats) IncMissingBlockHash

func (m *MockHandlerStats) IncMissingBlockHash()

func (*MockHandlerStats) IncMissingCodeHash

func (m *MockHandlerStats) IncMissingCodeHash()

func (*MockHandlerStats) IncMissingRoot

func (m *MockHandlerStats) IncMissingRoot()

func (*MockHandlerStats) IncProofError

func (m *MockHandlerStats) IncProofError()

func (*MockHandlerStats) IncSnapshotReadAttempt

func (m *MockHandlerStats) IncSnapshotReadAttempt()

func (*MockHandlerStats) IncSnapshotReadError

func (m *MockHandlerStats) IncSnapshotReadError()

func (*MockHandlerStats) IncSnapshotReadSuccess

func (m *MockHandlerStats) IncSnapshotReadSuccess()

func (*MockHandlerStats) IncSnapshotSegmentInvalid

func (m *MockHandlerStats) IncSnapshotSegmentInvalid()

func (*MockHandlerStats) IncSnapshotSegmentValid

func (m *MockHandlerStats) IncSnapshotSegmentValid()

func (*MockHandlerStats) IncTooManyHashesRequested

func (m *MockHandlerStats) IncTooManyHashesRequested()

func (*MockHandlerStats) IncTrieError

func (m *MockHandlerStats) IncTrieError()

func (*MockHandlerStats) Reset

func (m *MockHandlerStats) Reset()

func (*MockHandlerStats) UpdateBlockRequestProcessingTime

func (m *MockHandlerStats) UpdateBlockRequestProcessingTime(duration time.Duration)

func (*MockHandlerStats) UpdateBlocksReturned

func (m *MockHandlerStats) UpdateBlocksReturned(num uint16)

func (*MockHandlerStats) UpdateCodeBytesReturned

func (m *MockHandlerStats) UpdateCodeBytesReturned(bytes uint32)

func (*MockHandlerStats) UpdateCodeReadTime

func (m *MockHandlerStats) UpdateCodeReadTime(duration time.Duration)

func (*MockHandlerStats) UpdateGenerateRangeProofTime

func (m *MockHandlerStats) UpdateGenerateRangeProofTime(duration time.Duration)

func (*MockHandlerStats) UpdateLeafsRequestProcessingTime

func (m *MockHandlerStats) UpdateLeafsRequestProcessingTime(duration time.Duration)

func (*MockHandlerStats) UpdateLeafsReturned

func (m *MockHandlerStats) UpdateLeafsReturned(numLeafs uint16)

func (*MockHandlerStats) UpdateRangeProofValsReturned

func (m *MockHandlerStats) UpdateRangeProofValsReturned(numProofVals int64)

func (*MockHandlerStats) UpdateReadLeafsTime

func (m *MockHandlerStats) UpdateReadLeafsTime(duration time.Duration)

func (*MockHandlerStats) UpdateSnapshotReadTime

func (m *MockHandlerStats) UpdateSnapshotReadTime(duration time.Duration)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL