stats

package
v0.0.0-...-901b40b Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package stats provides functions to collect statistics about the import process.

Index

Constants

View Source
const (
	RESET = iota
	START
	STOP
	QUIT
)

Variables

This section is empty.

Functions

func MemProfiler

func MemProfiler(dir string, interval time.Duration)

func StartHttpPProf

func StartHttpPProf(bind string)

Types

type Counter

type Counter struct {
	Coords    *RpsCounter
	Nodes     *RpsCounter
	Ways      *RpsCounter
	Relations *RpsCounter
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter() *Counter

func NewCounterWithEstimate

func NewCounterWithEstimate(counts ElementCounts) *Counter

func (*Counter) CurrentCount

func (c *Counter) CurrentCount() *ElementCounts

Duration returns the duration since start with seconds precission.

func (*Counter) Duration

func (c *Counter) Duration() time.Duration

Duration returns the duration since start with seconds precission.

func (*Counter) PrintStats

func (c *Counter) PrintStats()

func (*Counter) PrintTick

func (c *Counter) PrintTick()

func (*Counter) Tick

func (c *Counter) Tick()

type ElementCount

type ElementCount struct {
	Current int64
	Total   int64
	Rps     float64
	LastRps float64
}

type ElementCounts

type ElementCounts struct {
	Coords, Nodes, Ways, Relations ElementCount
}

type RpsCounter

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

func NewRpsCounter

func NewRpsCounter() *RpsCounter

func (*RpsCounter) Add

func (r *RpsCounter) Add(n int)

func (*RpsCounter) Count

func (r *RpsCounter) Count() ElementCount

func (*RpsCounter) LastRps

func (r *RpsCounter) LastRps() float64

func (*RpsCounter) Progress

func (r *RpsCounter) Progress() float64

func (*RpsCounter) Rps

func (r *RpsCounter) Rps() float64

func (*RpsCounter) Tick

func (r *RpsCounter) Tick()

func (*RpsCounter) Value

func (r *RpsCounter) Value() int64

type Statistics

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

func NewStatsReporter

func NewStatsReporter() *Statistics

func NewStatsReporterWithEstimate

func NewStatsReporterWithEstimate(counts *ElementCounts) *Statistics

func (*Statistics) AddCoords

func (s *Statistics) AddCoords(n int)

func (*Statistics) AddNodes

func (s *Statistics) AddNodes(n int)

func (*Statistics) AddRelations

func (s *Statistics) AddRelations(n int)

func (*Statistics) AddWays

func (s *Statistics) AddWays(n int)

func (*Statistics) Stop

func (s *Statistics) Stop() *ElementCounts

Jump to

Keyboard shortcuts

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