utils

package
v0.0.0-...-46749fd Latest Latest
Warning

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

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

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

Jump to

Keyboard shortcuts

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