<?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>Carlos&#039; Corner &#187; charting</title>
	<atom:link href="http://cars.lostroncos.org/tag/charting/feed/" rel="self" type="application/rss+xml" />
	<link>http://cars.lostroncos.org</link>
	<description>The tired geek-dad in the corner</description>
	<lastBuildDate>Wed, 11 May 2011 03:33:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>A less simple (but better) Replay Report</title>
		<link>http://cars.lostroncos.org/2009/10/12/a-less-simple-but-better-replay-report/</link>
		<comments>http://cars.lostroncos.org/2009/10/12/a-less-simple-but-better-replay-report/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 08:23:41 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[powershell]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[appassure]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google chart api]]></category>
		<category><![CDATA[recovery point]]></category>
		<category><![CDATA[Replay]]></category>
		<category><![CDATA[snapshot]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=220</guid>
		<description><![CDATA[<p>A while back I posted about a Replay report that I wrote to help me monitor the multiple Replay servers we have deployed globally.  It was a good first effort and was useful, but having to engage my brain first thing in the morning to read (and more importantly actually comprehend) the emailed reports [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I posted about a <a href="http://cars.lostroncos.org/2009/04/30/a-simple-replay-report/" target="_blank">Replay report that I wrote</a> to help me monitor the multiple Replay servers we have deployed globally.  It was a good first effort and was useful, but having to engage my brain first thing in the morning to read (and more importantly actually comprehend) the emailed reports eofre my second cup of coffee was less than ideal.</p>
<p>Thwe original idea behind generating the report was to have the info come to me rather than logging into multiple servers and firing up the console multiple times (what can I say I&#8217;m lazy).</p>
<p>The report in the first version of the script was straighforward text. Recently I&#8217;ve been looking into and thinking about different ways to present the information in the report so I could just sort of glance at it and get the status. The disk related portion of the report wasn&#8217;t initially where I was focusing my attention. I was more interested in being able to get a quick idea of where we stood with the # of Recovery Points we were expecting to have.  An example of  one of the simple reports is below. From this we can see that we&#8217;re in pretty good shape with 100% valid RPs spanning about 24 days.</p>
<p style="padding-left: 60px;">Starting Script at 04/30/2009 23:20:12</p>
<p style="padding-left: 60px;">Replay Service is running</p>
<p style="padding-left: 60px;">Server <strong><em>mailserver.company.com</em></strong> snapshots are being stored on R: and currently using 818.54GB. This is 99.98% of the used space(818.68GB) on the volume which is 1,360.22GB</p>
<p style="padding-left: 60px;">The drive currently has 39.81% free space (e.g. 541.54GB)</p>
<p style="padding-left: 60px;">Number of reported Recovery Points is 395 of these 395 are valid, and 0 are invalid (100.00%).<br />
The valid RPs span 23.98 days</p>
<p style="padding-left: 60px;">The most recent valid RP was taken 1 Minutes ago</p>
<p>The issue becomes less clear when invalid RPs occur for whatever reason. If I have 395 RPs and only 250 of the are valid is that a good or bad state? It&#8217;s not immediately clear but one can log in to the Replay server and get a better idea of how things stand. It might be the case where there was network issue during the day and instead of 96 RPs  (that&#8217;s an RP every 15 minutes * 24 hrs) for each of the last three days we&#8217;ve only gotten 40 RPs each of those days which while less than ideal might still be an okay state. Or it could be that there are several days for which we don&#8217;t have RPs.</p>
<p><span id="more-220"></span></p>
<p>I was trying to think of a way to visualize this information. Because of the retention schedule some days we&#8217;d expect a large number of RPs (~90) and some other days we&#8217;d expect to have just one.  I looked into the possibility of using sparklines even going so far as to download a <a href="http://ewbi.blogs.com/develops/2005/07/sparklines.html">C# based version</a> of  a<a href="http://sparklines.bitworking.info/"> PHP based sparkline web service</a> from Joe Gregorio.</p>
<p>I tried several different iterations of the script using sparklines trying to use the data I had in different ways (ex: use percentages of expected RPs, diffs between expected and actaul) but wasn&#8217;t able to find a good way to represent the state using those. In digging around I came across the Google Chart API and that looked at bar different ways of using bar graphs to represent the info I wanted.  Using either side-by-side bar graphs</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_bar_sidebyside.png"><img class="alignright size-full wp-image-224" title="replay_report_rps_ex_bar_sidebyside" src="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_bar_sidebyside.png" alt="replay_report_rps_ex_bar_sidebyside" width="634" height="275" /></a></p>
<p>overlapping ones with green and red where a lot of red would be a bad thing.</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_bar_overlay.png"><img class="aligncenter size-full wp-image-223" title="replay_report_rps_ex_bar_overlay" src="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_bar_overlay.png" alt="replay_report_rps_ex_bar_overlay" width="662" height="277" /></a></p>
<p>Either of these would have been an improvement over what I was getting in the text based report.  While trying to refine the overlaid version I came across an example in the Google <a href="http://code.google.com/apis/chart/styles.html#line_styles">documentation on line style</a>s of  this graph:</p>
<div class="wp-caption alignnone" style="width: 210px"><img title="Chart Data Line example from Google Chart API" src="http://chart.apis.google.com/chart?cht=bvg&amp;chbh=5,2&amp;chm=D,0033FF,1,0,5,1&amp;chbh=20&amp;chs=200x150&amp;chd=s1:1XQbnf4,43ksfg6&amp;chco=76A4FB" alt="Chart Data Line example from Google Chart API" width="200" height="150" /><p class="wp-caption-text">Chart Data Line example from Google Chart API</p></div>
<p>This caught my eye as a possible solution to my problem about how to present this data because of the ability to show both sets of data overlaid on each other while still managing to keep both of them visible.</p>
<p>In my particular scenario the retention schedule is:</p>
<ul>
<li>RPs every 15  minutes which are kept for 4 days</li>
<li>These roll up to hourly RPs which are kept for 5 days</li>
<li>Hourly&#8217;s roll up to dailies which are kept for ~25 days</li>
</ul>
<p>Our goal is to keep about 30 <strong><em>consecutive</em></strong> days worth of RPs on hand. When plotting out the # of expected RPs per day we get a graph that looks like the one below.</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_bar_solo.png"><img class="aligncenter size-full wp-image-228" title="replay_report_rps_ex_bar_solo" src="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_bar_solo.png" alt="replay_report_rps_ex_bar_solo" width="624" height="266" /></a></p>
<p>As one can see the number of Recovery Points per day decreases over time. When adding the line showing the number of actual RPs it can be hard to tell what the status is for the days where there&#8217;s only one RP per day. If things are going well the green bars will be obscured by the red line.</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_ideal.png"><br />
<img class="aligncenter size-full wp-image-218" title="replay_report_rps_ex_ideal" src="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_ideal.png" alt="replay_report_rps_ex_ideal" width="640" height="278" /></a></p>
<p>In the rare instance where we might be missing a few daily RPs the green bars do become somewhat visible as shown in the blue box below.</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_missing_daily.png"><img class="aligncenter size-full wp-image-232" title="replay_report_rps_ex_missing_daily" src="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_missing_daily.png" alt="replay_report_rps_ex_missing_daily" width="600" height="250" /></a></p>
<p>I experimented with a couple of different ways to try to make this more obvious including altering the width and height of the chart to make it more obvious. (see below). Using the Google Chart API one is limited to an image with 300000 pixels (500&#215;600)</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_missing_daily_tall.png"><img class="aligncenter size-full wp-image-233" title="replay_report_rps_ex_missing_daily_tall" src="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_missing_daily_tall.png" alt="replay_report_rps_ex_missing_daily_tall" width="526" height="626" /></a><a title="Tall Graph" href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_missing_daily_tall.png" target="_blank"><br />
</a></p>
<p>But for me persoanlly making the chart a lot bigger like  this seemed like it didn&#8217;t really add all that much to being able to see what was going on.  So I stuck with 600&#215;250 for the graph.</p>
<p>It should also be noted that in the case where you aren&#8217;t taking snapshots every 15 minutes but evey 30 minutes or maybe even every hour it becomes easier to see missed daily RPs.  Here&#8217;s an example</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_missing_daily_50.png"><img class="aligncenter size-full wp-image-234" title="replay_report_rps_ex_missing_daily_50" src="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_rps_ex_missing_daily_50.png" alt="replay_report_rps_ex_missing_daily_50" width="627" height="276" /></a></p>
<p>After going through all of this with the RPs I almost as an afterhtought went back and added the logic to graph the disk usage data as well. It shows the size of the Replay archive data, the free space and other used space on the drive by generating something like this:</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_disk_usage.png"><img class="aligncenter size-full wp-image-235" title="replay_report_disk_usage" src="http://cars.lostroncos.org/wp-content/uploads/2009/10/replay_report_disk_usage.png" alt="replay_report_disk_usage" width="366" height="217" /></a></p>
<p>Here&#8217;s a <a title="Example Replay Report" href="http://cars.lostroncos.org/wp-content/uploads/2009/10/example_replay_report.png" target="_blank">&#8220;real-life&#8221;  example of the whole report</a>.</p>
<p>The <a href="http://cars.lostroncos.org/wp-content/uploads/2009/10/Replay_Report_v2-01.txt" target="_blank">script is available here</a>. If it&#8217;s of any use to you please drop me a line and let me know.</p>
<p>To use it rename it to something like ReplayReport.ps1. You&#8217;ll need to modify the variables at the beginning of the file:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$ReportRecipients &#8211; array of recipient email addresses.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$MailServer &#8211; The SMTP server to use to send the report out</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$ReportSender -Address the email should appear to come from.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$replay_exe &#8211; Path to the Replayc.exe file. May differ on x64 vs x86</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span> servers.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$ExpectedRPCount &#8211; array containing the number of expected RPs for the</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span> last X days. Used to generate the graph of expected vs</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span> present RPs. (See Note below)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The script doesn&#8217;t take any arguments to run. I run it via a scheduled task</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">on the replay server.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">***************</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In reference to $ExpectedRPCount the time of day that the report is run will</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">affect how the first data point on the graph appears. RPs are tracked by the</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">date that they were taken. If you run the script just before midnight there</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 3491px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">will obviously be a lot more RPs for &#8220;today&#8221; than if you run it at 1 am.</div>
<ul>
<li>$ReportRecipients &#8211; array of recipient email addresses.</li>
<li>$MailServer &#8211; The SMTP server to use to send the report out</li>
<li>$ReportSender -Address the email should appear to come from.</li>
<li>$replay_exe &#8211; Path to the Replayc.exe file. May differ on x64 vs x86  servers.</li>
<li>$ExpectedRPCount &#8211; array containing the number of expected RPs for the last X days. Used to generate the graph of expected vs present RPs. (See Note below)</li>
</ul>
<p>The script doesn&#8217;t take any arguments to run. I run it via a scheduled task on the replay server.</p>
<p>***************</p>
<p><em>In reference to $ExpectedRPCount the time of day that the report is run will affect how the first data point on the graph appears. RPs are tracked by the date that they were taken. If you run the script just before midnight there will obviously be a lot more RPs for &#8220;today&#8221; than if you run it at 1 am.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2009/10/12/a-less-simple-but-better-replay-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

