GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Metrics::Any::Adapter(3) User Contributed Perl Documentation Metrics::Any::Adapter(3)

"Metrics::Any::Adapter" - set the "Metrics::Any" adapter for the program

In a program or top-level program-like module:

   use Metrics::Any::Adapter 'Prometheus';

The "use" statement which loads this module sets the adapter module for Metrics::Any to report metrics generated by an modules the program uses.

The first value passed should be a string giving the name of an adapter module, which will be expected under the "Metrics::Any::Adapter::"-prefix. This module will be loaded and set as the adapter to use. Any additional arguments will be passed to the constructor of the adapter instance.

   use Metrics::Any::Adapter Custom => "another arg";

   # implies
   $adapter = Metrics::Any::Adapter::Custom->new( "another arg" );

Since version 0.04.

Sets the default adapter type to use if the program has not otherwise requested one.

Normally this is set to "Null", which loads Metrics::Any::Adapter::Null. By overriding this to a different value, a default adapter can be loaded without modifying the program. This may be useful for example, when running unit tests:

   $ METRICS_ANY_ADAPTER=Stderr ./Build test

Additional arguments can be specified after a colon, separated by commas or equals signs.

   $ METRICS_ANY_ADAPTER=File:path=metrics.log ./program.pl

Note that if a program requests a specific adapter that will override this variable.

A limited attempt is made at supporting nested arguments wrapped in square brackets, to allow basic operation of the Metrics::Any::Adapter::Tee adapter via this variable to itself pass arguments into child adapters:

   $ METRICS_ANY_ADAPTER=Tee:Prometheus,[File:path=metrics.log] perl ...

This should be considered a best-effort scenario useful for short-term testing and debugging. For more complex requirements in your script or program, it is better to use the import arguments directly as then any perl data structures can be passed around.

Paul Evans <leonerd@leonerd.org.uk>
2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.