Documentation ¶
Index ¶
- Constants
- Variables
- func BalanceTrackingTest(cfg *configuration.Configuration, err error, operationsSeen bool) *bool
- func BlockSyncingTest(err error, blocksSynced bool) *bool
- func ExitConstruction(config *configuration.Configuration, counterStorage *modules.CounterStorage, ...) error
- func ExitData(config *configuration.Configuration, counterStorage *modules.CounterStorage, ...) error
- func JSONFetch(url string, output interface{}) error
- func ReconciliationTest(cfg *configuration.Configuration, err error, reconciliationsPerformed bool, ...) *bool
- func RequestResponseTest(err error) bool
- func ResponseAssertionTest(err error) bool
- type CheckConstructionProgress
- type CheckConstructionResults
- type CheckConstructionStats
- type CheckConstructionStatus
- type CheckDataProgress
- type CheckDataResults
- type CheckDataStats
- type CheckDataStatus
- type CheckDataTests
- type EndCondition
Constants ¶
const (
// TimeElapsedCounter tracks the total time elapsed in seconds.
TimeElapsedCounter = "time_elapsed"
)
Variables ¶
var ( // ErrReconciliationFailure is returned if reconciliation fails. // TODO: Move to reconciler package (had to remove from processor // to prevent circular dependency) ErrReconciliationFailure = errors.New("reconciliation failure") )
Functions ¶
func BalanceTrackingTest ¶
func BalanceTrackingTest(cfg *configuration.Configuration, err error, operationsSeen bool) *bool
BalanceTrackingTest returns a boolean indicating if any balances went negative while syncing.
func BlockSyncingTest ¶
BlockSyncingTest returns a boolean indicating if it was possible to sync blocks.
func ExitConstruction ¶
func ExitConstruction( config *configuration.Configuration, counterStorage *modules.CounterStorage, jobStorage *modules.JobStorage, err error, ) error
ExitConstruction exits check:data, logs the test results to the console, and to a provided output path.
func ExitData ¶
func ExitData( config *configuration.Configuration, counterStorage *modules.CounterStorage, balanceStorage *modules.BalanceStorage, err error, endCondition configuration.CheckDataEndCondition, endConditionDetail string, ) error
ExitData exits check:data, logs the test results to the console, and to a provided output path.
func ReconciliationTest ¶
func ReconciliationTest( cfg *configuration.Configuration, err error, reconciliationsPerformed bool, reconciliationsFailed bool, ) *bool
ReconciliationTest returns a boolean if no reconciliation errors were received.
func RequestResponseTest ¶
RequestResponseTest returns a boolean indicating if all endpoints received a non-500 response.
func ResponseAssertionTest ¶
ResponseAssertionTest returns a boolean indicating if all responses received from the server were correctly formatted.
Types ¶
type CheckConstructionProgress ¶
type CheckConstructionProgress struct { Broadcasting int `json:"broadcasting"` Processing int `json:"processing"` }
CheckConstructionProgress contains the number of currently broadcasting transactions and processing jobs.
func ComputeCheckConstructionProgress ¶
func ComputeCheckConstructionProgress( ctx context.Context, broadcasts *modules.BroadcastStorage, jobs *modules.JobStorage, ) *CheckConstructionProgress
ComputeCheckConstructionProgress computes *CheckConstructionProgress.
type CheckConstructionResults ¶
type CheckConstructionResults struct { Error string `json:"error"` EndConditions map[string]int `json:"end_conditions"` Stats *CheckConstructionStats `json:"stats"` }
CheckConstructionResults contains any error that occurred on a check:construction run and a collection of interesting stats.
func ComputeCheckConstructionResults ¶
func ComputeCheckConstructionResults( cfg *configuration.Configuration, err error, counterStorage *modules.CounterStorage, jobStorage *modules.JobStorage, ) *CheckConstructionResults
ComputeCheckConstructionResults returns a populated CheckConstructionResults.
func (*CheckConstructionResults) Output ¶
func (c *CheckConstructionResults) Output(path string)
Output writes CheckConstructionResults to the provided path.
func (*CheckConstructionResults) Print ¶
func (c *CheckConstructionResults) Print()
Print logs CheckConstructionResults to the console.
type CheckConstructionStats ¶
type CheckConstructionStats struct { TransactionsConfirmed int64 `json:"transactions_confirmed"` TransactionsCreated int64 `json:"transactions_created"` StaleBroadcasts int64 `json:"stale_broadcasts"` FailedBroadcasts int64 `json:"failed_broadcasts"` AddressesCreated int64 `json:"addresses_created"` WorkflowsCompleted map[string]int64 `json:"workflows_completed"` }
CheckConstructionStats contains interesting stats that are tracked while running check:construction.
func ComputeCheckConstructionStats ¶
func ComputeCheckConstructionStats( ctx context.Context, config *configuration.Configuration, counters *modules.CounterStorage, jobs *modules.JobStorage, ) *CheckConstructionStats
ComputeCheckConstructionStats returns a populated CheckConstructionStats.
func (*CheckConstructionStats) Print ¶
func (c *CheckConstructionStats) Print()
Print calls PrintCounts and PrintWorkflows.
func (*CheckConstructionStats) PrintCounts ¶
func (c *CheckConstructionStats) PrintCounts()
PrintCounts logs counter-related stats to the console.
func (*CheckConstructionStats) PrintWorkflows ¶
func (c *CheckConstructionStats) PrintWorkflows()
PrintWorkflows logs workflow counts to the console.
type CheckConstructionStatus ¶
type CheckConstructionStatus struct { Stats *CheckConstructionStats `json:"stats"` Progress *CheckConstructionProgress `json:"progress"` }
CheckConstructionStatus contains CheckConstructionStats.
func ComputeCheckConstructionStatus ¶
func ComputeCheckConstructionStatus( ctx context.Context, config *configuration.Configuration, counters *modules.CounterStorage, broadcasts *modules.BroadcastStorage, jobs *modules.JobStorage, ) *CheckConstructionStatus
ComputeCheckConstructionStatus returns a populated *CheckConstructionStatus.
func FetchCheckConstructionStatus ¶
func FetchCheckConstructionStatus(url string) (*CheckConstructionStatus, error)
FetchCheckConstructionStatus fetches *CheckConstructionStatus.
type CheckDataProgress ¶
type CheckDataProgress struct { Blocks int64 `json:"blocks"` Tip int64 `json:"tip"` Completed float64 `json:"completed"` Rate float64 `json:"rate"` TimeRemaining string `json:"time_remaining"` ReconcilerQueueSize int `json:"reconciler_queue_size"` ReconcilerLastIndex int64 `json:"reconciler_last_index"` }
CheckDataProgress contains information about check:data's syncing progress.
func ComputeCheckDataProgress ¶
func ComputeCheckDataProgress( ctx context.Context, fetcher *fetcher.Fetcher, network *types.NetworkIdentifier, counters *modules.CounterStorage, blockStorage *modules.BlockStorage, reconciler *reconciler.Reconciler, ) *CheckDataProgress
ComputeCheckDataProgress returns a populated *CheckDataProgress.
type CheckDataResults ¶
type CheckDataResults struct { Error string `json:"error"` EndCondition *EndCondition `json:"end_condition"` Tests *CheckDataTests `json:"tests"` Stats *CheckDataStats `json:"stats"` }
CheckDataResults contains any error that occurred on a check:data run, the outcome of certain tests, and a collection of interesting stats.
func ComputeCheckDataResults ¶
func ComputeCheckDataResults( cfg *configuration.Configuration, err error, counterStorage *modules.CounterStorage, balanceStorage *modules.BalanceStorage, endCondition configuration.CheckDataEndCondition, endConditionDetail string, ) *CheckDataResults
ComputeCheckDataResults returns a populated CheckDataResults.
func (*CheckDataResults) Output ¶
func (c *CheckDataResults) Output(path string)
Output writes *CheckDataResults to the provided path.
func (*CheckDataResults) Print ¶
func (c *CheckDataResults) Print()
Print logs CheckDataResults to the console.
type CheckDataStats ¶
type CheckDataStats struct { Blocks int64 `json:"blocks"` Orphans int64 `json:"orphans"` Transactions int64 `json:"transactions"` Operations int64 `json:"operations"` Accounts int64 `json:"accounts"` ActiveReconciliations int64 `json:"active_reconciliations"` InactiveReconciliations int64 `json:"inactive_reconciliations"` ExemptReconciliations int64 `json:"exempt_reconciliations"` FailedReconciliations int64 `json:"failed_reconciliations"` SkippedReconciliations int64 `json:"skipped_reconciliations"` ReconciliationCoverage float64 `json:"reconciliation_coverage"` }
CheckDataStats contains interesting stats that are counted while running the check:data.
func ComputeCheckDataStats ¶
func ComputeCheckDataStats( ctx context.Context, counters *modules.CounterStorage, balances *modules.BalanceStorage, ) *CheckDataStats
ComputeCheckDataStats returns a populated CheckDataStats.
func (*CheckDataStats) Print ¶
func (c *CheckDataStats) Print()
Print logs CheckDataStats to the console.
type CheckDataStatus ¶
type CheckDataStatus struct { Stats *CheckDataStats `json:"stats"` Progress *CheckDataProgress `json:"progress"` }
CheckDataStatus contains both CheckDataStats and CheckDataProgress.
func ComputeCheckDataStatus ¶
func ComputeCheckDataStatus( ctx context.Context, blocks *modules.BlockStorage, counters *modules.CounterStorage, balances *modules.BalanceStorage, fetcher *fetcher.Fetcher, network *types.NetworkIdentifier, reconciler *reconciler.Reconciler, ) *CheckDataStatus
ComputeCheckDataStatus returns a populated *CheckDataStatus.
func FetchCheckDataStatus ¶
func FetchCheckDataStatus(url string) (*CheckDataStatus, error)
FetchCheckDataStatus fetches *CheckDataStatus.
type CheckDataTests ¶
type CheckDataTests struct { RequestResponse bool `json:"request_response"` ResponseAssertion bool `json:"response_assertion"` BlockSyncing *bool `json:"block_syncing"` BalanceTracking *bool `json:"balance_tracking"` Reconciliation *bool `json:"reconciliation"` }
CheckDataTests indicates which tests passed. If a test is nil, it did not apply to the run.
TODO: add CoinTracking
func ComputeCheckDataTests ¶
func ComputeCheckDataTests( ctx context.Context, cfg *configuration.Configuration, err error, counterStorage *modules.CounterStorage, ) *CheckDataTests
ComputeCheckDataTests returns a populated CheckDataTests.
func (*CheckDataTests) Print ¶
func (c *CheckDataTests) Print()
Print logs CheckDataTests to the console.
type EndCondition ¶
type EndCondition struct { Type configuration.CheckDataEndCondition `json:"type"` Detail string `json:"detail"` }
EndCondition contains the type of end condition and any detail associated with the stop.