Documentation ¶
Overview ¶
Package arc contains test helpers for determining if memory is low in ARC.
Index ¶
- Constants
- func DumpsysMeminfo(ctx context.Context, a *arc.ARC, outdir string) error
- func NewPageReclaimLimit(a *arc.ARC) *memory.ZoneInfoLimit
- func ReportDumpsysMeminfoMetrics(vmSummary *VMSummary, p *perf.Values, suffix string)
- func VMStatMetrics(ctx context.Context, a *arc.ARC, p *perf.Values, outdir, suffix string) error
- type SliceToPssMap
- type VMSummary
Constants ¶
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 ¶
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 ¶
ReportDumpsysMeminfoMetrics outputs a set of representative metrics into the supplied performance data dictionary.
func VMStatMetrics ¶
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 ¶
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.