2025-11-13T10:28:11.341837

denet, a lightweight command-line tool for process monitoring in benchmarking and beyond

Carrillo, Mallona
Summary: denet is a lightweight process monitoring utility providing real-time resource profiling of running processes. denet reports CPU, memory, disk I/O, network activity, and thread usage, including recursive child monitoring, with adaptive sampling rates. It offers both a command-line interface (CLI) with colorized outputs and a Python API for inclusion in other software. Its output formats are structured as either JSON, JSONL, or CSV, and include performance metrics as well as process metadata, including PID and the executed command. The easy to parse profiling results make denet suitable for benchmarking, debugging, monitoring, and optimizing data-intensive pipelines in bioinformatics and other fields. Availability and implementation: denet is open-source software released under the GPLv3 license and maintained at https://github.com/btraven00/denet. It is implemented in Rust, with Python bindings provided via maturin, and can be installed from Cargo (cargo install denet) or PyPI (pip install denet). Most functionality does not require administrative privileges, enabling use on cloud platforms, HPC clusters, and standard Linux workstations. Certain advanced features, such as eBPF support, may require elevated permissions. Documentation, including usage examples and API references, is provided.
academic

denet, a lightweight command-line tool for process monitoring in benchmarking and beyond

Basic Information

  • Paper ID: 2510.13818
  • Title: denet, a lightweight command-line tool for process monitoring in benchmarking and beyond
  • Authors: Ben Carrillo, Izaskun Mallona (Department of Molecular Life Sciences, University of Zurich and Swiss Institute of Bioinformatics)
  • Classification: cs.PF (Computer Science - Performance)
  • Publication Date: September 24, 2024 (arXiv preprint)
  • Paper Link: https://arxiv.org/abs/2510.13818

Abstract

denet is a lightweight process monitoring tool that provides real-time resource analysis of running processes. The tool reports CPU, memory, disk I/O, network activity, and thread usage, including recursive subprocess monitoring and adaptive sampling rates. It offers a command-line interface (CLI) with colored output and a Python API for integration into other software. Output formats support structured formats such as JSON, JSONL, and CSV, containing performance metrics and process metadata. The easily parsable analysis results make denet particularly suitable for benchmarking, debugging, monitoring, and optimizing data-intensive pipelines in bioinformatics and other fields.

Research Background and Motivation

Problem Definition

During bioinformatics tool development and performance optimization, fine-grained resource analysis data (CPU and memory usage, disk and network I/O) is needed to guide optimization at multiple levels: code improvement, execution parameter tuning, and overall workflow design.

Limitations of Existing Methods

  1. System-level analyzers (such as top, htop) lack process specificity, making it difficult to isolate the resource footprint of individual jobs
  2. Process summary tools (such as time) only report cumulative totals upon completion, missing real-time dynamics that typically indicate bottlenecks
  3. Unstructured output: The text output of existing tools is designed for interactive use and is unsuitable for automated parsing
  4. Workflow system integration difficulties: Resource analysis provided by major workflow systems (make, snakemake, nextflow) is either missing, coarse-grained, or not customizable

Research Motivation

Develop a new monitoring toolkit that can be used both interactively on the command line and embedded in scripts and workflow managers to meet the needs of modern bioinformatics workflows and benchmarking.

Core Contributions

  1. Adaptive sampling strategy: Innovatively provides a dynamic sampling frequency adjustment mechanism based on process runtime
  2. Comprehensive resource monitoring: Supports integrated monitoring of CPU, memory, GPU, disk I/O, network activity, and thread counts
  3. eBPF support: Experimental support for extended Berkeley Packet Filter, providing low-overhead kernel-level event tracing
  4. Dual interface design: Provides both CLI and Python API usage modes to meet different scenario requirements
  5. Structured output: Supports easily parsable output formats including JSON, JSONL, and CSV
  6. Recursive process tree monitoring: Capable of tracking and reporting parent processes and all their subprocesses

Methodology Details

Task Definition

The core task of denet is to provide real-time, structured process resource monitoring, with input being the process or command to be monitored and output being a structured report containing detailed performance metrics and metadata.

Architecture Design

Modular Rust Architecture

denet employs a modular Rust implementation containing the following core modules:

  1. core module: Responsible for low-level system interaction and reading sampling data from the Linux /proc filesystem
  2. config module: Manages user input (sampling interval, monitoring options, output options, etc.)
  3. error module: Handles exceptions and error management
  4. cpu-sampler module: Measures CPU time, similar to implementations in top and htop
  5. Python module: Contains PyO3 bindings that expose the Rust API to Python

Adaptive Sampling Algorithm

This is the main innovation point of denet:

  • Initial phase (0-1 second): Samples at the highest frequency (e.g., every 100ms) to ensure fine-grained resolution capturing process startup and transient activity peaks
  • Transition phase (1-10 seconds): Sampling rate gradually decreases to the maximum interval provided by the user
  • Stable phase (>10 seconds): Maintains the maximum interval sampling rate, minimizing system overhead for long-running tasks

Monitoring Metrics

  1. CPU usage: Aggregated and per-core statistics, following conventions in top/htop on POSIX systems
  2. Memory usage: Reports RSS and VMS separately, providing peak usage, swap events, and potential memory leak information
  3. GPU monitoring: Includes GPU memory usage and usage percentage (requires NVIDIA Management Library NVML)
  4. Disk I/O: Bytes read and written per interval
  5. Thread count: Tracks thread count and number of subprocesses spawned from the parent process
  6. Exit status: Monitors parent process exit code
  7. Metadata logging: Reports complete command, executable path, PID, runtime duration, and analysis strategy

eBPF Support

eBPF functionality implemented through BCC provides:

  • Off-CPU time quantification: Analyzes the distribution of application waiting time
  • Namespace awareness: Precise and efficient analysis of containerized processes
  • Low-overhead monitoring: Avoids expensive context switches and kernel-user space data transfers

Experimental Setup

Comparative Analysis

The paper validates denet's advantages through functional comparison with existing tools:

ToolAdaptive SamplingProgramming APIRecursive Process TreeStructured OutputeBPF SupportGPU Monitoring
top/htopPartial
ps
time
pidstatPartial
psutil/psrecordPartial
bpftrace
denet

Use Case Validation

The paper demonstrates the tool's practicality and ease of use through detailed CLI and API usage examples.

Experimental Results

Functional Verification

The paper demonstrates denet's various capabilities through concrete usage examples:

CLI Usage Examples

# Real-time process monitoring
denet run sleep 5

# Generate JSON format report
denet --json run sleep 5 > metrics.json

# Adjust sampling interval
denet --interval 500 run sleep 5

# Adaptive sampling mode
denet --max-interval 2000 run sleep 5

# Monitor existing process
denet attach 1234

# Time-limited monitoring
denet --duration 10 attach 1234

Python API Examples

import denet

monitor = denet.ProcessMonitor(
    cmd=["python", "-c", "import time; time.sleep(10)"],
    base_interval_ms=100,
    max_interval_ms=1000,
    store_in_memory=True,
    include_children=True
)

monitor.run()
samples = monitor.get_samples()
summary_json = monitor.get_summary()

Technical Advantage Verification

  1. Adaptive sampling: Provides high-resolution monitoring for short-term tasks while minimizing overhead for long-term tasks
  2. Structured output: Supports JSON, JSONL, and CSV formats for easy automated processing
  3. Cross-platform compatibility: Primarily designed for Linux, with potential macOS support through native APIs
  4. Permission-friendly: Most features do not require administrator privileges, suitable for cloud platforms, HPC clusters, and standard Linux workstations

Traditional Monitoring Tools

  • System-level tools: top, htop, ps, etc., primarily used for interactive system monitoring
  • Process-level tools: time, pidstat, etc., providing process-level statistics but with limited functionality
  • Programming libraries: psutil, psrecord, etc., providing programming interfaces but lacking advanced features

Modern Monitoring Technologies

  • eBPF tools: bpftrace, bpftime, etc., providing kernel-level monitoring capabilities
  • Container monitoring: Specialized tools for containerized environments such as Docker and Kubernetes

Workflow Systems

  • make, snakemake, nextflow: Mainstream workflow management systems with limited resource monitoring capabilities

Conclusions and Discussion

Main Conclusions

denet successfully fills the gap in existing process monitoring tools, particularly addressing application needs in the bioinformatics field. Its adaptive sampling, eBPF support, and dual interface design provide significant advantages among similar tools.

Limitations

  1. Platform constraints: Primarily designed for Linux systems with limited support for other operating systems
  2. Permission requirements: Some advanced features (such as eBPF) require elevated privileges
  3. Kernel dependencies: eBPF support requires Linux 4.x or higher kernel versions

Future Directions

  1. Extend cross-platform support
  2. Enhance monitoring capabilities for containerized environments
  3. Improve GPU monitoring functionality
  4. Optimize memory usage for long-running tasks

In-Depth Evaluation

Strengths

  1. Innovative adaptive sampling: Addresses efficiency issues of traditional fixed-interval sampling
  2. Comprehensive feature integration: Integrates multiple monitoring capabilities in a single tool
  3. Practical interface design: Dual CLI and API interfaces meet different user needs
  4. Open source and easy installation: GPLv3 license with support for Cargo and PyPI installation
  5. Comprehensive documentation: Provides detailed usage examples and API references

Weaknesses

  1. Limited experimental validation: Lacks large-scale performance benchmarks and quantitative comparisons with other tools
  2. Experimental eBPF functionality: Some advanced features remain experimental
  3. Incomplete platform coverage: Primarily supports Linux, limiting application scope

Impact

  1. Fills tool gap: Provides a specialized solution for bioinformatics workflow monitoring
  2. Promotes standardization: Structured output formats help establish standards for monitoring data
  3. Facilitates automation: Enables integration into automated workflows and benchmarking frameworks

Applicable Scenarios

  1. Bioinformatics pipelines: Particularly suitable for data-intensive bioinformatics workflows
  2. Performance benchmarking: Provides detailed data for software performance evaluation
  3. Containerized environments: Supports container monitoring through eBPF
  4. HPC clusters: Applicable to job monitoring in high-performance computing environments
  5. Development debugging: Helps developers identify performance bottlenecks

References

The paper cites important works in related fields, including:

  1. Literature on eBPF performance tools
  2. Research on Linux kernel eBPF runtime
  3. Applications of eBPF in large-scale industrial systems
  4. Related open-source projects (BCC, bpftrace, psutil, etc.)

Overall Assessment: This is a highly practical tool paper. denet successfully addresses the actual needs of process monitoring in the bioinformatics field. While relatively limited in theoretical innovation, its adaptive sampling mechanism and comprehensive feature integration have significant practical value. The tool's open-source nature and comprehensive documentation position it for widespread adoption in relevant fields.