<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Piece of Unix Hints &#187; Humain Reading</title>
	<atom:link href="http://hints.jeb.be/tag/humain-reading/feed/" rel="self" type="application/rss+xml" />
	<link>http://hints.jeb.be</link>
	<description>hints.jeb.be</description>
	<lastBuildDate>Fri, 04 Dec 2009 20:35:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Getting human reading time info from RRD files</title>
		<link>http://hints.jeb.be/2008/12/17/getting-human-reading-time-info-from-rrd-files/</link>
		<comments>http://hints.jeb.be/2008/12/17/getting-human-reading-time-info-from-rrd-files/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 01:49:59 +0000</pubDate>
		<dc:creator>Jeb</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[RRDTool]]></category>
		<category><![CDATA[Humain Reading]]></category>

		<guid isPermaLink="false">http://hints.jeb.be/?p=36</guid>
		<description><![CDATA[You have a .rrd file but you don&#8217;t remember how much time RRAs can store data ? all right, no problem. First save this Perl code into a .pl file. $step = $1 if (m/step = (\d+)/); $rows = $1 if (m/rra.*\.rows = (\d+)/); if (m/(.*)\.pdp_per_row = (\d+)/) { $pdp = $2; $time = $step*$rows*$pdp; [...]]]></description>
			<content:encoded><![CDATA[<p>You have a .rrd file but you don&#8217;t remember how much time RRAs can store data ? all right, no problem.</p>
<p>First save this Perl code into a .pl file.</p>
<blockquote><p><code>$step = $1 if (m/step = (\d+)/);<br />
$rows = $1 if (m/rra.*\.rows = (\d+)/);<br />
if (m/(.*)\.pdp_per_row = (\d+)/) {<br />
$pdp = $2; $time = $step*$rows*$pdp;<br />
if ($time &gt; 31536000) { $time = sprintf("%.2f year",$time/31536000) }<br />
elsif ($time &gt; 86400) { $time = sprintf("%.2f days",$time/86400) }<br />
elsif ($time &gt; 3600)  { $time = sprintf("%.2f hours",$time/3600) }<br />
print "$1: $step*$rows*$pdp = $time\n";<br />
}</code></p></blockquote>
<p>Assuming the filename of the script is rrd_info.pl, run this Shell command:</p>
<blockquote><p><code>rrdtool info file.rrd | perl -n rrd_info.pl</code></p></blockquote>
<p>Here is an output example:</p>
<pre>rra[0]: 300*864*1 = 3.00 days
rra[1]: 300*864*5 = 15.00 days
rra[2]: 300*702*25 = 60.94 days
rra[3]: 300*840*125 = 364.58 days
rra[4]: 300*840*625 = 4.99 year
rra[5]: 300*864*1 = 3.00 days
rra[6]: 300*864*5 = 15.00 days
rra[7]: 300*702*25 = 60.94 days
rra[8]: 300*840*125 = 364.58 days
rra[9]: 300*840*625 = 4.99 year
rra[10]: 300*864*1 = 3.00 days
rra[11]: 300*864*5 = 15.00 days
rra[12]: 300*702*25 = 60.94 days
rra[13]: 300*840*125 = 364.58 days
rra[14]: 300*840*625 = 4.99 year</pre>
<p>The formula is update step time * numbers of rows in the rra * pdp_per_row</p>
]]></content:encoded>
			<wfw:commentRss>http://hints.jeb.be/2008/12/17/getting-human-reading-time-info-from-rrd-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
