results

package
v0.0.0-...-fa60219 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimeElapsedCounter tracks the total time elapsed in seconds.
	TimeElapsedCounter = "time_elapsed"
)

Variables

This section is empty.

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

func BlockSyncingTest(err error, blocksSynced bool) *bool

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:construction, 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 ExitPerf

func ExitPerf(
	config *configuration.CheckPerfConfiguration,
	err error,
	rawStats *CheckPerfRawStats,
) error

ExitPerf exits check:perf, logs the test results to the console, and to a provided output path.

func JSONFetch

func JSONFetch(url string, output interface{}) error

JSONFetch makes a GET request to the URL and unmarshal the response into output.

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

func RequestResponseTest(err error) bool

RequestResponseTest returns a boolean indicating if all endpoints received a non-500 response.

func ResponseAssertionTest

func ResponseAssertionTest(err error) bool

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 CheckPerfRawStats

type CheckPerfRawStats struct {
	BlockEndpointTotalTime          time.Duration
	BlockEndpointNumErrors          int64
	AccountBalanceEndpointTotalTime time.Duration
	AccountBalanceNumErrors         int64
}

type CheckPerfStats

type CheckPerfStats struct {
	StartBlock                          int64 `json:"start_block"`
	EndBlock                            int64 `json:"end_block"`
	NumTimesHitEachEndpoint             int   `json:"num_times_hit_each_endpoint"`
	AccountBalanceEndpointAverageTimeMs int64 `json:"account_balance_endpoint_average_time_ms"`
	AccountBalanceEndpointTotalTimeMs   int64 `json:"account_balance_endpoint_total_time_ms"`
	AccountBalanceEndpointNumErrors     int64 `json:"account_balance_endpoint_num_errors"`
	BlockEndpointAverageTimeMs          int64 `json:"block_endpoint_average_time_ms"`
	BlockEndpointTotalTimeMs            int64 `json:"block_endpoint_total_time_ms"`
	BlockEndpointNumErrors              int64 `json:"block_endpoint_num_errors"`
}

CheckPerfStats contains interesting stats that are counted while running the check:perf.

func ComputeCheckPerfStats

func ComputeCheckPerfStats(
	config *configuration.CheckPerfConfiguration,
	rawStats *CheckPerfRawStats,
) *CheckPerfStats

ComputeCheckPerfStats returns a populated CheckPerfStats.

func (*CheckPerfStats) Output

func (c *CheckPerfStats) Output(path string)

Output writes *CheckPerfResults to the provided path.

func (*CheckPerfStats) Print

func (c *CheckPerfStats) Print()

Print logs CheckPerfStats 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.

Jump to

Keyboard shortcuts

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