Documentation
¶
Overview ¶
Package fd tracks the number of file descriptors used on the host.
Index ¶
Constants ¶
View Source
const ( Name = "file-descriptor" // DefaultThresholdAllocatedFileHandles is some high number, in case the system is under high file descriptor usage. DefaultThresholdAllocatedFileHandles = 10000000 // DefaultThresholdRunningPIDs is some high number, in case fd-max is unlimited DefaultThresholdRunningPIDs = 900000 WarningFileHandlesAllocationPercent = 80.0 ErrFileHandlesAllocationExceedsWarning = "file handles allocation exceeds its threshold (80%)" )
Variables ¶
This section is empty.
Functions ¶
func HasVFSFileMaxLimitReached ¶ added in v0.4.4
Returns true if the line indicates that the file-max limit has been reached. ref. https://docs.kernel.org/admin-guide/sysctl/fs.html#file-max-file-nr
func New ¶
func New(ctx context.Context, eventStore eventstore.Store) (components.Component, error)
Types ¶
type Data ¶ added in v0.4.5
type Data struct {
// The number of file descriptors currently allocated on the host (not per process).
AllocatedFileHandles uint64 `json:"allocated_file_handles"`
// The number of running PIDs returned by https://pkg.go.dev/github.com/shirou/gopsutil/v4/process#Pids.
RunningPIDs uint64 `json:"running_pids"`
Usage uint64 `json:"usage"`
Limit uint64 `json:"limit"`
// AllocatedFileHandlesPercent is the percentage of file descriptors that are currently allocated,
// based on the current file descriptor limit and the current number of file descriptors allocated on the host (not per process).
AllocatedFileHandlesPercent string `json:"allocated_file_handles_percent"`
// UsedPercent is the percentage of file descriptors that are currently in use,
// based on the current file descriptor limit on the host (not per process).
UsedPercent string `json:"used_percent"`
ThresholdAllocatedFileHandles uint64 `json:"threshold_allocated_file_handles"`
ThresholdAllocatedFileHandlesPercent string `json:"threshold_allocated_file_handles_percent"`
ThresholdRunningPIDs uint64 `json:"threshold_running_pids"`
ThresholdRunningPIDsPercent string `json:"threshold_running_pids_percent"`
// Set to true if the file handles are supported.
FileHandlesSupported bool `json:"file_handles_supported"`
// Set to true if the file descriptor limit is supported.
FDLimitSupported bool `json:"fd_limit_supported"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.