<div dir="ltr">There&#39;s an easier way to track them. <div><br></div><div>In Mondrian 3.3.X, we have introduced the Mondrian monitor API. </div><div><br></div><div>







<p class=""><font face="courier new, monospace"><span class="">        </span>    <span class="">final</span> Monitor monitor =</font></p>
<p class=""><font face="courier new, monospace">            MondrianServer.forConnection(<span class="">rolapConnection</span>)</font></p>
<p class=""><font face="courier new, monospace"><span class="">        </span>            .getMonitor();</font></p><p class="">Through the monitor, you can get all sorts of interesting metrics, like the MDX queries running, which SQL statements they have created, how many cells from the cache were hits &amp; misses, and much more. Would that be of help?</p>

<p class="">We also have a branch with JMX support, but we haven&#39;t had much traction for that feature so it stayed on the back burner for a while now. Maybe now&#39;s the time to resurrect it.</p></div><div class="gmail_extra">

Luc</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 4, 2014 at 10:02 AM, Baldwin, Bob <span dir="ltr">&lt;<a href="mailto:robert.w.baldwin@truvenhealth.com" target="_blank">robert.w.baldwin@truvenhealth.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">We are currently trying to map a user request for a report to the MDX and the SQL generated by Mondrian.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">To do this we are intercepting the “mondrian.mdx” and “mondrian.sql” loggers with a new slf4j appender (we are bridging log4j to slf4j) to write the MDX and subsequent SQL to a database log. In an attempt to map the MDX and SQL to a specific
 request by user, we are setting MDC values to be used by the appender when Mondrian kicks off the log. This works fine if enough time occurs between requests to Mondrian as a new executor thread is created.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The problem, for us, occurs when a the executor thread is reused. Instead of the new MDC values being propagated to the executor, they are persisting because it’s the same thread, instead of a new one which would inherit the new MDC properties
 from the parent thread. <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is there a way to accurately track the MDX and SQL ran per request to Mondrian and map that back to the requesting thread? I suspect forcing a new executor thread every time would solve this (if possible) but I worry about the performance
 implications of doing that.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks for any help/direction.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#0072ce">Truven Health Analytics<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a">Bob Baldwin</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a"><br>


Software Engineer</span><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a"><br>
<br>
</span><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#0072ce">Truven Health Analytics</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a"><br>


</span><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a">O:</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a"> <a href="tel:734.786.5365" value="+17347865365" target="_blank">734.786.5365</a><br>


</span><a href="mailto:robert.w.baldwin@truvenhealth.com" target="_blank"><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue">robert.w.baldwin@truvenhealth.com</span></a><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#0072ce"><br>


<a href="http://truvenhealth.com" target="_blank">truvenhealth.com</a></span><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a"><br>
<br>
</span><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#0072ce"><img border="0" width="300" height="51" src="cid:image001.gif@01CF4F55.1B5A2220" alt="Truven Health Analytics"></span><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a"> </span><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#0072ce"><u></u><u></u></span></p>


<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>_______________________________________________<br>
Mondrian mailing list<br>
<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>
<a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
<br></blockquote></div><br></div></div>