hourly_stats

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB added in v0.3.0

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

func NewDB added in v0.3.0

func NewDB(path string) (*DB, error)

func (*DB) Close added in v0.3.0

func (db *DB) Close() error

func (*DB) Dump added in v0.3.0

func (db *DB) Dump() error

func (*DB) Incr added in v0.3.0

func (db *DB) Incr(ref string)

func (*DB) Report added in v0.3.0

func (db *DB) Report(ref string) *Report

func (*DB) Start added in v0.3.0

func (db *DB) Start()

type Report

type Report struct {
	Total         int                `json:"total"`
	Average       float64            `json:"average"`
	HourlyAverage map[int]float64    `json:"hourly_average,omitempty"`
	LastDay       []int              `json:"last_day,omitempty"`
	Subs          map[string]*Report `json:"subs,omitempty"`
	// contains filtered or unexported fields
}

type Stats

type Stats struct {
	Data map[string]*bucket
	// contains filtered or unexported fields
}

func NewStats

func NewStats() *Stats

func NewStatsFromDump added in v0.2.0

func NewStatsFromDump(bts []byte) (*Stats, error)

func (*Stats) Dump added in v0.2.0

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

func (*Stats) Incr

func (s *Stats) Incr(ref string)

func (*Stats) Stats

func (s *Stats) Stats() *Report

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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