Home

Awesome

perfstat

<img src="https://goreportcard.com/badge/github.com/flaviostutz/perfstat"/>

Analyze and show tips about possible bottlenecks and risks in Linux systems regarding to diskio, networking, cpu, swapping, memory etc.

We decided to create this utility to help on the laborious job of aswering the following:

After hundred of hours looking for metrics on CLI and Prometheus/Grafana tools, correlating data to check if all is ok, now we can automate some of this work. Surely this won't answer all the doubts, but can help you on some repetitive work.

If you are a system admin, answering the "Is the system OK" overnight too, come and tell us what you miss from perfstat on the Issues. Share your experience and automate it forever!

If you are a developer too, help system admins find problems more quickly by implementing some of the Issues so they can keep your software up! If in doubt, ask for a task in "Issues" and we'd be glad to answer.

Usage

Perfstat has various interfaces:

CLI

<img src="./res/demo1.gif" /> <img src="./res/demo2.gif" /> <img src="./res/demo3.gif" /> <img src="./res/demo4.gif" />

Prometheus Exporter

version: '3.5'
services:
  perfstat:
    image: flaviostutz/perfstat
    privileged: true
    ports:
      - 8880:8880
    volumes:
      - /etc/hostname:/etc/hostname
perfstat prometheus
curl localhost:8880/metrics

Swarm

version: '3.5'
services:
  perfstat:
    image: flaviostutz/perfstat
    privileged: true
    volumes:
      - /etc/hostname:/etc/hostname
    deploy:
      mode: global

Prometheus Metrics

Issue Detectors

Bottlenecks (already a problem)

Risks (may cause problems)

Insights (top 5)

Perfstat developer tips

Profiling

//run profile for an specific test case
go test -cpuprofile /tmp/cpu.prof -run ^TestProcessStatsBasic$

//see results in browser
go tool pprof -http 0.0.0.0:5050 /tmp/cpu.prof

CLI development

docker exec -it [containerid] sh

cd /app
go run .

Existing tools for performance analysis

More info about performance analysis

CLI UI considerations

Because there are some mutex locks misplaced there. We used termdash Controller redraw "by hand" to avoid concurrency problems and it is working well.