GenMetrics

Runtime metrics for GenServer and GenStage applications.

This library supports the collection and publication of GenServer and GenStage runtime metrics. Metrics data are generated by an introspection agent. No instrumentation is required within the GenServer or GenStage library or within your application source code.

Quick Look

Given a GenStage application with the following stages: Data.Producer, Data.Scrubber, Data.Analyzer and a Data.Consumer. Activate metrics collection for the entire pipeline as follows:

alias GenMetrics.GenStage.Pipeline
pipeline = %Pipeline{name: "demo",
                     producer: [Data.Producer],
                     producer_consumer: [Data.Scrubber, Data.Analyzer],
                     consumer: [Data.Consumer]}
GenMetrics.monitor_pipeline(pipeline)

Documentation

Find detailed documentation for the GenMetrics library on HexDocs.

Installation

GenStage requires Elixir v1.4. Just add :gen_metrics to your list of dependencies in mix.exs:

def deps do
  [{:gen_metrics, "~> 0.1.0"}]
end

Examples

Examples using GenMetrics to collect and report runtime metrics for GenServer applications can be found in the examples directory:

Examples using GenMetrics to collect and report runtime metrics for GenStage applications can also be found in the examples directory:

All of these GenStage example applications are clones of the example applications provided in the GenStage project repository.

License

See the LICENSE file for license rights and limitations (Apache License 2.0).