Prometheus::Tiny - A tiny Prometheus client backed by a shared memory region
use Prometheus::Tiny::Shared; my $prom = Prometheus::Tiny::Shared->new;
Prometheus::Tiny::Shared is a wrapper around Prometheus::Tiny that instead of storing metrics data in a hashtable, stores them in a shared database (provided by SQLite, though this may change in the future). This lets you keep a single set of metrics in a multithreaded app.
Prometheus::Tiny::Shared
Prometheus::Tiny::Shared should be a drop-in replacement for Prometheus::Tiny. Any differences in behaviour is a bug, and should be reported.
Prometheus::Tiny
my $prom = Prometheus::Tiny::Shared->new(filename => ...);
filename, if provided, will name an on-disk file to use as the backing store. If not supplied, an in-memory store will be used, which is suitable for testing purposes.
filename
The in-memory store (and indeed, the entire Prometheus::Tiny::Shared object) is NOT safe across forks; if you fork you need to create a new object with the filename for the backing store supplied.
The cache_args argument will cause the constructor to croak. Code using this arg in previous versions of Prometheus::Tiny::Shared no longer work, and needs to be updated to use the filename argument instead.
cache_args
Please report any bugs or feature requests through the issue tracker at https://github.com/robn/Prometheus-Tiny-Shared/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/robn/Prometheus-Tiny-Shared
git clone https://github.com/robn/Prometheus-Tiny-Shared.git
Rob N ★ <robn@robn.io>
This software is copyright (c) 2017 by Rob N ★
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Prometheus::Tiny::Shared, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prometheus::Tiny::Shared
CPAN shell
perl -MCPAN -e shell install Prometheus::Tiny::Shared
For more information on module installation, please visit the detailed CPAN module installation guide.