<?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>Altentee &#187; Performance &#38; Test Automation Experts &#187; JVM</title>
	<atom:link href="http://altentee.com/tag/jvm/feed/" rel="self" type="application/rss+xml" />
	<link>http://altentee.com</link>
	<description>Performance and Test Automation Experts</description>
	<lastBuildDate>Sat, 12 Jun 2010 00:35:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Script to Remotely Parse a GC Log</title>
		<link>http://altentee.com/2009/a-script-to-remotely-parse-a-gc-log/</link>
		<comments>http://altentee.com/2009/a-script-to-remotely-parse-a-gc-log/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 01:47:23 +0000</pubDate>
		<dc:creator>Tim Koopmans</dc:creator>
				<category><![CDATA[90kts]]></category>
		<category><![CDATA[Altentee]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://90kts.com/blog/2009/a-script-to-remotely-parse-a-gc-log/</guid>
		<description><![CDATA[<p>Here&#8217;s a simple Ruby script that will parse a remote GC log using Perl for specific date time entries. The scenario in which you might use this script is where you have rather large remote GC logs sitting on another platform like AIX that doesn&#8217;t have Ruby installed. It&#8217;s useful in the sense you can [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple Ruby script that will parse a remote GC log using Perl for specific date time entries. The scenario in which you might use this script is where you have rather large remote GC logs sitting on another platform like AIX that doesn&#8217;t have Ruby installed. It&#8217;s useful in the sense you can execute a load test, then just parse the GC log for the entries from the native_stderr.log that represent your test run. YMMV.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># notes: make sure you escape slashes and quotes in the regex</span>
<span style="color:#008000; font-style:italic;"># libs:  you will need to install SSH libraries for Ruby from DOS</span>
<span style="color:#008000; font-style:italic;"># set HTTP_PROXY=http://username:password@proxy.local:80</span>
<span style="color:#008000; font-style:italic;"># gem install net-ssh</span>
<span style="color:#008000; font-style:italic;"># gem install net-sftp</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/ssh'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/sftp'</span>
&nbsp;
<span style="color:#0066ff; font-weight:bold;">@HOST</span>  = <span style="color:#996600;">&quot;remote.host&quot;</span>
<span style="color:#0066ff; font-weight:bold;">@USER</span>  = <span style="color:#996600;">&quot;username&quot;</span>
<span style="color:#0066ff; font-weight:bold;">@PASS</span>  = <span style="color:#996600;">&quot;********&quot;</span>
<span style="color:#0066ff; font-weight:bold;">@PATH</span>  =
<span style="color:#996600;">&quot;/opt/websphere/portalserver/6.0/portalserver/native_stderr.log&quot;</span>
<span style="color:#0066ff; font-weight:bold;">@SDATE</span> = <span style="color:#996600;">&quot;Aug 11 10:0<span style="color:#000099;">\\</span>d+&quot;</span>
<span style="color:#0066ff; font-weight:bold;">@EDATE</span> = <span style="color:#996600;">&quot;Aug 11 11:0<span style="color:#000099;">\\</span>d+&quot;</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">Net::SSH</span>.<span style="color:#9900CC;">start</span><span style="color:#006600; font-weight:bold;">&#40;</span>@HOST, <span style="color:#0066ff; font-weight:bold;">@USER</span>, <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@PASS</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>ssh<span style="color:#006600; font-weight:bold;">|</span>
   <span style="color:#008000; font-style:italic;"># parse log</span>
   ssh.<span style="color:#CC0066; font-weight:bold;">exec</span> <span style="color:#996600;">&quot;perl -e '
   open(I, <span style="color:#000099;">\&quot;</span>&lt; #{@PATH}<span style="color:#000099;">\&quot;</span>);
   open(O, <span style="color:#000099;">\&quot;</span>&gt; /tmp/native_stderr.log<span style="color:#000099;">\&quot;</span>);
   while(&lt;i&gt;) {
    $found = 1 if /#{@SDATE}/;
    $found = 0 if /#{@EDATE}/;
    print O $_ if $found &gt; 0;
   }
   close(I);
   close(O)'&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">Net::SFTP</span>.<span style="color:#9900CC;">start</span><span style="color:#006600; font-weight:bold;">&#40;</span>@HOST, <span style="color:#0066ff; font-weight:bold;">@USER</span>, <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@PASS</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>sftp<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#008000; font-style:italic;"># download the truncated log</span>
   sftp.<span style="color:#9900CC;">download</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;/tmp/native_stderr.log&quot;</span>, <span style="color:#996600;">&quot;C:/native_stderr.log&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://altentee.com/2009/a-script-to-remotely-parse-a-gc-log/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
