Content-Length: 20122 | pFad | http://metacpan.org/release/PEVANS/Net-Prometheus-0.14/source/examples/net-async-http-server.pl

7 examples/net-async-http-server.pl - metacpan.org
#!/usr/bin/perl

use v5.14;
use warnings;

use Net::Prometheus;

use IO::Async::Loop;
use Net::Async::HTTP::Server::PSGI;

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

use constant LISTEN_PORT => 8200;

my $client = Net::Prometheus->new;

$client->new_gauge(
   name => "ten",
   help => "The number ten",
)->set( 10 );

printf STDERR "Serving metrics on http://[::]:%d\n", LISTEN_PORT;

my $loop = IO::Async::Loop->new;

$client->export_to_IO_Async( $loop, port => LISTEN_PORT );

$loop->run;








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://metacpan.org/release/PEVANS/Net-Prometheus-0.14/source/examples/net-async-http-server.pl

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy