All Projects → turova → rh

turova / rh

Licence: MIT license
Resource Harvester - a tool to gather low-level system data and make it easy to use programmatically

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to rh

audria
audria - A Utility for Detailed Ressource Inspection of Applications
Stars: ✭ 35 (+94.44%)
Mutual labels:  cpu-monitoring, memory-monitoring
cpu monitor
ROS node that publishes all nodes' CPU and memory usage
Stars: ✭ 52 (+188.89%)
Mutual labels:  cpu-monitoring, memory-monitoring
Libuwsc
A Lightweight and fully asynchronous WebSocket client library based on libev
Stars: ✭ 237 (+1216.67%)
Mutual labels:  lightweight
hugoblog
Hugoblog is responsive, simple, and clean that would fit for your personal blog based on Hugo Theme Static Site Generator (SSG)
Stars: ✭ 48 (+166.67%)
Mutual labels:  lightweight
Api
Minimal, extremely fast, lightweight Ruby framework for HTTP APIs
Stars: ✭ 252 (+1300%)
Mutual labels:  lightweight
Task Easy
A simple, customizable, and lightweight priority queue for promises.
Stars: ✭ 244 (+1255.56%)
Mutual labels:  lightweight
Pareto.js
An extremely small, intuitive and fast functional utility library for JavaScript
Stars: ✭ 254 (+1311.11%)
Mutual labels:  lightweight
V Emoji Picker
🌟 A Lightweight and customizable package of Emoji Picker in Vue using emojis natives (unicode).
Stars: ✭ 231 (+1183.33%)
Mutual labels:  lightweight
lightcookie
Node cookie parsing and serialization
Stars: ✭ 22 (+22.22%)
Mutual labels:  lightweight
Yay Evil Emacs
😈 A lightweight literate Emacs config with even better "better defaults". Shipped with a custom theme!
Stars: ✭ 250 (+1288.89%)
Mutual labels:  lightweight
ThreadPool2
Lightweight, Generic, Pure C++11 ThreadPool
Stars: ✭ 28 (+55.56%)
Mutual labels:  lightweight
Pine
A modern, native macOS markdown editor
Stars: ✭ 2,818 (+15555.56%)
Mutual labels:  lightweight
Libaco
A blazing fast and lightweight C asymmetric coroutine library 💎 ⛅🚀⛅🌞
Stars: ✭ 2,918 (+16111.11%)
Mutual labels:  lightweight
Moveto
A lightweight scroll animation javascript library without any dependency
Stars: ✭ 2,746 (+15155.56%)
Mutual labels:  lightweight
Quick Picture Viewer
🖼️ Lightweight, versatile desktop image viewer for Windows. The best replacement for the default Windows photo viewer.
Stars: ✭ 237 (+1216.67%)
Mutual labels:  lightweight
string-combinations
A simple, low-memory footprint function to generate all string combinations from a series of characters.
Stars: ✭ 25 (+38.89%)
Mutual labels:  lightweight
Herbe
Daemon-less notifications without D-Bus. Minimal and lightweight.
Stars: ✭ 235 (+1205.56%)
Mutual labels:  lightweight
Gunslinger
C99, header-only framework for games and multimedia applications
Stars: ✭ 246 (+1266.67%)
Mutual labels:  lightweight
Yalla
YallaJS, ES6 Templating Engine.
Stars: ✭ 253 (+1305.56%)
Mutual labels:  lightweight
Lucid-Browser
Source code for Lucid browser on Play Store
Stars: ✭ 103 (+472.22%)
Mutual labels:  lightweight

rh

Resource Harvester - a tool to gather low-level system data and make it easy to use programmatically

OVERVIEW

This tool allows a user to gather system data and output it in a way that's easy to process programmatically. It is extensible for both input modules and output modules, allowing a user to add new input data and to add new output formats. The motivation for this tool was the lack of consistent output in tools such as top and dstat. Some example use cases include saving a TSV log and plotting the time-series data or piping data into Fluentd.

USAGE

$ git clone [email protected]:turova/rh.git
# ...
$ cd rh
$ ./rh -h
usage: rh [-h] [-l] [-i INPUTS [INPUTS ...]] [-o OUTPUTS] [-t INTERVAL]

Resource Harvester

optional arguments:
  -h, --help            show this help message and exit
  -l, --list            List all available modules and their descriptions
  -i INPUTS [INPUTS ...], --inputs INPUTS [INPUTS ...]
                        Space-separated list of input modules to use
  -o OUTPUTS, --outputs OUTPUTS
                        Output module to use (default is JSON). Currently,
                        only 1 output is supported
  -t INTERVAL, --interval INTERVAL
                        Number of seconds between harvest/print cycles

USAGE EXAMPLES

$ ./rh # Default output is timestamp, cpu, and mem in JSON output format
{ "timestamp": "1524689668260", "cpu": "10", "mem": "10997148"}
{ "timestamp": "1524689669262", "cpu": "18", "mem": "10998020"}
# Print tab-separated list of timestamp and cpu values every half a second
$ ./rh -t .5 -i timestamp cpu -o tsv
1524689587554	0
1524689588055	11
1524689588557	5
1524689589058	21

AVAILABLE MODULES

  • Input modules:

    • mem - Returns the available memory (in kB), as defined in the MemAvailable field in /proc/meminfo
    • cpu - Returns the percentage of all non-steal, non-guest, non-idle CPU cycles
    • timestamp - Timestamp in milliseconds since epoch
  • Output modules:

    • tsv - Tab-separated output
    • json - JSON output

WRITING NEW MODULES

Writing a new modules is as simple as creating three functions and placing them in the appropriate folder (inputs/ or outputs/:

  • init() - Called when module is initially imported. This can be used for initializing values, marking a start timestamp, etc.
  • run() - Called every interval to gather resources and return a value that can be printed. Can be string or number (ends up going through a str() conversion), but should not include endlines or other whitespace characters for positioning
  • info() - Called when rh --info is called. Should return a string with a summary of the data the module gathers
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].