ResourceReport#
Run commands and agent-written programs inside an operating-system boundary. See the guide.
- class zett_agent.sandbox.resources.ResourceReport(memory='none', cpu_seconds='none', cpu_percent='none', processes='none', file_size_bytes='none', open_files='none', core_dumps='none', peak_memory_bytes=None, limits_hit=(), warnings=())[源代码]#
How each requested limit is enforced, and what a run measured.
- 参数:
memory (str)
cpu_seconds (str)
cpu_percent (str)
processes (str)
file_size_bytes (str)
open_files (str)
core_dumps (str)
peak_memory_bytes (int | None)
limits_hit (tuple[str, ...])
warnings (tuple[str, ...])
- memory#
cgroup,rlimit_as,watchdogornone.- Type:
str
- cpu_seconds#
rlimitornone.- Type:
str
- cpu_percent#
cgroupornone.- Type:
str
- processes#
cgroup,rlimitornone.- Type:
str
- file_size_bytes#
rlimitornone.- Type:
str
- open_files#
rlimitornone.- Type:
str
- core_dumps#
rlimitornone.- Type:
str
- peak_memory_bytes#
Highest memory seen, when the mechanism measures it.
- Type:
int | None
- limits_hit#
Limits the process reached:
memory,cpuorfile_size. A limit the kernel reports by killing the process is read from the signal that ended it, so a program that catches or ignores that signal (a Python process ignoresSIGXFSZ, for instance) instead sees the operation fail and this stays empty.- Type:
tuple[str, ...]
- warnings#
Limits that were asked for and cannot be enforced on this machine, and any that were lowered to the machine's own ceiling.
- Type:
tuple[str, ...]
- FIELDS: ClassVar[tuple[str, ...]] = ('memory', 'cpu_seconds', 'cpu_percent', 'processes', 'file_size_bytes', 'open_files', 'core_dumps')#
Report field for each limit a caller can set on
ResourceLimits.
- property mechanisms: dict[str, str]#
How each limit stands, by report field name, including
noneandwatchdog.