stats

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Idle    state = "idle"
	Running state = "running"
	Failed  state = "failed"
)
View Source
const (
	Launched increment = iota
	Scheduled
	Ignored
	Probing
	New
	Timeout
	Blacklisted
	Found
	Finished
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Sources

type Sources map[int]Stat

func (Sources) IsRunning

func (s Sources) IsRunning(source int) bool

func (Sources) LastUpdated

func (s Sources) LastUpdated() (last time.Time)

type Stat

type Stat struct {
	Name     string `json:",omitempty"` // TODO: this is a hack?...
	State    state
	Progress int

	Scheduled   int
	New         int
	Probing     int
	Found       int
	Timeouts    int
	Blacklisted int
	Ignored     int
	Updated     time.Time

	Failure string
	// contains filtered or unexported fields
}

func (Stat) Pipeline

func (v Stat) Pipeline() int

func (Stat) Processed

func (v Stat) Processed() int

type Stats

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

func NewStats

func NewStats() *Stats

func (*Stats) Finish

func (s *Stats) Finish(source int, err error)

func (*Stats) HttpGet

func (s *Stats) HttpGet(_ *http.Request) (interface{}, error)

func (*Stats) Launch

func (s *Stats) Launch(source int)

func (*Stats) LaunchAnticipated

func (s *Stats) LaunchAnticipated(source, count int)

func (*Stats) MarshalBinary

func (s *Stats) MarshalBinary() ([]byte, error)

func (*Stats) Snapshot

func (s *Stats) Snapshot() Sources

func (*Stats) Start

func (s *Stats) Start(ctx app.Context)

func (*Stats) UnmarshalBinary

func (s *Stats) UnmarshalBinary(data []byte) error

func (*Stats) Update

func (s *Stats) Update(source int, state increment)

Jump to

Keyboard shortcuts

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