• Stars
    star
    324
  • Rank 129,708 (Top 3 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created about 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A modular system monitor written in Rust

Introducing Hegemon

Crates.io Build Status GitLab Mirror

Hegemon is a work-in-progress modular system monitor written in safe Rust.

Screencast

Currently, it has the following features:

  • Monitor CPU and memory usage, temperatures, and fan speeds
  • Expand any data stream to reveal a more detailed graph and additional information
  • Adjustable update interval
  • Clean MVC architecture with good code quality
  • Unit tests

Planned features include:

  • macOS and BSD support (only Linux is supported at the moment)
  • Monitor disk and network I/O, GPU usage (maybe), and more
  • Select and reorder data streams
  • Mouse control

Hegemon is built around the excellent crossbeam-channel, termion, systemstat, and sensors crates.

Building

Hegemon is currently Linux only and requires Rust 1.34 or later and the development files for libsensors. The latter can be found in the package repository of every major Linux distribution, e.g. lm_sensors-devel in Fedora and libsensors4-dev in Ubuntu.

Once these requirements are met, Hegemon can be built and run with

git clone https://github.com/p-e-w/hegemon.git
cd hegemon
cargo run

Adding new data streams

Unlike traditional system monitors such as top, which are tailor-made to display specific metrics like CPU and memory usage only, Hegemon shows the output of monitoring modules called data streams, whose behavior is defined by the Stream trait.

Streams only need to supply basic properties such as name and description, and a method for retrieving a numeric data value. Everything else is managed by Hegemon, including update scheduling, layout and rendering, adaptive scaling, and computation of statistics.

Stream objects are in turn generated by StreamProviders. This makes it possible to have streams whose exact nature and number can only be determined at runtime, such as one stream per CPU core.

Adding new streams, then, involves the following steps:

  1. Create a StreamProvider
  2. Make it return Stream objects from its streams method
  3. Register the provider in providers/mod.rs

The providers directory contains several working provider implementations that can be used as a reference. In particular, most providers will want to use the Stream::new helper function to create streams instead of manually implementing the Stream trait.

Ideas for, and implementations of, additional data streams are very welcome!

License

Copyright © 2018-2020 Philipp Emanuel Weidmann ([email protected])

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

By contributing to this project, you agree to release your contributions under the same license.

More Repositories

1

maybe

📂 🐇 🎩 See what a program does before deciding whether you really want it to happen (NO LONGER MAINTAINED)
Python
6,362
star
2

finalterm

At last – a modern terminal emulator (NO LONGER MAINTAINED)
Vala
3,860
star
3

argos

Create GNOME Shell extensions in seconds
JavaScript
1,612
star
4

ternimal

Simulate a lifeform in the terminal
Rust
1,042
star
5

plotinus

A searchable command palette in every modern GTK+ application
Vala
1,010
star
6

krill

📰 The hacker's way of keeping up with the world (NO LONGER MAINTAINED)
Python
807
star
7

savage

A primitive computer algebra system
Rust
548
star
8

shin

A shell in every text input on your system
Go
265
star
9

ranwhen

Visualize when your system was running (NO LONGER MAINTAINED)
Python
262
star
10

language-javascript-semantic

JavaScript Semantic Highlighting Package for Atom (NO LONGER MAINTAINED)
JavaScript
82
star
11

GTKDarkThemeVariantSetter

Make Sublime Text use the dark GTK+ theme variant (NO LONGER MAINTAINED)
Python
51
star
12

quicksafe

The easiest way to securely encrypt notes (NO LONGER MAINTAINED)
Python
51
star
13

envy

Text editing supercharger
JavaScript
35
star
14

chatbot_clinic

Science-driven chatbot development
Python
27
star
15

sequencer

Purely algorithmic number sequence identification
Scala
25
star
16

pingpong

End-to-end latency monitoring for Matrix
Go
10
star
17

cal-ender

A modern, practical date model simplifying what people actually use a calendar for (NO LONGER MAINTAINED)
JavaScript
7
star
18

wd2sql

Transform a Wikidata JSON dump into an SQLite database
Rust
6
star
19

tree-saw

tree-sitter and compilers testing each other
JavaScript
4
star
20

pastevents

A structured, searchable archive of Wikipedia's "Current Events" portal
Python
3
star
21

enough

Rust
2
star
22

curv-solids

A library for working with polyhedra in Curv
1
star
23

humergesort

Rank arbitrary lists through human-powered comparison sorting (NO LONGER MAINTAINED)
1
star
24

graduality

Rust
1
star
25

arrows

A frontend for creative writing with LLMs
TypeScript
1
star