stats

package
v23.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventStats

type EventStats map[string]map[string]map[string]int

EventStats defines an object that keeps a tally of each event that has occurred during a simulation.

func NewEventStats

func NewEventStats() EventStats

NewEventStats creates a new empty EventStats object

func (EventStats) ExportEvents

func (es EventStats) ExportEvents(ExportStatsPath string, w io.Writer)

func (EventStats) ExportJSON

func (es EventStats) ExportJSON(path string)

ExportJSON saves the event stats as a JSON file on a given path

func (EventStats) Print

func (es EventStats) Print(w io.Writer)

Print the event stats in JSON format.

func (EventStats) Tally

func (es EventStats) Tally(route, op, evResult string)

Tally increases the count of a simulation event.

type ExportConfig

type ExportConfig struct {
	ExportParamsPath   string // custom file path to save the exported params JSON
	ExportParamsHeight int    // height to which export the randomly generated params
	ExportStatePath    string // custom file path to save the exported app state JSON
	ExportStatsPath    string // custom file path to save the exported simulation statistics JSON
	WriteStatsToDB     bool
}

type StatsDb

type StatsDb struct {
	// contains filtered or unexported fields
}

TODO: Setup an sql schema file instead of doing it in-line here

func SetupStatsDb

func SetupStatsDb(config ExportConfig) (StatsDb, error)

func (StatsDb) Cleanup

func (stats StatsDb) Cleanup()

func (StatsDb) LogActionResult

func (stats StatsDb) LogActionResult(header tmproto.Header, opMsg simulation.OperationMsg, resultData []byte) error

Jump to

Keyboard shortcuts

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