Mojolicious::Plugin::Prometheus::Shared::FastMmap - Mojolicious Plugin
# Mojolicious $self->plugin('Prometheus::Shared::FastMmap'); # Mojolicious::Lite plugin 'Prometheus::Shared::FastMmap'; # Mojolicious::Lite, with custom response buckets (seconds) plugin 'Prometheus::Shared::FastMmap' => { response_buckets => [qw/4 5 6/] };
Mojolicious::Plugin::Prometheus::Shared::FastMmap is a Mojolicious plugin that exports Prometheus metrics from Mojolicious, using a shared mmapped file between workers.
It uses Mojolicious::Plugin::Prometheus under the hood, and adds a shared cache using Mojolicious::Plugin::CHI + CHI + Cache::FastMmap to provide metrics for all workers under a pre-forking daemon like Mojo::Server::Hypnotoad.
See Mojolicious::Plugin::Prometheus for more complete documentation.
Mojolicious::Plugin::Prometheus::Shared::FastMmap inherits all methods from Mojolicious::Plugin::Prometheus and implements no new ones.
$plugin->register($app, \%config);
Register plugin in Mojolicious application.
%config can have all the original values as Mojolicious::Plugin::Prometheus, and adds the following keys:
%config
cache_dir
The path to store the mmapped file. See CHI::Driver::FastMmap for details (used as root_dir).
Default: ./cache
cache_size
Defaults to '5m'. See CHI::Driver::FastMmap for details.
Vidar Tyldum
Copyright (C) 2018, Vidar Tyldum
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
To install Mojolicious::Plugin::Prometheus::Shared::FastMmap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Prometheus::Shared::FastMmap
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Prometheus::Shared::FastMmap
For more information on module installation, please visit the detailed CPAN module installation guide.