<?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>wuetender-junger-mann.de &#187; Musik</title>
	<atom:link href="http://wuetender-junger-mann.de/wordpress/category/musik/feed/" rel="self" type="application/rss+xml" />
	<link>http://wuetender-junger-mann.de/wordpress</link>
	<description>Der Freiheit eine Gasse</description>
	<lastBuildDate>Tue, 08 May 2012 11:59:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Visualising log files with gnuplot</title>
		<link>http://wuetender-junger-mann.de/wordpress/2009/06/visualising-log-files-with-gnuplot/</link>
		<comments>http://wuetender-junger-mann.de/wordpress/2009/06/visualising-log-files-with-gnuplot/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 17:17:28 +0000</pubDate>
		<dc:creator>felix</dc:creator>
				<category><![CDATA[Held der Kommandozeile]]></category>
		<category><![CDATA[Musik]]></category>
		<category><![CDATA[Reading]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Visionäre Projekte]]></category>

		<guid isPermaLink="false">http://wuetender-junger-mann.de/wordpress/?p=768</guid>
		<description><![CDATA[I recently had the pleasure of supporting a new system throughout its first month of production. This was a good opportunity to refresh my command line skills. As it happened I spent a lot of time looking at log files trying to figure out what happened to the productions system. I figured, that a graphical [...]]]></description>
			<content:encoded><![CDATA[<p>
I recently had the pleasure of supporting a new system throughout its first month of production. This was a good opportunity to refresh my command line skills. As it happened I spent a lot of time looking at log files trying to figure out what happened to the productions system. I figured, that a graphical representation of the events would be nice and started using <a href="http://www.gnuplot.info/">gnuplot</a>.</p>
</p>
<p>
First I started out with a bunch of bash scripts, using what your usual unix installation provides, but then I actually came up with <a href="http://github.com/fleipold/logvisualizer/tree/master">some groovy scripts</a> to provide better abstractions. A log file generally looks somewhat like this:
</p>
<pre>
04/01/1970 07:55:13 garbage
04/01/1970 09:27:48 Event 2
04/01/1970 10:01:28 garbage
04/01/1970 10:38:30 garbage
04/01/1970 10:48:36 garbage
04/01/1970 10:51:58 Event 2
04/01/1970 11:03:45 garbage
04/01/1970 11:34:03 Event 1
04/01/1970 12:24:33 garbage
05/01/1970 04:35:50 ERROR
</pre>
<p>
There is a lot of garbage plus some events we might be interested in. It allows to specify events, e.g. by providing a regexp:
</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">Event</span> EVENT1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RegExEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Event 1&quot;</span>, ~<span style="color: #339933;">/</span><span style="color: #003399;">Event</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">/</span><span style="color: #009900;">&#41;</span>
<span style="color: #003399;">Event</span> EVENT2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RegExEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Event 2&quot;</span>, ~<span style="color: #339933;">/</span><span style="color: #003399;">Event</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">/</span><span style="color: #009900;">&#41;</span>
<span style="color: #003399;">Event</span> ERROR <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RegExEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error&quot;</span>, ~<span style="color: #339933;">/</span>ERROR<span style="color: #339933;">/</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>
The next step is newing up a <code>TimeLineVisualizer</code> on these events and passing in a stream with the actual log:
</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">def logFile <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.log&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
logFile.<span style="color: #006633;">withInputStream</span> <span style="color: #009900;">&#123;</span><span style="color: #003399;">InputStream</span> stream <span style="color: #339933;">-&gt;</span>
  def visualizer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TimeLineVisualizer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>
          EVENT1,
          EVENT2,
          ERROR
  <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  visualizer.<span style="color: #006633;">visualize</span><span style="color: #009900;">&#40;</span>stream<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>
If you have the <code>gnuplot</code> binary on your path this will yield something like this:
</p>
<p><img src="http://wuetender-junger-mann.de/wordpress/wp-content/uploads/2009/06/timeline.png" alt="timeline" title="timeline" width="846" class="alignnone size-full wp-image-771" /></p>
<p>
Also in some cases you would like to know which time of day events are most likely to happen. For producing histograms I created another visualizer (which currently takes only one event).
</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">logFile.<span style="color: #006633;">withInputStream</span> <span style="color: #009900;">&#123;</span><span style="color: #003399;">InputStream</span> stream <span style="color: #339933;">-&gt;</span>
  def visualizer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HistogramVisualizer<span style="color: #009900;">&#40;</span>EVENT2, HistogramVisualizer.<span style="color: #006633;">HOUR_OF_DAY_BINS</span><span style="color: #009900;">&#41;</span>
  visualizer.<span style="color: #006633;">visualize</span><span style="color: #009900;">&#40;</span>stream<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>
For the example log file, which unfortunately has an even distribution of events, we get this:
</p>
<p><img src="http://wuetender-junger-mann.de/wordpress/wp-content/uploads/2009/06/histogram.png" alt="histogram" title="histogram" width="846"  class="alignnone size-full wp-image-772" /></p>
<p>
The cool thing about gnuplot is, that you can actually run these things in a cron job to produce daily reports (and mail them to the appropriate people) or on a continuous integration server to visualise how the system is being exercised by the test suite.</p>
]]></content:encoded>
			<wfw:commentRss>http://wuetender-junger-mann.de/wordpress/2009/06/visualising-log-files-with-gnuplot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plötzliche Eingebung</title>
		<link>http://wuetender-junger-mann.de/wordpress/2007/07/plotzliche-eingebung/</link>
		<comments>http://wuetender-junger-mann.de/wordpress/2007/07/plotzliche-eingebung/#comments</comments>
		<pubDate>Sun, 29 Jul 2007 19:56:09 +0000</pubDate>
		<dc:creator>felix</dc:creator>
				<category><![CDATA[Musik]]></category>

		<guid isPermaLink="false">http://wuetender-junger-mann.de/wordpress/?p=507</guid>
		<description><![CDATA[Curt Cobain war definitiv jemand, der immer ein trauriges Lied zu singen wusste&#8230; Waren Samstag im Sticky Fingers, wo noch die gute Musik gespielt wird.]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Kurt_Cobain">Curt Cobain</a> war definitiv jemand, der immer ein trauriges Lied zu singen wusste&#8230;</p>
<p>
Waren Samstag im <a href="http://www.stickyfingers.nu/">Sticky Fingers</a>, wo noch die gute Musik gespielt wird.</p>
]]></content:encoded>
			<wfw:commentRss>http://wuetender-junger-mann.de/wordpress/2007/07/plotzliche-eingebung/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anna Ternheim and the Java Process Class</title>
		<link>http://wuetender-junger-mann.de/wordpress/2007/03/schone-brucke/</link>
		<comments>http://wuetender-junger-mann.de/wordpress/2007/03/schone-brucke/#comments</comments>
		<pubDate>Fri, 09 Mar 2007 15:42:02 +0000</pubDate>
		<dc:creator>felix</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Musik]]></category>
		<category><![CDATA[Software, alt]]></category>

		<guid isPermaLink="false">http://wuetender-junger-mann.de/wordpress/?p=451</guid>
		<description><![CDATA[I just discovered Anna Ternheim, a nice Swedish Singersongwriter. I am listening to here Album Separation Road and try to call an external process from groovy which after all uses the Java API to perform such tasks. Given the slightly depressing nature of the music and the slight drizzle outside, I can’t go on ranting [...]]]></description>
			<content:encoded><![CDATA[<p>I just discovered <a href="http://www.last.fm/music/Anna+Ternheim">Anna Ternheim</a>, a nice Swedish Singersongwriter. I am listening to here Album Separation Road and try to call an external process from groovy which after all uses the Java API to perform such tasks.</p>
<p>Given the slightly depressing nature of the music and the slight drizzle outside, I can’t go on ranting I’m just sitting here sobbing about the sorry state of the world and the hardship of having to deal with java.lang.Runtime and java.lang.Process.</p>
]]></content:encoded>
			<wfw:commentRss>http://wuetender-junger-mann.de/wordpress/2007/03/schone-brucke/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

