<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Wherever I go, there I am &#187; geekery</title>
	<atom:link href="http://arunxjacob.wordpress.com/category/geekery/feed/" rel="self" type="application/rss+xml" />
	<link>http://arunxjacob.wordpress.com</link>
	<description>sometimes that's nice, sometimes not so much...</description>
	<lastBuildDate>Thu, 09 Oct 2008 04:47:51 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='arunxjacob.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/89cc1781cfd2358ac68242bc3ffa631c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Wherever I go, there I am &#187; geekery</title>
		<link>http://arunxjacob.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://arunxjacob.wordpress.com/osd.xml" title="Wherever I go, there I am" />
		<item>
		<title>Evri Beta goes Open!</title>
		<link>http://arunxjacob.wordpress.com/2008/09/24/evri-beta-goes-open/</link>
		<comments>http://arunxjacob.wordpress.com/2008/09/24/evri-beta-goes-open/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 20:00:12 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[Evri]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=122</guid>
		<description><![CDATA[A big day here at Evri, as we have taken the password protection off and opened ourselves up to the world.  When we started looking at the problem of managing information on the web almost 3 years ago as a tiny research team of 2, our main goal was to make processing information easier [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=122&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A big day here at <a href="http://evri.com">Evri</a>, as we have taken the password protection off and opened ourselves up to the world.  When we started looking at the problem of managing information on the web almost 3 years ago as a tiny research team of 2, our main goal was to make processing information easier for ourselves. We were stuck in an endless loop of keyword search -&gt; sift through results -&gt; alter keyword search -&gt; forget what we were looking for in the first place.</p>
<p>Fast forward to now and Evri is an incredibly talented team who have gone far beyond the initial proof of concept prototypes and have delivered an intuitive and easy to use site that lets you find the content you want to find about the things you care about. Along the way I&#8217;ve been exposed to the real problems and solutions inherent in making a real product from a raw prototype, and I&#8217;ve got to say it&#8217;s been a great ride so far, and with the open beta we have just crossed the starting line&#8230;now it&#8217;s real!</p>
<p>Instead of writing about what we do, which is best summed up <a href="http://www.evri.com/about.html">here</a>, I encourage you to visit the <a href="http://evri.com">site</a> and poke around. If you have a blog, try <a href="http://www.evri.com/partners-and-bloggers.html">installing the widget</a> &#8212; note that my blog, which is hosted by wordpress, cannot run the widget, but this is a general wordpress problem, and there are known <a href="http://geekycoder.wordpress.com/2008/02/22/reviewweb-embeds-any-flash-widget-in-wordpress-paid-or-free-host-without-messy-plug-in-using-the-incredible-vodpod/">work-arounds</a> that we are investigating. Stay Tuned!</p>
<div class="evri-widget-launcher"></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=122&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/09/24/evri-beta-goes-open/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>RRD and averages</title>
		<link>http://arunxjacob.wordpress.com/2008/09/15/rrd-and-averages/</link>
		<comments>http://arunxjacob.wordpress.com/2008/09/15/rrd-and-averages/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 05:11:26 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=91</guid>
		<description><![CDATA[As noted in other posts, I&#8217;m writing a monitoring application. Because this is at best a part time effort that needs to be done quickly, I&#8217;ve made some technology choices that emphasize rapid development: the app is a Rails app, and I&#8217;m storing statistics with RRD.
I really like RRD, as I&#8217;ve mentioned before, it gets [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=91&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As noted in other posts, <a href="http://arunxjacob.wordpress.com/2008/06/10/metrics-fast-n-easy-with-rrdtool-and-ruby-part-1-installing-rrdtool-and-ruby-bindings-on-a-mac/">I&#8217;m writing a monitoring application</a>. Because this is at best a part time effort that needs to be done quickly, I&#8217;ve made some technology choices that emphasize rapid development: the app is a Rails app, and I&#8217;m storing statistics with RRD.</p>
<p>I really like RRD, as I&#8217;ve mentioned <a href="http://arunxjacob.wordpress.com/2008/09/11/activeresource-as-a-web-servicification-tool/">before</a>, it gets me out of the business of drawing graphs and storing data, both of which are hard problems I&#8217;d rather not solve. But I was having some issues with it when I would try to store values.</p>
<h3>How I thought RRD worked</h3>
<p>It seemed pretty simple. I thought I would <a href="http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html">create an RRD file</a> (wow, lots of parameters, wonder what they mean?), then <a href="http://oss.oetiker.ch/rrdtool/doc/rrdupdate.en.html">update it</a> whenever I had a number. And the values would be graphed. And all would be good. But when I did all of the above, I noticed that the values being graphed were not the values I was storing. Hmmm. Time to figure out what some of those parameters mean.</p>
<h3>How RRD actually works</h3>
<p>Pretty well, actually, because it was designed by some smart people to store numbers that came in at any time, and average those numbers across a create time defined interval. Well, that&#8217;s one of the ways RRD works. It can also store counters, store the results of methods applied to raw values, and store the derivative value of the line being graphed. I was using it in the simplest case, to store a value.</p>
<p>What I didn&#8217;t realize is  that if my values were updated  between interval boundaries (known as &#8217;step values&#8217;), they would be averaged across that interval. If the values were updated outside of the specified &#8216;heartbeat&#8217; value, RRD would store an &#8216;unknown&#8217; value. A good explanation of how this works is found <a href="http://www.luteus.biz/Download/LoriotPro_Doc/RRD%20documentation/Data_Source_DS_EN.htm">here</a> ( in an SNMP monitoring solution).</p>
<p>That is actually the way graphing in a loosely coupled environment_should_ work. The reason that I was seeing strange numbers was because my insertions were falling within the same interval boundary. Which may be rational, but doesn&#8217;t jibe with then numbers I&#8217;m trying to (a) display and (b) alert on.</p>
<h3>How I got my app to work with RRD</h3>
<p>The key for this app is that it is expecting an average value across a time interval. So in essence I have to make sure that only one data point is inserted per interval. I do this by munging the time of insertion in the RRD graph (I still keep the original insert time for purposes of reporting).</p>
<p>I insert the data point at the end of the interval, so if I have a 5 minute interval and I receive and update at 21:52:34, my actual insertion is at 21:55:00. The next value will be inserted at 22:00:00. If the interval was 1 minute, I would have inserted at 21:53:00, and the next value would be inserted at 21:54:00.</p>
<h3>More fun with RRD</h3>
<p>I&#8217;m sure that more fun awaits. I have not hit the point where round robin averaging kicks in, and my &#8216;default&#8217; values are based on my current (mis)understanding of RRD. I&#8217;ll update this post so I don&#8217;t repeat history.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=91&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/09/15/rrd-and-averages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>ActiveResource as a Web Servicification Tool</title>
		<link>http://arunxjacob.wordpress.com/2008/09/11/activeresource-as-a-web-servicification-tool/</link>
		<comments>http://arunxjacob.wordpress.com/2008/09/11/activeresource-as-a-web-servicification-tool/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 00:35:01 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=95</guid>
		<description><![CDATA[That&#8217;s right Web Servicification. Servicifying, just like the subtle art of Strategery, is an oft derided but subtly powerful part of my toolkit.
Or at least it is now. I have been working on a monitoring application so that we could figure out when things were going pear shaped &#8212; as opposed to finding out after [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=95&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>That&#8217;s right Web Servicification. Servicifying, just like the subtle art of <a href="http://en.wikipedia.org/wiki/Strategery">Strategery</a>, is an oft derided but subtly powerful part of my toolkit.</p>
<p>Or at least it is now. I have been working on a monitoring application so that we could figure out when things were going <a href="http://www.urbandictionary.com/define.php?term=pear+shaped">pear shaped</a> &#8212; as opposed to finding out after the fact. This monitoring application was somewhat novel in that it successfully got me out of doing hard things of little quantifiable value and let me focus on doing easy things of much greater value (see above goal). <a href="http://arunxjacob.wordpress.com/2008/06/10/metrics-fast-n-easy-with-rrdtool-and-ruby-part-1-installing-rrdtool-and-ruby-bindings-on-a-mac/">Using RRD</a> is a good example of outsourcing a hard problem  &#8212; what to do with all that data ?!?&#8211; to something that handled it for me. Not an especially hard leap to make, thanks to <a href="http://perso.math.univ-angers.fr/spip.php?article2">lots of SysAdmins who feel exactly the same way</a>, but still, I&#8217;m really happy that I&#8217;m not collapsing data to keep my disk footprint somewhat finite.</p>
<p>This whole strategy of &#8216;doing more with less effort&#8217; is really fun, I&#8217;m searching for something non geeky to try it in.  If I get the same efficiency boost in my personal life I&#8217;ll have enough time to write a best seller, become a kickboxing champion, or <a href="http://www.fourhourworkweek.com/blog/">both</a>.</p>
<p>In the context of my (geeky) monitoring app, Web Servicification is something else that gets me out of a couple of fairly hard to do things. Wait, let me back up a bit. Web Servicification with ActiveResource gets me out of a couple of fairly hard to do things.</p>
<p>The first is writing a web service. Go ahead and sneer at the difficulties of writing an XML consuming service, but until you&#8217;ve rolled your own in Java, you just don&#8217;t have that Juan Valdez &#8220;I wrote this one bean at a time&#8221; feeling.</p>
<p>The second hard thing this gets me out of is writing monitors for a bunch of heterogenous systems. We&#8217;ve got some things implemented in Java, some in Ruby, some in Perl, etc. I either slap a bunch of web interfaces on all of those systems, then write some centralized code to poll those interfaces, or I slap a web interface on my monitor app and let other people figure out which statistics are meaningful to them, and how often they should be updated.</p>
<h3>A Web Service by Default</h3>
<p>ActiveResource comes more or less enabled by default in <a href="http://">Rails 2.0</a>. Every method in a default generated controller can be accessed either by the UI or an REST action. Here is an example controller generated for one of my resources.</p>
<p><em> # GET /samples<br />
# GET /samples.xml<br />
def index<br />
&#8230;<br />
<strong> respond_to do |format|<br />
format.html  #index.html.erb<br />
format.xml  { render <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml =&gt; @monitor_instances }<br />
end</strong><br />
end</em></p>
<p><em># GET /monitor_instances/foo<br />
# GET /samples/1<br />
# GET /samples/1.xml<br />
def show<br />
end</em></p>
<p><em># GET /samples/new<br />
# GET /samples/new.xml<br />
def new<br />
end</em></p>
<p><em># GET /samples/1/edit<br />
def edit<br />
end</em></p>
<p><em># POST /samples<br />
# POST /samples.xml<br />
def create<br />
end</em></p>
<p><em># PUT /samples/1<br />
# PUT /samples/1.xml<br />
def update<br />
end</em></p>
<p><em># DELETE /samples/1<br />
# DELETE /samples/1.xml<br />
def destroy<br />
end</em></p>
<p>Notice that the standard REST verbs are implemented in the same methods that handle rails application page requests. That&#8217;s pretty cool, and it means that you&#8217;ve got basic CRUD from the get go. The secret is in the render method (in bold above), which returns either a page or XML content depending on the requested format. If the request ends in xml, it&#8217;s assumed to be REST, otherwise it&#8217;s assumed to be a standard page request.</p>
<p>Routing for both REST and page based requests is provided in routes.rb:</p>
<p><em><strong>map.resources :monitor_instances</strong></em></p>
<p>provides routing access to the default methods defined above.</p>
<h3>Accessing the Default Web Service</h3>
<p>ActiveResource::Base is the class that abstracts the wire format and provides basic CRUD access to the resource. To access the MonitorInstance objects defined above, I could do the following:</p>
<p><em>class MonitorInstance &lt; ActiveResource::Base<br />
# define what you need in here</em></p>
<p><em>end</em></p>
<p>The ActiveResource based MonitorInstance acts similarly to an ActiveRecord based MonitorInstance:</p>
<p><em>monitor_instance = MonitorInstance.create(:name=&gt;monitor_name,:monitor_instance_id=&gt;parent_monitor.id,:frequency_id=&gt;frequency.id,:status_id=&gt;@status_by_name['good'].id,:monitor_type_id=&gt;@monitor_type_by_name["stand_alone"].id)</em></p>
<p>creates a monitor with the parameters as specified above.</p>
<p><em>MonitorInstance.delete(monitor.id)</em> OR</p>
<p><em>monitor_instance.destroy</em></p>
<p>removes the monitor instance.</p>
<p><em>monitor_instance = MonitorInstance.find(1)</em> finds me the monitor instance with an ID of 1.</p>
<p>removes that Monitor. So far, so good.</p>
<p><strong>Find (not by ID)<br />
</strong></p>
<p>What if I want to find something by a secondary attribute, like name? The default rails app expects qualifying parameters to be passed in a params hash:</p>
<p>monitor = MonitorInstance.find(:first,:params=&gt;{:name=&gt;monitor_name})</p>
<p>My MonitorInstances can be nested under other MonitorInstances. In the Rails app model, each MonitorInstance model specifies that it  <strong>belongs_to :monitor_instance</strong>.</p>
<p>This doesn&#8217;t quite have a corollary in the ActiveResource world. ActiveResource is concerned with abstracting basic access of web based resources, and that associations are not available via that abstraction layer. When I want to find a nested MonitorInstance, I do the following:</p>
<p><em>def get_monitor(monitor_name,parent_name = nil)</em></p>
<p><em>if(parent_name != nil)<br />
<strong>parent = get_monitor(parent_name)</strong><br />
@logger.debug(&#8220;finding first instance of monitor #{monitor_name} under #{parent_name}&#8221;)<br />
monitor = MonitorInstance.find(:first,<strong>:params=&gt;{:name=&gt;monitor_name,:monitor_instance_id=&gt;parent.id}</strong>)<br />
else<br />
@logger.debug(&#8220;finding first instance of monitor #{monitor_name}&#8221;)<br />
monitor = MonitorInstance.find(:first,:params=&gt;{:name=&gt;monitor_name})<br />
end</em></p>
<p><em> &#8230;<br />
</em></p>
<p><em>end</em></p>
<p>So I need to first get the parent resource, then make a request with the parent ID in the params hash, as indicated by the bolded text above.</p>
<h3>Updating &#8212; Avoid Non Writeable Parameters!</h3>
<p>It was hard to find any updating doc that didn&#8217;t just say &#8220;to update, just invoke the ActiveResource-derived object save method&#8221;. Which sounds great in theory, but didn&#8217;t work, because the default implementation of save POSTS all attributes, even those that are considered immutable, to the web service endpoint. For instance, my MonitorInstance class has an id field that is immutable. That field is posted with all other (mutable) fields. There is a method in ActiveResource to remove all immutable/protected attributes, but that method calls an undefined logger object to notify you that you are trying to modify an immuatble attribute, and an exception is raised.</p>
<p>To get around this, I stripped the immutable attribute &#8212; the id &#8212; out of the incoming params hash of the controller update method (in the Rails app) &#8212; see the bolded text below:</p>
<p><em>class StatisticsController</em></p>
<p><em> &#8230;<br />
</em></p>
<p><em> # PUT /statistics/1<br />
# PUT /statistics/1.xml<br />
def update<br />
@statistic = Statistic.find(params[:id])</em></p>
<p><em>if(params[:statistic])<br />
logger.debug(params[:statistic].inspect)<br />
<strong>if(params[:statistic][:id] != nil)<br />
logger.debug(&#8220;removing ID from input params!&#8221;)<br />
params[:statistic].delete(:id)<br />
end</strong><br />
end<br />
respond_to do |format|<br />
if @statistic.update_attributes(params[:statistic])</em></p>
<p><em> &#8230;</em></p>
<p><em> end</em></p>
<p><em> &#8230;</em></p>
<p><em> end</em></p>
<p><em> &#8230;.</em></p>
<p><em>end</em></p>
<h3>Nested Resources</h3>
<p>The StatisticsController above handles all posts to Statistics resources, which are 1..N measurements associated with a monitor. In order to enforce that kind of scoping in the request path, I need to update the monitor_instances routes to scope the statistics routes:</p>
<p><em>#map.resources :statistics</em></p>
<p><em>map.resources :monitor_instances, :has_many =&gt; [:statistics]<br />
</em></p>
<p>In the statistics controller, I now need to always be aware of the &#8216;owner&#8217; MonitorInstance. I do this by adding a before_filter, a method that gets invoked prior to every method being called:</p>
<p><em>before_filter :find_monitor_instance</em></p>
<p>This before_filter corresponds to the find_monitor_instance method, which returns the appropriate MonitorInstance:</p>
<p><em>private</em></p>
<p><em>def find_monitor_instance<br />
@monitor_instance = MonitorInstance.find(params[:monitor_instance_id])<br />
end</em></p>
<p>Now I have an attribute that I can refer to in my controller. Note that in all of the controller methods that handle both REST and page requests, I need to scope my model requests/updates with the @monitor_instance variable:</p>
<p><em>def index<br />
@statistics = Statistic.find(:all,:conditions=&gt;<strong>{:monitor_instance_id=&gt;@monitor_instance.id}</strong>)</em></p>
<p><em>respond_to do |format|<br />
format.html # index.html.erb<br />
format.xml  { render <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml =&gt; @statistics }<br />
end<br />
end</em></p>
<p>I can also take advantage of RAILS path freebies. For instance, after a create request for statistic, I redirect to the appropriate monitor_instance scoped path like this:</p>
<p><em> if @statistic.save<br />
flash[:notice] = &#8216;Statistic was successfully created.&#8217;<br />
format.html { redirect_to(<strong>monitor_instance_statistic_path(@monitor_instance,@statistic)</strong>) }<br />
format.xml  { render <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml =&gt; @statistic.to_xml, :status =&gt; :created, :location =&gt; <strong>monitor_instance_statistic_path(@monitor_instance,@statistic)</strong> }<br />
else</em></p>
<p>monitor_instance_statistic_path generates a path that looks like <em><strong>{path to server}/monitor_instances/1/statistics/3.html or .xml</strong></em> depending on the requested output format.</p>
<h3>Some Helpful Links:</h3>
<p><a href="http://api.rubyonrails.org/classes/ActiveResource/Base.html">ActiveResource RDoc</a></p>
<p><a href="http://74.125.95.104/search?q=cache:FwoGPg_BZUAJ:ryandaigle.com/assets/2007/3/14/REST_ARes.pdf+ActiveResource+nested+resources&amp;hl=en&amp;ct=clnk&amp;cd=1&amp;gl=us&amp;client=firefox-a">REST + ActiveResource</a></p>
<p>Comments from <a href="http://railscasts.com/episodes/95-more-on-activeresource">this Railscast</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/95/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/95/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=95&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/09/11/activeresource-as-a-web-servicification-tool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>Is Search Really Broken?</title>
		<link>http://arunxjacob.wordpress.com/2008/07/07/is-search-really-broken/</link>
		<comments>http://arunxjacob.wordpress.com/2008/07/07/is-search-really-broken/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 05:51:44 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=78</guid>
		<description><![CDATA[It&#8217;s July 2008, and I&#8217;m looking around wondering how many people think search is broken. Actually, I&#8217;m searching around wondering how many people think search is broken. And, using this method, I&#8217;ve been able to deduce the following (from the first page of results, no less):

search is broken because publishers have to put additional metadata/markup [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=78&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s July 2008, and I&#8217;m looking around wondering how many people think search is broken. Actually, I&#8217;m <a href="http://www.google.com/search?q=search+is+broken&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official">searching around</a> wondering how many people think search is broken. And, using this method, I&#8217;ve been able to deduce the following (from the first page of results, no less):</p>
<ol>
<li>search is broken because publishers <a href="http://www.siliconvalleywatcher.com/mt/archives/2007/03/is_search_broke.php">have to put additional metadata/markup</a> on the pages/sites they want found, in addition to sitemaps, no-follow, robots.txt, etc.</li>
<li>search is broken because when I want to find something, I <a href="http://www.micropersuasion.com/2007/10/search-is-broke.html">have to look in so many different places</a>.</li>
<li>search is broken because there needs to be a <a href="http://enkerli.wordpress.com/2008/03/21/is-search-broken-some-mahalo-insight/">human editorial overlay</a> in order to achieve useful result precision.</li>
<li>search is broken because search applications are not <a href="http://thenoisychannel.blogspot.com/2008/05/is-search-broken.html">telepathic</a>, i.e. they cannot perceive context and other subtle metadata in a user search request.</li>
</ol>
<p>All of the above is more or less accurate (though IMO #1 is kind of whiny and #4 is unrealistic), but at the same time there is good evidence that <a href="http://www.clickz.com/showPage.html?page=3626741">search actually does work for most people most of the time</a>. And search, as a knowledge acquisition paradigm, has become incredibly ingrained in people&#8217;s usage patterns. At <a href="http://evri.com">Evri</a> the #1-with-a-bullet question we always get asked is &#8220;where is search?&#8221;</p>
<p>I dont think that a yes/no answer to the  question &#8216;Is Search Broken&#8217; does that question, or the technology behind it, any justice at all. I can say that from the perspective of a software engineer, the fact that I can ask a question at any time of the day and get an answer back in hundreds of milliseconds (<a href="http://www.comcast.com/customers/faq/FaqDetails.ashx?ID=2580">COMCASTically</a> of course) is just amazing. The relative precision and especially the recall is mind blowing. The <a href="http://googlesystem.blogspot.com/2006/06/project-02-googles-secret-data-center.html">rumor/FUD about Google infrastructure</a> is scary and exciting at the same time. The fact that <a href="http://en.wikipedia.org/wiki/Tf-idf">TF/IDF</a> works as well as it does proves that Simplicity does equal Elegance.</p>
<p>When I take a more philosophical viewpoint of search, I have to say that the way I take search for granted and have completely <a href="http://www.wongjason.com/2007/10/26/outsourcing-your-brain/">outsourced my long term memory</a> is very scary. I have voluntarily ceded control of information in my head and traded it for the ability to retrieve that information. Which gives me a lot more apparent bandwidth, as long as there is a computer nearby <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Still, while the implementation, and more importantly, the functionality of search is something so powerful that I cannot function without it,  I do see some challenges ahead for the traditional search model:</p>
<ol>
<li>Content and the traffic generated by users wanting to access that content are growing: specifically, traffic is expected to grow at <a href="http://gigaom.com/2008/06/16/big-growth-for-internet-to-continue-cisco-predicts/">46 percent annually between now and 2012</a>, while the amount of content available continues to skyrocket upward.</li>
<li>Content is morphing from text based documents to include videos and audio.  Search is not keeping up.  Currently, most video/audio content is not considered &#8217;searchable&#8217;, other than by associated metadata. There are some attempts to change this, i.e. <a href="http://www.delvenetworks.com">delve networks</a> for video search, but by and large search cannot &#8212; in it&#8217;s current incarnation &#8211; treat video, audio, or image data as equivalent content to documents.</li>
<li>People are turning to less machine driven means of finding out information &#8212; <a href="http://www.mahalo.com/">Mahalo</a> is an example of editorialized search, and <a href="http://en.wikipedia.org">Wikipedia</a>, while not exactly a search engine, can be used like one if you use Firefox.</li>
</ol>
<p>That last two points taken together are pretty interesting, because in this age of massive document recall, people are veering towards precision, and precision across media types. People want content &#8212; video, text, image &#8212; to be fused together into a single result page, not a result set. The <a href="http://en.wikipedia.org/wiki/Lance_Armstrong">Lance Armstrong Wikipedia Page</a> and the  <a href="http://www.mahalo.com/Lance_Armstrong">Lance Armstrong Mahalo result page</a> provide a much more readable information set than the <a href="http://www.google.com/search?q=lance+armstrong">Lance Armstrong Google result page</a>.</p>
<p>Implicit in those edited result sets is that the information is one click closer &#8212; the salient facts about Lance are front and center, not (just) in the first returned document. Search has made us very good at &#8217;search, inspect, reject, repeat&#8217;, in which we sift through keyword results and painstakingly evaluate the returned documents like ancient priests must have sifted through tea leaves, or entrails, or whatever their search engine result set was. Edited page result sets present that information in a page view that we can actually browse.</p>
<p>I don&#8217;t think editorialized pages are the right answer, mainly because they cannot possibly scale, and the amount of human effort required to keep them up to date is massive. I think the next internet scale &#8216;killer app&#8217; must provide complete fusion of search results across media types into a single, focused page per entity, that changes in response to real world events and doesn&#8217;t rely on an army of editors to keep it up to date. That&#8217;s definitely a holy grail, but one worth  shooting for if we want to have any hope of keeping the internet as useful &#8212; if not more useful &#8212; than it is today.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/78/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/78/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=78&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/07/07/is-search-really-broken/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>Evri Goes Beta!</title>
		<link>http://arunxjacob.wordpress.com/2008/06/26/evri-goes-beta/</link>
		<comments>http://arunxjacob.wordpress.com/2008/06/26/evri-goes-beta/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 08:11:57 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=77</guid>
		<description><![CDATA[Whew! Its been an exciting couple of weeks as we&#8217;ve gone through our first launch, but it&#8217;s official: Evri has a real beta release, and we&#8217;re telling the world.
It&#8217;s been two and a half years since I started down this road, building our very first, very crude prototype in a couple of weeks, and walking [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=77&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Whew! Its been an exciting couple of weeks as we&#8217;ve gone through our first launch, but it&#8217;s official: <a href="http://evri.com">Evri</a> has a real beta release, and we&#8217;re <a href="http://www.techcrunch.com/2008/06/24/evri-launches-semantic-content-discovery-engine-in-private-beta/">telling the world</a>.</p>
<p>It&#8217;s been two and a half years since I started down this road, building our very first, very crude prototype in a couple of weeks, and walking into the first demo knowing that we were onto something big, even if we didn&#8217;t know what that really meant.  I consider myself very lucky to have had the opportunity to dive headfirst into such an engrossing, challenging space over the last couple of years, it&#8217;s been a great ride with a great team!</p>
<p>Neil&#8217;s <a href="http://blog.evri.com/index.php/2008/06/24/little-room/">blog post</a> says it much better than I could ever rehash it (but I&#8217;ll try anyway): we are building a data graph of the web, a  set of people, places, things, concepts, connected by specific relationships harvested from relevant content. The company motto: <em><strong>&#8220;search less. understand more.&#8221;</strong></em> is our way of saying that we have something truly <a href="http://whatis.techtarget.com/definition/0,,sid9_gci945822,00.html">disruptive</a>: this is not search <a href="http://en.wikipedia.org/wiki/Nigel_Tufnel">gone to eleven</a>, or Wikipedia on steroids, but something much more powerful that gets around the current, completely disjoint user experience of &#8220;search, then browse, then search some more, then forget what you were originally searching for&#8221;.</p>
<p>Check it out!  <a href="http://evri.com/">Sign up,</a> and, most importantly, <a href="mailto:info@evri.com">tell us what you think</a>, so we can make it (even) better.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/77/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/77/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=77&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/06/26/evri-goes-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>The Cron of Tab</title>
		<link>http://arunxjacob.wordpress.com/2008/06/19/the-cron-of-tab/</link>
		<comments>http://arunxjacob.wordpress.com/2008/06/19/the-cron-of-tab/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 06:03:45 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=74</guid>
		<description><![CDATA[Damn, setting up crons was supposed to be a walk in the park, so much so that I didn&#8217;t even budget mental energy for it! Maybe that was the problem&#8230;
Anyways, lessons learned from setting up simple cron jobs.

How-Tos are good, but man is better.
crontab -e will either load your current crontab, or load a blank [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=74&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Damn, setting up crons was supposed to be a walk in the park, so much so that I didn&#8217;t even budget mental energy for it! Maybe that was the problem&#8230;</p>
<p>Anyways, lessons learned from setting up simple cron jobs.</p>
<ol>
<li><a href="https://help.ubuntu.com/community/CronHowto">How-Tos</a> are good, but <a href="http://www.manpagez.com/man/5/crontab/">man</a> is better.</li>
<li>crontab -e will either load your current crontab, or load a blank template for you.</li>
<li>crontab -r will kill your current crontab. Which is why it&#8217;s nice to keep the output of crontab -l, which lists your crontab jobs, in a backup file. Because unless you like setting up crons, you don&#8217;t want to be left high and dry without a backup.</li>
<li>try running your jobs before putting them in the crontab. Or, if you&#8217;re like me, do crontab -l, cut and paste, and figure out why /usr/local/binruby is not the command you want (/usr/local/bin/ruby was what I was looking for).</li>
<li>to make sure your jobs are running, tail -f /var/log/syslog. Note that this doesn&#8217;t tell you if they&#8217;re crap or not.</li>
<li>Or, append your output to a log, and check to see that the log is growing.</li>
</ol>
<p>I&#8217;m still kind of cruxing about how I&#8217;m going to run this on a deployed app. I think I&#8217;m going to have to get ops to add deploy_user, and add the crons on deploy_user&#8217;s behalf. Of course, I&#8217;ll worry about that when I can actually smoothly install mod_rails on my semi jacked up box. I must be the only tard in the universe who screwed up a mod_rails install, but more on that tomorrow.</p>
<h3>Tomorrow (er, 1 week later)</h3>
<p>In the mad rush to <a href="http://blog.evri.com/">launch</a> (more later), I forgot to update this page, which is bad because this is my scratchpad that has more than once saved me from repeating a painful process. Summary: anyone installing mod rails should take 4 minutes and view the <a href="http://www.modrails.com/videos/passenger.mov">railscast</a>. I was missing the following in my conf file:</p>
<p><code><br />
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so<br />
RailsSpawnServer /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server<br />
RailsRuby /usr/local/bin/ruby<br />
</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/74/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/74/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=74&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/06/19/the-cron-of-tab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.modrails.com/videos/passenger.mov" length="18988364" type="video/quicktime" />
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>Metrics Part IV: RRDTool on Ubuntu 7.04 (Feisty)</title>
		<link>http://arunxjacob.wordpress.com/2008/06/19/rrdtool-on-ubuntu-704-feisty/</link>
		<comments>http://arunxjacob.wordpress.com/2008/06/19/rrdtool-on-ubuntu-704-feisty/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 04:34:59 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=72</guid>
		<description><![CDATA[The production instance of this metrics server is going to run on Ubuntu Feisty, which comes installed with rrdtool 1.2, but the ruby bindings I want (need) to use bind to 1.3. So this is how to install rrdtool on Feisty.
(1) download the source:
curl http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz &#62; rrdtool.tar.gz
then follow the instructions rrdbuild page : basically,
./configure
sudo make
sudo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=72&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The production instance of this metrics server is going to run on Ubuntu Feisty, which comes installed with rrdtool 1.2, but the ruby bindings I want (need) to use bind to 1.3. So this is how to install rrdtool on Feisty.</p>
<p>(1) download the source:</p>
<p><code>curl http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz &gt; rrdtool.tar.gz</code></p>
<p>then follow the instructions <a href="http://oss.oetiker.ch/rrdtool/doc/rrdbuild.en.html">rrdbuild</a> page<a href="http://oss.oetiker.ch/rrdtool/doc/rrdbuild.en.html"></a> : basically,</p>
<p><code>./configure</code></p>
<p>sudo make</p>
<p>sudo make install</p>
<p>However, in order to get configure to complete, I needed to install a couple of dependencies, pango and xml-2. I like configure, it&#8217;s very good about telling you what is missing and where to get it. And the rrdbuild page is also great at specifying exactly how to install the missing packages.</p>
<p>I figured I was up and running at that point. I built the ruby bindings from {src dir}/bindings/ruby, but when I tried to run the  files  I had been running on my Mac, I got:</p>
<p><code>/usr/local/lib/ruby/site_ruby/1.8/x86_64-linux/RRD.so: librrd.so.4: cannot open shared object file: No such file or directory - /usr/local/lib/ruby/site_ruby/1.8/x86_64-linux/RRD.so (LoadError)<br />
</code></p>
<p>NOT COOL.</p>
<p>How can a file that exists, /usr/local/lib/ruby/site_ruby/1.8/x86_64-linux/RRD.so, not be found? Was it a permissions thing? I tried building as sudo, same thing. Then I made sure that the file actually existed, just to check my head. Yes, it&#8217;s there. Yes, I&#8217;m getting the same error. Wait. Could it be the librrd.so ? I try a</p>
<p><code>ldconfig -v | grep rrd</code></p>
<p>and only get librrd.so.2. Hmmm. OK, desperate times&#8230;I edit /etc/ld.so.conf.d/local-installs.conf, and add</p>
<p><code>/usr/local/rrdtool-1.3.0/lib<br />
</code></p>
<p>to the path. That worked. The ops team is not going to be super thrilled about the amount of jackassery it took to get this up and running, which is why I&#8217;m documenting it here. Because they&#8217;ll make me maintain it. Just like I would if I were in their shoes <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/72/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/72/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=72&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/06/19/rrdtool-on-ubuntu-704-feisty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>Metrics Fast &#8216;n Easy, part III: accessing Rails goodies outside of a Rails app</title>
		<link>http://arunxjacob.wordpress.com/2008/06/18/metrics-fast-n-easy-part-iii-accessing-rails-goodies-outside-of-a-rails-app/</link>
		<comments>http://arunxjacob.wordpress.com/2008/06/18/metrics-fast-n-easy-part-iii-accessing-rails-goodies-outside-of-a-rails-app/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 04:31:44 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=71</guid>
		<description><![CDATA[The basic architecture of this (very simple) metrics gathering and display application is:

Scripts run as crons from within the rails directory. Every minute, the cron wakes up and checks the database for the last time run and the poll interval. If they are
They update RRD files and generate .pngs that reside in the rails /public [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=71&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The basic architecture of this (very simple) metrics gathering and display application is:</p>
<ol>
<li>Scripts run as crons from within the rails directory. Every minute, the cron wakes up and checks the database for the last time run and the poll interval. If they are</li>
<li>They update RRD files and generate .pngs that reside in the rails /public dir.</li>
<li>they update the latest value, and the last time run.</li>
</ol>
<p>The scripts and the rails app intersect at two points:</p>
<ul>
<li>the interval and last time polled</li>
<li>the generated PNG file.</li>
</ul>
<p>I may choose to store and display the last collected value, but that will happen after getting feedback from my customers (the development, operations,  and product teams).</p>
<p>Since the script has to check the interval and the last time polled, it needs access to the database. I naturally wanted to use the ActiveRecord classes that I use in the rails app, I also wanted access to rails environment variables, like RAILS_ROOT.</p>
<p>By requiring environment.rb:</p>
<p><code>require File.dirname(__FILE__) + '/../../config/environment.rb'</code></p>
<p>I was able to get rails like behavior into my scripts.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/71/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/71/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=71&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/06/18/metrics-fast-n-easy-part-iii-accessing-rails-goodies-outside-of-a-rails-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>Metrics Fast &#8216;n Easy, Part II: actually using RRDTool from Ruby</title>
		<link>http://arunxjacob.wordpress.com/2008/06/14/metrics-fast-n-easy-part-ii-actually-using-rrdtool-from-ruby/</link>
		<comments>http://arunxjacob.wordpress.com/2008/06/14/metrics-fast-n-easy-part-ii-actually-using-rrdtool-from-ruby/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 20:53:20 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=69</guid>
		<description><![CDATA[Continued from part I:
Now that the RRD bundle is installed in Ruby&#8217;s default load path, I require RRD and access the convenience methods. The methods basically pass all parameters in as strings, which is fine, but I don&#8217;t like thinking of time and values as strings if I can avoid it. So I wrote a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=69&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h3>Continued from <a href="http://arunxjacob.wordpress.com/2008/06/10/metrics-fast-n-easy-with-rrdtool-and-ruby-part-1-installing-rrdtool-and-ruby-bindings-on-a-mac/">part I:</a></h3>
<p>Now that the RRD bundle is installed in Ruby&#8217;s default load path, I require RRD and access the convenience methods. The methods basically pass all parameters in as strings, which is fine, but I don&#8217;t like thinking of time and values as strings if I can avoid it. So I wrote a wrapper class that allows me to pass in values as typed options, and then casts them to the internal strings.</p>
<p>A couple of notes about creating, updating, and rendering RRD graphs using the built in Ruby binding.</p>
<h3>Creating an RRD graph</h3>
<p>At create time, the first parameter is the name of the file, minus the .rrb extension (create will puke if you specify the extension). The start time  is expressed in seconds, my code below passed it in as a Time object and converts it to seconds. The step time is the minimal amount of time an update can occur at &#8212; in other words, if your step is 50 seconds and you try to update at 10 seconds, you get an error.</p>
<p>The DS option defines a dataset as follows:</p>
<p>DS:[name]:[graph type]:[min time to show an error condition]:[min value or unknown]:[max value or unknown].  More explanation of the suitable graph types is found <a href="http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html">here</a>.</p>
<p><code> RRD.create(<br />
name,<br />
"--start", "#{@start.to_i}",<br />
"--step", "#{@step}",<br />
"DS:#{@dataset}:#{@type}:#{@heartbeat}:#{@min}:#{@max}",<br />
"RRA:#{@collapse_method}:#{@xff}:#{@collapse_steps}:#{@collapse_rows}")<br />
</code></p>
<p>In the example above, I only create a single dataset. You can create 1..N, although I&#8217;m sure N has an upper limit, I haven&#8217;t found it specified anywhere. Also, I believe the data set is restricted to &lt; 19 characters in length. The RRA section syntax is as follows:<br />
<code><strong>RRA:</strong><em>AVERAGE | MIN | MAX | LAST</em><strong>:</strong><em>xff</em><strong>:</strong><em>steps</em><strong>:</strong><em>rows</em></code><br />
where the collapsing is done by averaging values, or min/maxing values, the <em>xff</em> value specified limits unknown values from being collapsed by establishing a max ratio of unknown values to known values. The <em>steps</em> value specifies the number of datapoints collapsed, and the <em>rows</em> value specifies how many collapsed datapoints to keep. So RRA is where you really get a chance to limit the size of the RRD file.</p>
<h3>Updating an RRD Graph</h3>
<p>Once the graph has been created, it exists as the file you specified using the <em>name</em> parameter above. You update it with  time:value statements: in the code below, I&#8217;m updating an array of time:value statements:<br />
<code># simple update of multiple values<br />
def update(times, values)</code><br />
<code><br />
for i in 0..times.length-1</code></p>
<p>RRD.update(@name,&#8221;#{times[i].to_i}:#{values[i]}&#8221;)<br />
end<br />
end</p>
<p>In the code above, as for all RRD operations, you specify the name of the RRD file you want to operate on in the first parameter.</p>
<p>Note that you cannot update a graph with a time less than it&#8217;s start time or a time that is less then the last time + the step time specified at creation.</p>
<h3>Displaying an RRD Graph:</h3>
<p>Graph display is the most complex operation with RRD. I&#8217;m not going to go into all of the details: some really good examples are found <a href="http://oss.oetiker.ch/rrdtool/doc/rrdgraph_examples.en.html">here</a>.</p>
<p>I&#8217;ve taken the simplest approach to displaying a graph:<br />
<code><br />
RRD.graph(<br />
renderedFile,<br />
"--title", title,<br />
"--start", start.to_i.to_s,<br />
"--end", finish.to_i.to_s,<br />
"--interlace",<br />
"--imgformat", "PNG",<br />
"--width=#{width}",<br />
"DEF:a=#{@name}:#{@dataset}:AVERAGE",<br />
"LINE1:a#0022e9:#{@dataset}")<br />
</code></p>
<p>Unlike the update method, the name of the actual desired graph is the first parameter, not the name of the RRD file. The RRD file to load is specified in the DEF line. You can specify multiple  DEF values to display dataset from different RRD graphs. You will need to specify the way you want each dataset rendered: in the above example, I define a value <em>a</em> with the <em>DEF</em> statement that I reference in the following <em>LINE</em> statement:</p>
<p>In order to render data, you will need to specify how you want to display it with( as a line, as area under a line, as a tick mark, etc). More details about how to define data sets, including creating datasets via the CDEF statement, are found in the <a href="http://oss.oetiker.ch/rrdtool/doc/rrdgraph_data.en.html">graph data</a> documentation. Details about how to display data are in the <a href="http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html">rrdgraph method</a> documentation.  The format of the DEF, CDEF, LINE statements is RPN, i.</p>
<p>Make sure to specify start and end in a way that shows values as you would like to see them, i.e. make sure your latest value is in the specified start and end range.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/69/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/69/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=69&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/06/14/metrics-fast-n-easy-part-ii-actually-using-rrdtool-from-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
		<item>
		<title>Metrics fast &#8216;n easy (?) with RRDTool and Ruby: Part 1: Installing RRDTool and ruby bindings on a Mac</title>
		<link>http://arunxjacob.wordpress.com/2008/06/10/metrics-fast-n-easy-with-rrdtool-and-ruby-part-1-installing-rrdtool-and-ruby-bindings-on-a-mac/</link>
		<comments>http://arunxjacob.wordpress.com/2008/06/10/metrics-fast-n-easy-with-rrdtool-and-ruby-part-1-installing-rrdtool-and-ruby-bindings-on-a-mac/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 20:37:58 +0000</pubDate>
		<dc:creator>arunxjacob</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://arunxjacob.wordpress.com/?p=67</guid>
		<description><![CDATA[I&#8217;m trying to set up a simple heads up display of key information about our running system as we move towards releasing our first product. This display is grouped into themes, each theme contains 1..N graphs of relevant system data.
As a manager this is not my full time job, so I didn&#8217;t to get into [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=67&subd=arunxjacob&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m trying to set up a simple heads up display of key information about our running system as we move towards releasing our first product. This display is grouped into themes, each theme contains 1..N graphs of relevant system data.</p>
<p>As a manager this is not my full time job, so I didn&#8217;t to get into navel gazing mode wrt the  &#8216;ultimate&#8217;  stats monitoring system, especially since that wheel has already been invented. I settled on using RRDTool to display statistics, mainly because RRDTool has pretty advanced, robust ways to age data out, while keeping the database down to a finite size. It also generates PNG files, which I could update and throw up on a page as needed. There would be a need to track application specific metadata (like what each graph maps to), but no need to handle storing and retrieving metrics data, which gets me (and the poor bastard that inherits this tool) out of a world of pain.</p>
<p>It&#8217;s been years since I&#8217;ve set up RRDTool, and that was on a Red Hat system. Now I&#8217;m a Mac fanboy, and so here are my notes on how to set up RRDTool with Ruby binding on Mac OSX Tiger.</p>
<p>RRDTool can be installed via <a href="http://www.macports.org/">mac ports</a> which makes pulling in the dependencies &#8216;not my problem&#8217;&#8211; the best kind of problem to have <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> :</p>
<p><code>sudo port install rrdtool</code></p>
<p>To build the ruby binding, you need to get the source from <a href="http://oss.oetiker.ch/rrdtool/pub/?M=D">here</a>. The ruby binding is in <code>{src folder}/bindings/ruby</code>. In order to get the generated Makefile to point to the installed rrd libs, you need to change the following line in extconf.rb:</p>
<p><code>dir_config("rrd","../../src","../../src/.libs")</code></p>
<p>to</p>
<p><code>dir_config("rrd","../../src","/opt/local/lib")</code></p>
<p>Then run</p>
<p><code>ruby extconf.rb</code></p>
<p>to generate the makefile, then</p>
<p><code>make</code></p>
<p>and</p>
<p><code>make install</code></p>
<p>to respectively build and then install the RRD.bundle to <code>/opt/local/lib/ruby/site_ruby/1.8/i686-darwin8.9.1</code></p>
<p>To confirm that things have run successfully:</p>
<p><code>ruby test.rb</code> should generate a <code>test.png</code> file.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arunxjacob.wordpress.com/67/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arunxjacob.wordpress.com/67/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arunxjacob.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arunxjacob.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arunxjacob.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arunxjacob.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arunxjacob.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arunxjacob.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arunxjacob.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arunxjacob.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arunxjacob.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arunxjacob.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arunxjacob.wordpress.com&blog=152823&post=67&subd=arunxjacob&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arunxjacob.wordpress.com/2008/06/10/metrics-fast-n-easy-with-rrdtool-and-ruby-part-1-installing-rrdtool-and-ruby-bindings-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1d6a720a54fddbb869737d5714fa1ce6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arunxjacob</media:title>
		</media:content>
	</item>
	</channel>
</rss>