hitcounter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

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

func NewClock

func NewClock() *Clock

func (*Clock) GetTime

func (c *Clock) GetTime() int32

type Direction

type Direction struct {
	Store       store.ShardMap
	Name        string
	CleanUpTime float64
	MaxHits     float64
	WindowSize  float64
}

func (*Direction) Hit

func (d *Direction) Hit(clock int32, val interface{}) bool

type HitCounter

type HitCounter struct {
	Clock *Clock
	Count *RunningCount
	*server.Server
}

func NewHitCounter

func NewHitCounter(directions []Direction) *HitCounter

type RunningCount

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

RunningCount is a counter where every increment is temporary. After the duration has passed, the counter decrements.

func NewRunningCount

func NewRunningCount(Granularity int, Duration time.Duration) *RunningCount

func (*RunningCount) Count

func (r *RunningCount) Count() uint64

func (*RunningCount) Inc

func (r *RunningCount) Inc()

Jump to

Keyboard shortcuts

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