memory

package
v0.0.0-...-5ad81b9 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryStorage

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

func New

func New(
	maxNumStats int,
	backend storage.StorageDriver,
) *InMemoryStorage

func (*InMemoryStorage) AddStats

func (self *InMemoryStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error

func (*InMemoryStorage) Close

func (self *InMemoryStorage) Close() error

func (*InMemoryStorage) RecentStats

func (self *InMemoryStorage) RecentStats(name string, numStats int) ([]*info.ContainerStats, error)

type StatsBuffer

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

A circular buffer for ContainerStats.

func NewStatsBuffer

func NewStatsBuffer(size int) *StatsBuffer

Returns a new thread-compatible StatsBuffer.

func (*StatsBuffer) Add

func (self *StatsBuffer) Add(item *info.ContainerStats)

Adds an element to the start of the buffer (removing one from the end if necessary).

func (*StatsBuffer) FirstN

func (self *StatsBuffer) FirstN(n int) []info.ContainerStats

Returns the first N elements in the buffer. If N > size of buffer, size of buffer elements are returned.

func (*StatsBuffer) Size

func (self *StatsBuffer) Size() int

Jump to

Keyboard shortcuts

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