Versions in this module Expand all Collapse all v0 v0.3.0 Aug 18, 2021 Changes in this version + func AddCycleError(counter *prometheus.CounterVec, event interpreter.Event, errorTag string) + func AddDuration(histogram prometheus.ObserverVec, duration float64, event interpreter.Event) + func AddEventError(counter *prometheus.CounterVec, event interpreter.Event, errorTag string) + func NewParserValidator(cycleValidator cycleValidation, eventValidator eventValidation, ...) *parserValidator + func ParseTime(e interpreter.Event, location TimeLocation) time.Time + func Provide() fx.Option + func ProvideEventMetrics() fx.Option + type CalculatorFunc func([]interpreter.Event, interpreter.Event) error + func BootDurationCalculator(logger *zap.Logger, successCallback func(interpreter.Event, float64)) CalculatorFunc + func (cf CalculatorFunc) Calculate(events []interpreter.Event, event interpreter.Event) error + type CycleValidationConfig struct + CycleType string + EventOrder []string + Key enums.CycleValidationType + MetadataValidators []string + type DurationCalculator interface + Calculate func([]interpreter.Event, interpreter.Event) error + type EventClient interface + GetEvents func(deviceID string) []interpreter.Event + type EventToCurrentCalculator struct + func NewEventToCurrentCalculator(eventFinder Finder, ...) (*EventToCurrentCalculator, error) + func (c *EventToCurrentCalculator) Calculate(events []interpreter.Event, event interpreter.Event) error + type EventValidationConfig struct + BirthdateAlignmentDuration time.Duration + BirthdateValidator TimeValidationConfig + BootTimeValidator TimeValidationConfig + Key enums.EventValidationType + MinBootDuration time.Duration + ValidEventTypes []string + type EventsParser interface + Parse func(eventsHistory []interpreter.Event, currentEvent interpreter.Event) ([]interpreter.Event, error) + type Finder interface + Find func(events []interpreter.Event, incomingEvent interpreter.Event) (interpreter.Event, error) + type Measures struct + BootCycleErrorTags *prometheus.CounterVec + BootToManageableHistogram prometheus.ObserverVec + EventErrorTags *prometheus.CounterVec + MetadataFields *prometheus.CounterVec + RebootCycleErrorTags *prometheus.CounterVec + RebootUnparsableCount *prometheus.CounterVec + TimeElapsedHistograms map[string]prometheus.ObserverVec + TotalUnparsableCount *prometheus.CounterVec + func (m *Measures) AddMetadata(metadataKey string) + func (m *Measures) AddRebootUnparsable(reason string, event interpreter.Event) + func (m *Measures) AddTotalUnparsable(parserName string) + type MetadataParser struct + func (m *MetadataParser) Name() string + func (m *MetadataParser) Parse(event interpreter.Event) + type ParserValidator interface + Validate func(events []interpreter.Event, currentEvent interpreter.Event) (bool, error) + type RebootDurationParser struct + func (p *RebootDurationParser) Name() string + func (p *RebootDurationParser) Parse(currentEvent interpreter.Event) + type RebootLoggerIn struct + Logger *zap.Logger + type RebootParserConfig struct + CycleValidators []CycleValidationConfig + EventValidators []EventValidationConfig + TimeElapsedCalculations []TimeElapsedConfig + type RebootParserIn struct + Calculators []DurationCalculator + CodexClient *events.CodexClient + Logger *zap.Logger + Measures Measures + Name string + ParserValidators []ParserValidator + type RebootParserNameIn struct + Name string + type TimeElapsedConfig struct + EventType string + Name string + SessionType string + type TimeLocation int + const Birthdate + const Boottime + func ParseTimeLocation(location string) TimeLocation + type TimeValidationConfig struct + MinValidYear int + ValidFrom time.Duration + ValidTo time.Duration + type ValidatorsIn struct + EventValidator validation.Validator + LastCycleValidator history.CycleValidator + RebootCycleValidator history.CycleValidator