metrics

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package metrics implements a unified shell to access various kinds of memory metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogMemoryStats

func LogMemoryStats(ctx context.Context, base *BaseMemoryStats, a *arc.ARC, p *perf.Values, outdir, suffix string) error

LogMemoryStats generates log files detailing the memory from the following: * smaps_rollup per process. * fincore per file used as a disk by crsovm. * zram compressed swap memory use and zram overall usage stats. * Android adb dumpsys meminfo. * PSI memory metrics. If p != nil, summaries are added as perf.Values. Parameter base is optional - when specified, metrics are computed as a delta from the base snapshot til "now" (where possible).

func LogMemoryStatsSlice

func LogMemoryStatsSlice(begin, end *BaseMemoryStats, p *perf.Values, suffix string)

LogMemoryStatsSlice generates metrics for a time slice covering the difference between the latest snapshots passed in the begin and end memory stat sets. This is useful for dumping metrics covering a rolling time slice, and is only done for the metrics where "delta" makes sense.

func ReportSummaryMetrics

func ReportSummaryMetrics(vmEnabled bool, hostSummary *memory.HostSummary, vmSummary *memoryarc.VMSummary, zramSummary *memory.ZramSummary, p *perf.Values, suffix string)

ReportSummaryMetrics combines metrics taken from various sources, computes and logs aggregate metrics.

Types

type BaseMemoryStats

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

BaseMemoryStats holds initial metrics, which can be used as a baseline for ever-growing metrics (snapshot early in the test, subtract at the end).

func NewBaseMemoryStats

func NewBaseMemoryStats(ctx context.Context, arc *arc.ARC) (*BaseMemoryStats, error)

NewBaseMemoryStats gathers data on ever-growing metrics, so that they can be a baseline to subtract from the same metrics at a later time. A test will ideally perform this sequence:

base := metrics.NewBaseMemoryStats()
..run the test..
metrics.LogMemoryStats( ..., base, ...)

func (*BaseMemoryStats) Clone

func (base *BaseMemoryStats) Clone() *BaseMemoryStats

Clone creates a deep copy of the provided pointer.

func (*BaseMemoryStats) Reset

func (base *BaseMemoryStats) Reset() error

Reset sets the base metrics values to "now", so they can be a new baseline reflecting the time of "now".

type MemoryStatsSnapshot

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

MemoryStatsSnapshot has one snapshot of resettable memory stats.

func (*MemoryStatsSnapshot) Clone

Clone creates a deep copy of the provided pointer.

Jump to

Keyboard shortcuts

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