arc

package
v0.0.0-...-9474aff Latest Latest
Warning

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

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

Documentation

Overview

Package arc contains test helpers for determining if memory is low in ARC.

Index

Constants

View Source
const (
	KiBInMiB = 1024
)

memDetailPercentage defines how much % of PSS consumption will be listed in details in metrics.

Variables

This section is empty.

Functions

func DumpsysMeminfo

func DumpsysMeminfo(ctx context.Context, a *arc.ARC, outdir string) error

DumpsysMeminfo writes the results of `adb shell dumpsys meminfo` to arc.meminfo.log in outdir.

func NewPageReclaimLimit

func NewPageReclaimLimit(a *arc.ARC) *memory.ZoneInfoLimit

NewPageReclaimLimit creates a memory.Limit that measures if ARC is reclaiming pages and is near to OOMing.

func ReportDumpsysMeminfoMetrics

func ReportDumpsysMeminfoMetrics(vmSummary *VMSummary, p *perf.Values, suffix string)

ReportDumpsysMeminfoMetrics outputs a set of representative metrics into the supplied performance data dictionary.

func VMStatMetrics

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

VMStatMetrics writes the contents of `/proc/vmstat` to outdir. If outdir is "", then no logs are written. If p is provided, it adds the following metrics:

  • arcvm_virtio_balloon - The size of the virtio_balloon, in bytes.

Types

type SliceToPssMap

type SliceToPssMap map[string]uint64

SliceToPssMap maps a slice of processes/categories into a Pss memory metric.

type VMSummary

type VMSummary struct {
	UsedPss          uint64
	KernelPss        uint64
	CachedKernel     uint64
	CachedPss        uint64
	CategoryPss      SliceToPssMap
	ProcessPss       SliceToPssMap
	DetailedPssUsage uint64
	FreeRAM          int64
	LostRAM          int64
}

VMSummary holds overall information on metrics from a VM. All values in Kilobytes.

func GetDumpsysMeminfoMetrics

func GetDumpsysMeminfoMetrics(ctx context.Context, a *arc.ARC, outdir, suffix string) (*VMSummary, error)

GetDumpsysMeminfoMetrics parses several key metrics from the output of `dumpsys meminfo` into the returned VMSummary struct, including PSS metrics grouped per app and per category. The raw `dumpsys meminfo` text is additionally written to a file for debug purposes - provided that outdir is not empty.

Jump to

Keyboard shortcuts

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