Skip to content

archaelus/emetric

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick

git clone git://github.com/justinkirby/emetric.git

cd emetric && ./rebar compile

./emetric --node=slow@localhost --cookie=monster start gather=sys,mnesia scatter=file mods=emetric_filter_csv

tail /tmp/emetric_slow@localhost_201103102159.csv

./emetric --node=slow@localhost --cookie=monster stop

Overview

emetric creates a high level view of the resources that a running erlang system consumes over time. This is useful for long running stress tests.

Build

The goal is to have a single file that is easy to ‘install’ on any environment that has erlang. There is no complicated release install process (inspired by rebar)

This is a standard rebar build

./rebar compile

After a successful build, there will be a single executable file, emetric.

Usage

emetric will do the following:

  • connect to a remote node
  • inject the necessary modules
  • start emetric

Each command may have dependencies. If it does then those are run first. You do not have to specify all commands in order if you simply want to start recording.

Of course, there are the help and version commands, which do the obvious.

connect

This will connect to an erlang node and make sure that emetric can communicate with it.

./emetric --node=slow@localhost --cookie=monster connect

It is one of those lovely commands that will do nothing on success and be very noisy during failure. It does, however, return 0 on success and >=1 on failure

inject

This requires a successful connect.

The modules for gathering the statistics, scattering them to files and filtering them need to be specified here.

./emetric --node=slow@localhost --cookie=monster inject gather=sys,mnesia scatter=file mods=emetric_filter_csv

The above will gather system wide metrics, mnesia statistics and dump them all out to a csv file in /tmp

start

This will start recording of all requested metrics and push them out to a file (easy to add more datasources) every two seconds.

Supported metrics are:

  • system and linux
  • mnesia
  • ejabberd
./emetric --node=slow@localhost --cookie=monster inject gather=sys,mnesia scatter=file mods=emetric_filter_csv

The above will make sure all the appropriate modules are injected in the remote slow@localhost node. It will start the internal ticker that is triggered every two seconds to gather the metrics.

Once the metrics are all gathered for that ‘tick’, it is sent to the scatter modules, in this case a file. The filter is applied before writing the data.

The file name is created via the following template:

/tmp/emetric_node()_YYYYMMDDHHmm.ext

Example

/tmp/emetric_slow@localhost_201103102211.csv

stop

The emetric will happily keep recording data until either the host node dies or you tell it to stop. (hopefully it is the latter.)

./emetric --node=slow@localhost --cookie=monster stop

About

Erlang Metric Logger

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Erlang 64.2%
  • Python 35.8%