stats

package
v0.0.0-...-699cd24 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2015 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContainerName = "/cfs"
)

The recommended way to run cfs is putting the process in an exclusive container, which has its own cgroup in each hierarchy. It helps cfs to monitor its resource usage.

It asks users to specify container name instead of detecting cgroup that has the process automatically because it may meet strange cases: 1. cfs process may be in different cpu/memory/etc cgroups 2. the cgroup that includes cfs may have other processes So it hopes that user could take care of it.

Variables

This section is empty.

Functions

func ClientCounterName

func ClientCounterName(id int64) string

func ParseClientCounterName

func ParseClientCounterName(name string) (int64, error)

func Report

func Report(sinker Sinker, interval time.Duration)

If sinker is nil, it will use default sinker. Default sinker just print counters by log.

func Server

func Server() pb.StatsServer

func SetContainerName

func SetContainerName(name string)

Types

type CounterType

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

func Counter

func Counter(disk, op string) *CounterType

func (*CounterType) Add

func (c *CounterType) Add()

func (*CounterType) Client

func (c *CounterType) Client(id int64) *CounterType

type InfluxConfig

type InfluxConfig struct {
	Address  string // host:port
	Username string
	Password string
	Database string
}

type Sinker

type Sinker interface {
	Sink(counters map[string]uint64, dur time.Duration)
}

func NewInfluxSinker

func NewInfluxSinker(conf InfluxConfig) (Sinker, error)

Jump to

Keyboard shortcuts

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