auto

package
v4.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package auto does automatic detection and runtime configuration for certain environments.

All top-level functions are not safe to call concurrently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPU

func CPU()

CPU guesses a good number for GOMAXPROCS based on information gleaned from the current process's cgroup.

func Memory added in v4.6.0

func Memory()

Memory sets the runtime's memory limit based on information gleaned from the current process's cgroup. See debug.SetMemoryLimit for details on the effects of setting the limit. This does mean that attempting to run Clair in an aggressively constrained environment may cause excessive CPU time spent in garbage collection. Excessive GC can be prevented by increasing the resources allowed or pacing Clair as a whole by reducing the CPU allocation or limiting the number of concurrent requests.

The process' "memory.max" limit (for cgroups v2) or "memory.limit_in_bytes" (for cgroups v1) are the values consulted.

func PrintLogs

func PrintLogs(ctx context.Context)

PrintLogs uses zlog to report any messages queued up from the runs of functions since the last call to PrintLogs.

func Profiling added in v4.7.0

func Profiling()

Profiling enables block and mutex profiling.

This function uses the magic environment variable "CLAIRDEBUG" to control the values used. This escape hatch will go away in the future.

Types

This section is empty.

Jump to

Keyboard shortcuts

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