counter

package module
v0.0.0-...-b8fec64 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 4 Imported by: 0

README

counter

Build Status Coverage Status MIT License GoDoc

counter short description

Synopsis

// simple usage here

Description

Installation

% go get github.com/Songmu/counter

Author

Songmu

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

func (*Counter) Add

func (c *Counter) Add(delta uint64)

Add counter

func (*Counter) Count

func (c *Counter) Count() uint64

Count returns the counter

func (*Counter) Incr

func (c *Counter) Incr()

Incr shortcut of Add(1)

func (*Counter) String

func (c *Counter) String() string

String for stringer and expvar.Var

func (*Counter) Value

func (c *Counter) Value() uint64

Value is alias method of Count

type Observer

type Observer struct {
	*Counter
	// contains filtered or unexported fields
}

func (*Observer) Delta

func (o *Observer) Delta() (delta uint64, lastObservedAt, now time.Time)

Jump to

Keyboard shortcuts

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