package utils
import "github.com/google/cadvisor/utils"
Index ¶
- func FileExists(file string) bool
- func FixCpuMask(mask string, cores int) string
- type TimedStore
- func NewTimedStore(age time.Duration, maxItems int) *TimedStore
- func (self *TimedStore) Add(timestamp time.Time, item interface{})
- func (self *TimedStore) Get(index int) interface{}
- func (self *TimedStore) InTimeRange(start, end time.Time, maxResults int) []interface{}
- func (self *TimedStore) Size() int
Functions ¶
func FileExists ¶
func FixCpuMask ¶
Returns a mask of all cores on the machine if the passed-in mask is empty.
Types ¶
type TimedStore ¶
type TimedStore struct {
// contains filtered or unexported fields
}
A time-based buffer for ContainerStats. Holds information for a specific time period and/or a max number of items.
func NewTimedStore ¶
func NewTimedStore(age time.Duration, maxItems int) *TimedStore
Returns a new thread-compatible TimedStore. A maxItems value of -1 means no limit.
func (*TimedStore) Add ¶
func (self *TimedStore) Add(timestamp time.Time, item interface{})
Adds an element to the start of the buffer (removing one from the end if necessary).
func (*TimedStore) Get ¶
func (self *TimedStore) Get(index int) interface{}
Gets the element at the specified index. Note that elements are output in LIFO order.
func (*TimedStore) InTimeRange ¶
func (self *TimedStore) InTimeRange(start, end time.Time, maxResults int) []interface{}
Returns up to maxResult elements in the specified time period (inclusive). Results are from first to last. maxResults of -1 means no limit.
func (*TimedStore) Size ¶
func (self *TimedStore) Size() int
Source Files ¶
path.go timed_store.go utils.go
Directories ¶
Path | Synopsis |
---|---|
utils/cloudinfo | |
utils/container | |
utils/cpuload | |
utils/cpuload/netlink | |
utils/cpuload/netlink/example | |
utils/docker | |
utils/oomparser | |
utils/oomparser/oomexample | |
utils/procfs | procfs contains several low level functions to read information from /proc filesystem, and also provides some utility functions like JiffiesToDuration. |
utils/sysfs | |
utils/sysfs/fakesysfs | |
utils/sysinfo | |
utils/tail | Package tail implements "tail -F" functionality following rotated logs |
- Version
- v0.33.0
- Published
- Feb 27, 2019
- Platform
- darwin/amd64
- Imports
- 4 packages
- Last checked
- 1 day ago –
Tools for package owners.