Git Product home page Git Product logo

perfmonger's Introduction

PerfMonger

Build Status

wercker status

PerfMonger is a system performance monitor which enables high-resolution and holistic performance measurement with the programmer friendly interface.

  • High-resolution: sub-second level monitoring is possible!
  • Holistic performance measurement: monitoring CPU, Disk I/O, Network all at once.
  • Programmer friendly: PerfMonger speaks monitoring results in JSON format, which makes later performance analysis much easier (ex. jq).

CAUTION: PerfMonger is still in early stage, so there may be a drastic change in the future. Do not use it for critical jobs

Target platform

  • GNU/Linux
  • Mac OS X (experimental support)

How to installation

gem install perfmonger

You need gnuplot 4.6.0 or later build with cairo terminals for plotting measurement data with perfmonger plot command.

Build from source

You need Ruby 2.2 or later, and Go 1.8 or later to build perfmonger.

bundle
rake build

Getting started

Basic usage of PerfMonger is:

  • Run perfmonger record to record performance information logs
  • Run perfmonger play to show performance information logs in JSON format

perfmonger play repatedly prints records of system performance including CPU usages, disk usages, and network usages. One line includes only one record, so you can easily process output records with jq, or any scripting languages like Ruby, Python, and etc.

Pretty-printed structure of a record is as follows:

{"time": 1500043743.504, # timestamp in unix epoch time
  "cpu": {               # CPU usages
    "num_core": 2,         # the number of cores
    "all": {               # aggregated CPU usage (max = num_core * 100%)
      "usr": 50.0,
      "sys": 50.0,
      "idle": 100.0,
      ...
    },
    "cores": [             # Usage of each CPU core
      {
        "usr": 25.0,
        "sys": 25.0,
        "idle": 50.0,
        ...
      },
      {
        "usr": 25.0,
        "sys": 25.0,
        "idle": 50.0,
        ...
      }
    ]
  },
  "disk": {             # Disk usages
    "devices": ["sda"],   # List of disk devices
    "sda": {              # Usage of device 'sda'
      "riops": 10.0,        # The number of read I/O per second
      "wiops": 20.0,        # The number of write I/O per second
      "rkbyteps": 80.0,     # Read transfer rate in KB/s
      "wkbyteps": 160.0,    # Write transfer rate in KB/s
      ...
    }
    "total": {           # Aggregated usage of all devices
      "riops": 10.0,
      "wiops": 20.0,
      "rkbyteps": 80.0,
      "wkbyteps": 160.0,
      ...
    }
  }
}

Typical use cases

perfmonger live: live performance monitoring

$ perfmonger live

Monitor IO performance of /dev/sda for each 0.1 second

$ perfmonger record -i 0.1 -d sda

Monitor CPU usage for each 0.1 second

$ perfmonger record -i 0.1

Monitor CPU usage and IO performance of /dev/sda, sdb for each 0.1 second

$ perfmonger record -i 0.1 -d sda -d sdb

perfmonger's People

Contributors

hayamiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

perfmonger's Issues

[server] Display hostname

Display hostname on HTML5 realtime monitor.

Use a hostname given by command line argument, or try to obtain it automatically.

[record] Trigger option

perfmonger-record starts recording just after a trigger condition is fired.

trigger can be:

  • the first launch of the specified program
  • the first fork from the specified process
  • specified time

or something elese.

[record] Timeout option

If timeout option is specified, perfmonger-record exits after the specified time has passed.

$ perfmonger record --interval 0.1 --timeout 10 -d sda
{"time": ..., "ioinfo": {... } ... }
(... 10 seconds ...)
== Summary ==
...

Resolve logical volume name

If /dev/mapper/VolGroup00-LogVol00 or /dev/VolGroup00/LogVol00 is passed to perfmonger record via -d option, convert it to corresponding device name dm-x.

This is done by following steps:

  1. Build device name dictionary by reading /proc/partitions
  2. Parse input and identify the path of logical volume
  3. stat(3) the volume and get major/minor number of the volume
  4. Look up the dictionary build in step 1. with major/minor number

Streaming processing in summary subcommand

Currently summary subcommand reads all records into memory, then do computation. This does not work if records takes memory space larger than physical memory.
Calculate summary in streaming processing fashion.

[stat] Calculate avg. IOPS by accumulating IOPS*ฮ”t

  • x[i] ... i-th sample value of IOPS
  • t[i] ... beginning time of i-th sample
  • N ... # of samples

Currently avg. IOPS is calculated as a average value of sampled IOPS.

avg IOPS = (x[0] + x[1] + ... + x[N-1]) / N

But actually, avg. IOPS needs to be calculated by this way.

avg IOPS = (x[1] * (t[1] - t[0]) + x[2] * (t[2] - t[1]) + ...  + x[N-1] * (t[N-1] - t[N-2])) / (t[N-1] - t[0])

Check exit status of background perfmonger-recorder

perfmonger record --kill does not check the background perfmonger-recorder process has exited or not, and fail if the process does not exit correctly.

Also, perfmonger record --kill should fail if there is no background recorder process.

Gzipped data file support

  • record subcommand: gzipped output stream (maybe gzipped file as default for future version?)
  • play subcommand: handle gzipped and plain input stream
    • file extension based approach (*.pgr is plain, *pgr.gz is gzipped)
    • transparent file handling approach (check magic number first, then switch plain/gzip read)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.