Go to file
Augusto Dwenger a12b6d3c64 Merge branch 'develop'
Adds Disk and Memory stats.
2020-06-30 16:38:12 +02:00
args Fix spelling 2020-05-30 15:02:46 +02:00
commands Cleanup naming and parameters 2020-06-30 16:36:51 +02:00
errors Add test for the Error func of the BaseError 2020-05-30 15:55:40 +02:00
.gitignore Add CPU reader 2020-05-29 14:38:27 +02:00
go.mod Implement memory read 2020-06-14 16:01:45 +02:00
go.sum Implement memory read 2020-06-14 16:01:45 +02:00
main.go Implement disk space usage command 2020-06-29 12:12:11 +02:00
main_internals_test.go Fix output format 2020-06-14 14:26:08 +02:00
README.md Update project path for cstat from nhh 2020-05-29 14:35:43 +02:00

gstat

Is a tool to get the system stats in a parsable format. The tool is part of the competition with Niklas.

Checkout his solution: cstat

Terms of the competition

Allgemein:

Name des Programms: - cstat - gstat

Das Tool kann mehrere Metriken auf einmal zurückgeben.

Anforderung:

- Aktuelle CPU Auslastung
- Gesamtverbrauch aller CPU Kerne in %
- Die nach cpu sortierten Prozesse als Liste
- Aktueller Speicherplatzverbrauch
    -used / free in megabyte
- Aktueller RAM Verbrauch
    - used / free in megabyte
- Healthchecks mit Latency
    - http / https / *ICMP*
    - GET /
- *Aktueller Network IO (optional)*
- *Disk IO (optional)*
- JSON Output
- Datum und Uhrzeit im ISO Format

Kriterien:

- Single Executable
- Linux

Bewertungs:

  1. Wie groß ist das Binary
  2. Performance von Befehlen
  3. Cpu Auslastung
  4. Ram Auslastung

Kommandozeilenaufrufe:

Alphabetische Reihenfolge

-c -h -d // --healtheck=http://example.com --disk --format=json

https://de.wikipedia.org/wiki/Uniform_Resource_Identifier

$ cstat/gstat --cpu --format=json $ cstat/gstat --metric=disk $ cstat/gstat --check

Goals:

cstat/gstat -c -d -i -h https://my-server.com > log.json

curl -X POST -d $(cstat/gstat -c -d -i -h https://my-server.com) https://my-logging.com/logs