logger

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 13 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 LogMemoryStats added in v0.5.5

func LogMemoryStats(ctx context.Context)

LogMemoryStats logs memory usage information.

func LogTransactionCreated added in v0.5.0

func LogTransactionCreated(
	transactionIdentifier *types.TransactionIdentifier,
)

LogTransactionCreated logs the hash of created transactions.

Types

type Logger

type Logger struct {
	CounterStorage *storage.CounterStorage
	BalanceStorage *storage.BalanceStorage
	// contains filtered or unexported fields
}

Logger contains all logic to record validator output and benchmark a Rosetta Server.

func NewLogger

func NewLogger(
	counterStorage *storage.CounterStorage,
	balanceStorage *storage.BalanceStorage,
	logDir string,
	logBlocks bool,
	logTransactions bool,
	logBalanceChanges bool,
	logReconciliation bool,
) *Logger

NewLogger constructs a new Logger.

func (*Logger) AddBlockStream

func (l *Logger) AddBlockStream(
	ctx context.Context,
	block *types.Block,
) error

AddBlockStream writes the next processed block to the end of the blockStreamFile output file.

func (*Logger) BalanceStream

func (l *Logger) BalanceStream(
	ctx context.Context,
	balanceChanges []*parser.BalanceChange,
) error

BalanceStream writes a slice of storage.BalanceChanges to the balanceStreamFile.

func (*Logger) LogConstructionStats

func (l *Logger) LogConstructionStats(ctx context.Context, inflightTransactions int) error

LogConstructionStats logs all construction values in CounterStorage.

func (*Logger) LogDataStats

func (l *Logger) LogDataStats(ctx context.Context) error

LogDataStats logs all data values in CounterStorage.

func (*Logger) LogTipEstimate added in v0.5.5

func (l *Logger) LogTipEstimate(ctx context.Context, tipIndex int64) error

LogTipEstimate logs information about the remaining blocks to sync.

func (*Logger) ReconcileFailureStream

func (l *Logger) ReconcileFailureStream(
	ctx context.Context,
	reconciliationType string,
	account *types.AccountIdentifier,
	currency *types.Currency,
	computedBalance string,
	nodeBalance string,
	block *types.BlockIdentifier,
) error

ReconcileFailureStream logs all reconciliation checks performed during syncing.

func (*Logger) ReconcileSuccessStream

func (l *Logger) ReconcileSuccessStream(
	ctx context.Context,
	reconciliationType string,
	account *types.AccountIdentifier,
	currency *types.Currency,
	balance string,
	block *types.BlockIdentifier,
) error

ReconcileSuccessStream logs all reconciliation checks performed during syncing.

func (*Logger) RemoveBlockStream

func (l *Logger) RemoveBlockStream(
	ctx context.Context,
	block *types.BlockIdentifier,
) error

RemoveBlockStream writes the next processed block to the end of the blockStreamFile output file.

func (*Logger) TransactionStream

func (l *Logger) TransactionStream(
	ctx context.Context,
	block *types.Block,
) error

TransactionStream writes the next processed block's transactions to the end of the transactionStreamFile.

Jump to

Keyboard shortcuts

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