check_resources

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package check_resources implements the ctx system check-resources subcommand.

It collects system resource metrics (memory, swap, disk, load) and emits a warning when any resource hits danger severity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx system check-resources" subcommand.

Returns:

  • *cobra.Command: Configured check-resources subcommand

func Run

func Run(cmd *cobra.Command, stdin *os.File) error

Run executes the check-resources hook logic.

Collects system resource snapshots, evaluates alert thresholds, and emits a relay warning box when any resource is at danger level. Throttled by session pause state.

Parameters:

  • cmd: Cobra command for output
  • stdin: standard input for hook JSON

Returns:

  • error: Always nil (hook errors are non-fatal)

Types

This section is empty.

Jump to

Keyboard shortcuts

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