stats

package
v0.0.0-...-69059c8 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OnField  FieldStatus = "on_field"
	OffField FieldStatus = "off_field"

	Melt      ReactionModifier = "melt"
	Vaporize  ReactionModifier = "vaporize"
	Spread    ReactionModifier = "spread"
	Aggravate ReactionModifier = "aggravate"
)

Variables

This section is empty.

Functions

func Collectors

func Collectors() map[string]Config

func Register

func Register(cfg Config)

Types

type ActionEvent

type ActionEvent struct {
	Frame    int    `json:"frame"     msg:"frame"`
	ActionId int    `json:"action_id" msg:"action_id"`
	Action   string `json:"action"    msg:"action"`
}

func (*ActionEvent) DecodeMsg

func (z *ActionEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (ActionEvent) EncodeMsg

func (z ActionEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (ActionEvent) MarshalMsg

func (z ActionEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ActionEvent) Msgsize

func (z ActionEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ActionEvent) UnmarshalMsg

func (z *ActionEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ActionFailInterval

type ActionFailInterval struct {
	Start  int    `json:"start"  msg:"start"`
	End    int    `json:"end"    msg:"end"`
	Reason string `json:"reason" msg:"reason"`
}

func (*ActionFailInterval) DecodeMsg

func (z *ActionFailInterval) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (ActionFailInterval) EncodeMsg

func (z ActionFailInterval) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (ActionFailInterval) MarshalMsg

func (z ActionFailInterval) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ActionFailInterval) Msgsize

func (z ActionFailInterval) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ActionFailInterval) UnmarshalMsg

func (z *ActionFailInterval) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ActiveCharacterInterval

type ActiveCharacterInterval struct {
	Start     int `json:"start"     msg:"start"`
	End       int `json:"end"       msg:"end"`
	Character int `json:"character" msg:"character"`
}

func (*ActiveCharacterInterval) DecodeMsg

func (z *ActiveCharacterInterval) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (ActiveCharacterInterval) EncodeMsg

func (z ActiveCharacterInterval) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (ActiveCharacterInterval) MarshalMsg

func (z ActiveCharacterInterval) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ActiveCharacterInterval) Msgsize

func (z ActiveCharacterInterval) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ActiveCharacterInterval) UnmarshalMsg

func (z *ActiveCharacterInterval) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type CharacterResult

type CharacterResult struct {
	// For raw data usage outside of gcsim only
	Name string `json:"name" msg:"name"`

	DamageEvents   []DamageEvent   `json:"damage_events"   msg:"damage_events"`
	ReactionEvents []ReactionEvent `json:"reaction_events" msg:"reaction_events"`
	ActionEvents   []ActionEvent   `json:"action_events"   msg:"action_events"`
	EnergyEvents   []EnergyEvent   `json:"energy_events"   msg:"energy_events"`
	HealEvents     []HealEvent     `json:"heal_events"     msg:"heal_events"`

	// TODO: Move to Result since only active character can perform actions?
	FailedActions []ActionFailInterval `json:"failed_actions" msg:"failed_actions"`

	EnergyStatus []float64 `json:"energy_status" msg:"energy_status"` // can be completely replaced by EnergyEvents?
	HealthStatus []float64 `json:"health_status" msg:"health_status"`

	DamageCumulativeContrib []float64 `json:"damage_cumulative_contrib" msg:"damage_cumulative_contrib"`

	ActiveTime  int     `json:"active_time"  msg:"active_time"`
	EnergySpent float64 `json:"energy_spent" msg:"energy_spent"`
}

func (*CharacterResult) DecodeMsg

func (z *CharacterResult) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*CharacterResult) EncodeMsg

func (z *CharacterResult) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*CharacterResult) MarshalMsg

func (z *CharacterResult) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*CharacterResult) Msgsize

func (z *CharacterResult) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*CharacterResult) UnmarshalMsg

func (z *CharacterResult) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Collector

type Collector interface {
	Flush(core *core.Core, result *Result)
}

type Config

type Config struct {
	Name string
	New  NewStatsFunc
}

type DamageEvent

type DamageEvent struct {
	Frame              int              `json:"frame"               msg:"frame"`
	ActionId           int              `json:"action_id"           msg:"action_id"`
	Source             string           `json:"source"              msg:"source"`
	Target             int              `json:"target"              msg:"target"`
	Element            string           `json:"element"             msg:"element"`
	ReactionModifier   ReactionModifier `json:"reaction_modifier"   msg:"reaction_modifier"`
	Crit               bool             `json:"crit"                msg:"crit"`
	Modifiers          []string         `json:"modifiers"           msg:"modifiers"`
	MitigationModifier float64          `json:"mitigation_modifier" msg:"mitigation_modifier"`
	Damage             float64          `json:"damage"              msg:"damage"`
}

func (*DamageEvent) DecodeMsg

func (z *DamageEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*DamageEvent) EncodeMsg

func (z *DamageEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*DamageEvent) MarshalMsg

func (z *DamageEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*DamageEvent) Msgsize

func (z *DamageEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*DamageEvent) UnmarshalMsg

func (z *DamageEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type EndStats

type EndStats struct {
	EndingEnergy float64 `json:"ending_energy" msg:"ending_energy"`
}

func (*EndStats) DecodeMsg

func (z *EndStats) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (EndStats) EncodeMsg

func (z EndStats) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (EndStats) MarshalMsg

func (z EndStats) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (EndStats) Msgsize

func (z EndStats) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EndStats) UnmarshalMsg

func (z *EndStats) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type EnemyResult

type EnemyResult struct {
	ReactionStatus   []ReactionStatusInterval `json:"reaction_status"   msg:"reaction_status"`
	ReactionUptime   map[string]int           `json:"reaction_uptime"   msg:"reaction_uptime"` // can calculate from intervals?
	CumulativeDamage []float64                `json:"cumulative_damage" msg:"cumulative_damage"`
}

func (*EnemyResult) DecodeMsg

func (z *EnemyResult) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*EnemyResult) EncodeMsg

func (z *EnemyResult) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*EnemyResult) MarshalMsg

func (z *EnemyResult) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*EnemyResult) Msgsize

func (z *EnemyResult) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EnemyResult) UnmarshalMsg

func (z *EnemyResult) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type EnergyEvent

type EnergyEvent struct {
	Frame       int         `json:"frame"        msg:"frame"`
	Source      string      `json:"source"       msg:"source"`
	FieldStatus FieldStatus `json:"field_status" msg:"field_status"`
	Gained      float64     `json:"gained"       msg:"gained"`
	Wasted      float64     `json:"wasted"       msg:"wasted"`
	Current     float64     `json:"current"      msg:"current"` // this is pre + gained
}

func (*EnergyEvent) DecodeMsg

func (z *EnergyEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*EnergyEvent) EncodeMsg

func (z *EnergyEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*EnergyEvent) MarshalMsg

func (z *EnergyEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*EnergyEvent) Msgsize

func (z *EnergyEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EnergyEvent) UnmarshalMsg

func (z *EnergyEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type FieldStatus

type FieldStatus string

func (*FieldStatus) DecodeMsg

func (z *FieldStatus) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (FieldStatus) EncodeMsg

func (z FieldStatus) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (FieldStatus) MarshalMsg

func (z FieldStatus) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (FieldStatus) Msgsize

func (z FieldStatus) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*FieldStatus) UnmarshalMsg

func (z *FieldStatus) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type HealEvent

type HealEvent struct {
	Frame  int     `json:"frame"  msg:"frame"`
	Source string  `json:"source" msg:"source"`
	Target int     `json:"target" msg:"target"`
	Heal   float64 `json:"heal"   msg:"heal"`
}

Heal events are stored in the source character

func (*HealEvent) DecodeMsg

func (z *HealEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*HealEvent) EncodeMsg

func (z *HealEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*HealEvent) MarshalMsg

func (z *HealEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*HealEvent) Msgsize

func (z *HealEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*HealEvent) UnmarshalMsg

func (z *HealEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type NewStatsFunc

type NewStatsFunc func(core *core.Core) (Collector, error)

type ReactionEvent

type ReactionEvent struct {
	Frame    int    `json:"frame"    msg:"frame"`
	Source   string `json:"source"   msg:"source"`
	Target   int    `json:"target"   msg:"target"`
	Reaction string `json:"reaction" msg:"reaction"`
}

func (*ReactionEvent) DecodeMsg

func (z *ReactionEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ReactionEvent) EncodeMsg

func (z *ReactionEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ReactionEvent) MarshalMsg

func (z *ReactionEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ReactionEvent) Msgsize

func (z *ReactionEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ReactionEvent) UnmarshalMsg

func (z *ReactionEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ReactionModifier

type ReactionModifier string

func (*ReactionModifier) DecodeMsg

func (z *ReactionModifier) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (ReactionModifier) EncodeMsg

func (z ReactionModifier) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (ReactionModifier) MarshalMsg

func (z ReactionModifier) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ReactionModifier) Msgsize

func (z ReactionModifier) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ReactionModifier) UnmarshalMsg

func (z *ReactionModifier) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ReactionStatusInterval

type ReactionStatusInterval struct {
	Start int    `json:"start" msg:"start"`
	End   int    `json:"end"   msg:"end"`
	Type  string `json:"type"  msg:"type"`
}

func (*ReactionStatusInterval) DecodeMsg

func (z *ReactionStatusInterval) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (ReactionStatusInterval) EncodeMsg

func (z ReactionStatusInterval) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (ReactionStatusInterval) MarshalMsg

func (z ReactionStatusInterval) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ReactionStatusInterval) Msgsize

func (z ReactionStatusInterval) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ReactionStatusInterval) UnmarshalMsg

func (z *ReactionStatusInterval) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Result

type Result struct {
	Seed          uint64    `json:"seed"           msg:"seed"`
	Duration      int       `json:"duration"       msg:"duration"`
	TotalDamage   float64   `json:"total_damage"   msg:"total_damage"`
	DPS           float64   `json:"dps"            msg:"dps"`
	DamageBuckets []float64 `json:"damage_buckets" msg:"damage_buckets"`

	ActiveCharacters []ActiveCharacterInterval `json:"active_characters" msg:"active_characters"`
	DamageMitigation []float64                 `json:"damage_mitigation" msg:"damage_mitigation"`
	ShieldResults    ShieldResult              `json:"shield_results"    msg:"shield_results"`

	Characters    []CharacterResult `json:"characters"     msg:"characters"`
	Enemies       []EnemyResult     `json:"enemies"        msg:"enemies"`
	TargetOverlap bool              `json:"target_overlap" msg:"target_overlap"`

	EndStats []EndStats `json:"end_stats" msg:"end_stats"`
}

func (*Result) DecodeMsg

func (z *Result) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Result) EncodeMsg

func (z *Result) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Result) MarshalMsg

func (z *Result) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Result) Msgsize

func (z *Result) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Result) UnmarshalMsg

func (z *Result) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ShieldInterval

type ShieldInterval struct {
	Start int                `json:"start" msg:"start"`
	End   int                `json:"end"   msg:"end"`
	HP    map[string]float64 `json:"hp"    msg:"hp"`
}

func (*ShieldInterval) DecodeMsg

func (z *ShieldInterval) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ShieldInterval) EncodeMsg

func (z *ShieldInterval) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ShieldInterval) MarshalMsg

func (z *ShieldInterval) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ShieldInterval) Msgsize

func (z *ShieldInterval) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ShieldInterval) UnmarshalMsg

func (z *ShieldInterval) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ShieldResult

type ShieldResult struct {
	Shields         []ShieldStats                     `json:"shields"          msg:"shields"`
	EffectiveShield map[string][]ShieldSingleInterval `json:"effective_shield" msg:"effective_shield"`
}

func (*ShieldResult) DecodeMsg

func (z *ShieldResult) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ShieldResult) EncodeMsg

func (z *ShieldResult) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ShieldResult) MarshalMsg

func (z *ShieldResult) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ShieldResult) Msgsize

func (z *ShieldResult) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ShieldResult) UnmarshalMsg

func (z *ShieldResult) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ShieldSingleInterval

type ShieldSingleInterval struct {
	Start int     `json:"start" msg:"start"`
	End   int     `json:"end"   msg:"end"`
	HP    float64 `json:"hp"    msg:"hp"`
}

func (*ShieldSingleInterval) DecodeMsg

func (z *ShieldSingleInterval) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (ShieldSingleInterval) EncodeMsg

func (z ShieldSingleInterval) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (ShieldSingleInterval) MarshalMsg

func (z ShieldSingleInterval) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ShieldSingleInterval) Msgsize

func (z ShieldSingleInterval) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ShieldSingleInterval) UnmarshalMsg

func (z *ShieldSingleInterval) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ShieldStats

type ShieldStats struct {
	Name      string           `json:"name"      msg:"name"`
	Intervals []ShieldInterval `json:"intervals" msg:"intervals"`
}

func (*ShieldStats) DecodeMsg

func (z *ShieldStats) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ShieldStats) EncodeMsg

func (z *ShieldStats) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ShieldStats) MarshalMsg

func (z *ShieldStats) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ShieldStats) Msgsize

func (z *ShieldStats) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ShieldStats) UnmarshalMsg

func (z *ShieldStats) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type WeightedStreamStats

type WeightedStreamStats struct {
	Min, Max float64
	// contains filtered or unexported fields
}

func (*WeightedStreamStats) Add

func (s *WeightedStreamStats) Add(x float64, w int)

func (*WeightedStreamStats) Mean

func (s *WeightedStreamStats) Mean() float64

func (*WeightedStreamStats) StdDev

func (s *WeightedStreamStats) StdDev() float64

func (*WeightedStreamStats) Variance

func (s *WeightedStreamStats) Variance() float64

Directories

Path Synopsis
package endstats collects a snapshot of relevant information right when a simulation ends, such as ending energy etc..
package endstats collects a snapshot of relevant information right when a simulation ends, such as ending energy etc..

Jump to

Keyboard shortcuts

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