chronologger

Crates.iochronologger
lib.rschronologger
version1.0.1
sourcesrc
created_at2024-06-18 19:54:39.01471
updated_at2024-06-18 20:03:09.887865
descriptionWrites process CPU and memory usage to a CSV file
homepagehttps://github.com/the-chronomancer/chronologger
repositoryhttps://github.com/the-chronomancer/chronologger
max_upload_size
id1275899
size35,214
Jacob Coleman (the-chronomancer)

documentation

README

ChronoLogger

Rust clippy rustfmt tests license: MIT

Table of Contents

Overview

ChronoLogger is a Rust command-line tool designed to log CPU and memory usage of processes to a CSV file at regular intervals.

Features

  • CSV Writing: Writes process information including timestamp, PID, process name, CPU usage, and memory usage.
  • Configurable Interval: Set the logging interval in seconds.
  • Configurable Duration: Set the maximum duration to run the logger.
  • Signal Handling: Gracefully handles termination signals (SIGINT, SIGTERM).

Requirements

  • Rust 1.79+

Installation

  1. Ensure Rust 1.56 or higher is installed on your system.
  2. Install the crate from crates.io:
cargo install chronologger

Usage

Run the application from the command line. Default values will be used if no arguments are provided.

chronologger

You can also specify the desired parameters. For example:

chronologger --interval 2 --output custom_output.csv --duration 120

Command-Line Arguments

  • -i, --interval: Sets the logging interval in seconds. Default: 1
  • -o, --output: Sets the output CSV file. Default: 'process_usage.csv'
  • -d, --duration: Sets the maximum duration to run in seconds. Default: 60

Examples

Default Parameters

Run ChronoLogger with default parameters. This will write process information every second for 60 seconds and save it to process_usage.csv.

chronologger

Custom Interval and Output File

Write process information every 2 seconds for 120 seconds and save it to custom_output.csv.

chronologger --interval 2 --output custom_output.csv --duration 120

Short Duration

Write process information for 10 seconds.

chronologger --duration 10

License

This software is released under the MIT License.

Contact

For support or contributions, please contact Jacob Coleman.

Commit count: 4

cargo fmt