ncwtester

package
v0.0.0-...-19311e0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVLog

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

func NewCSVLog

func NewCSVLog(logFile string) *CSVLog

func (*CSVLog) Add

func (l *CSVLog) Add(tx, rx rune, reactionTime time.Duration)

Add a CSV log line

func (*CSVLog) Create

func (l *CSVLog) Create()

Create the file if it doesn't exist

func (*CSVLog) Write

func (l *CSVLog) Write(row string)

Write a csv line to the file - this should end in \n

type Stat

type Stat struct {
	Name          string
	ReactionTimes []float64
	Errors        int
	Total         int
	ConfusedWith  []string
	// contains filtered or unexported fields
}

Hold stats about a letter or group of letters

func NewStat

func NewStat(Name string) *Stat

NewStat instantiates a new statistic

func (*Stat) Add

func (s *Stat) Add(tx, rx string, reactionTime float64)

func (*Stat) Avg

func (s *Stat) Avg() float64

func (*Stat) Max

func (s *Stat) Max() float64

func (*Stat) Min

func (s *Stat) Min() float64

func (*Stat) PercentageErrors

func (s *Stat) PercentageErrors() float64

func (*Stat) Percentile

func (s *Stat) Percentile(p float64) float64

type Stats

type Stats struct {
	StatByLetter map[string]*Stat
	Total        *Stat
	// contains filtered or unexported fields
}

func NewStats

func NewStats() *Stats

NewStats creates an empty NewStats

func (*Stats) Add

func (s *Stats) Add(tx, rx string, reactionTime float64)

func (*Stats) Load

func (s *Stats) Load(csvFile string, timeCutoff time.Duration)

Load loads the stats from csvFile if set

func (*Stats) Summary

func (s *Stats) Summary()

Summary digests the stats and shows them

func (*Stats) TotalSummary

func (s *Stats) TotalSummary()

TotalSummary prints the total stats only

Jump to

Keyboard shortcuts

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