Movatterモバイル変換


[0]ホーム

URL:


cgrouptest

packagestandard library
go1.25.2Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License:BSD-3-ClauseImports:9Imported by:0

Details

Repository

cs.opensource.google/go/go

Links

Documentation

Overview

Package cgrouptest provides best-effort helpers for running tests inside acgroup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcInCgroupV2

func InCgroupV2(t *testing.T, fn func(*CgroupV2))

InCgroupV2 creates a new v2 cgroup, migrates the current process into it,and then calls fn. When fn returns, the current process is migrated back tothe original cgroup and the new cgroup is destroyed.

If a new cgroup cannot be created, the test is skipped.

This must not be used in parallel tests, as it affects the entire process.

Types

typeCgroupV2

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

func (*CgroupV2)CPUMaxPath

func (c *CgroupV2) CPUMaxPath()string

Path to cpu.max.

func (*CgroupV2)Path

func (c *CgroupV2) Path()string

func (*CgroupV2)SetCPUMax

func (c *CgroupV2) SetCPUMax(quota, periodint64)error

Set cpu.max. Pass -1 for quota to disable the limit.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp