Created
September 18, 2013 18:08
-
-
Save rblackwe/6613078 to your computer and use it in GitHub Desktop.
I tool to help with constructing URIs for Graphite. (Tuned for https://www.hostedgraphite.com/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use URI; | |
use HTML::Display; | |
my $prams = { | |
target => [qw(ad_live ad_static ad_live_html ad_static_html)], | |
height => 800, | |
width => 1600, | |
from => "-3hours", | |
yMax => ".2", | |
lineMode => "connected", | |
}; | |
my $uri = URI->new("https://www.hostedgraphite.com"); | |
$uri->path( "{API KEY}/graphite/render/"); | |
$uri->query_form( $prams ); | |
my $html = <<'END_HTML'; | |
<html> | |
<body> | |
<h1>Title</h1> | |
<img src='%s' height="%s" width="%s"> | |
<ul> | |
<li><a href="http://graphite.readthedocs.org/en/1.0/functions.html">Functions</a></li> | |
<li><a href="http://graphite.readthedocs.org/en/1.0/url-api.html">URI</a></li> | |
</ul> | |
</body> | |
</html> | |
END_HTML | |
display(sprintf($html, $uri->as_string,$params->{height},$params->{width})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment