Documentation ¶
Overview ¶
Package utils are utilities for system-probe
Index ¶
Constants ¶
View Source
const DefaultMaxConcurrentRequests = 2
DefaultMaxConcurrentRequests determines the maximum number of requests in-flight for a given handler We choose 2 because one is for regular agent checks and another one is for manual troubleshooting
Variables ¶
This section is empty.
Functions ¶
func WithConcurrencyLimit ¶
func WithConcurrencyLimit(limit int, original func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
WithConcurrencyLimit enforces a maximum number of concurrent requests over a certain HTTP handler function
func WriteAsJSON ¶
func WriteAsJSON(w http.ResponseWriter, data interface{})
WriteAsJSON marshals the give data argument into JSON and writes it to the `http.ResponseWriter`
Types ¶
type MemoryMonitor ¶
type MemoryMonitor = cgroups.MemoryController
MemoryMonitor monitors cgroups' memory usage
func NewMemoryMonitor ¶
func NewMemoryMonitor(kind string, containerized bool, pressureLevels map[string]string, thresholds map[string]string) (*MemoryMonitor, error)
NewMemoryMonitor instantiates a new memory monitor
Click to show internal directories.
Click to hide internal directories.