<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">From debugging the Monitor, it appears everything I want is being sent to it but I can’t get access to the information (the actual MDX and SQL statements executed)
 in the context I want (after the CellSet is returned).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I thought monitor.getSqlStatements() would get me everything, but each SqlStatementInfo is removed from the internal map upon completion. Therefore, nothing
 is available when I’m trying to get it. And even though some of the information is broadcasted via the Logger for the ‘Mondrian.server’, it takes me back to my original issue of losing the context in which the original statement was generated (a user request).
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Any other ideas or perhaps something I’m missing? We are using Mondrian 3.6.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<p class="MsoNormal"><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:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282A"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> mondrian-bounces@pentaho.org [mailto:mondrian-bounces@pentaho.org]
<b>On Behalf Of </b>Paul Stoellberger<br>
<b>Sent:</b> Monday, April 07, 2014 6:51 AM<br>
<b>To:</b> Mondrian developer mailing list<br>
<b>Subject:</b> Re: [Mondrian] Mapping user requests to mondrian MDX and SQL<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">We expose the Monitor via and endpoint in saiku:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://dev.analytical-labs.com/saiku/rest/saiku/statistics/mondrian">http://dev.analytical-labs.com/saiku/rest/saiku/statistics/mondrian</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">admin / admin<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Was useful to see how connections are opened but never closed (<a href="http://jira.pentaho.com/browse/MONDRIAN-1653">http://jira.pentaho.com/browse/MONDRIAN-1653</a>)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">But so far I wasn't able to make much use of it myself.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Was planning on logging that info every x interval to view changes over time.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">In any case it would be quite useful to know more about whats happening inside mondrian.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">-Paul<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal">On Apr 4, 2014, at 4:54 PM, &quot;Wright, Jeff&quot; &lt;<a href="mailto:jeff.s.wright@truvenhealth.com">jeff.s.wright@truvenhealth.com</a>&gt; wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">In addition to Bob's logging request, it definitely is also appealing to be able to see into what's happening right now. It seems like it would be easy and worthwhile for us to throw together a JSP or servlet to expose the Monitor info
 as a status page, until the JMX interface is available.<br>
<br>
--jeff<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a> [mailto:mondrian-<a href="mailto:bounces@pentaho.org">bounces@pentaho.org</a>] On Behalf Of Matt Campbell<br>
Sent: Friday, April 04, 2014 10:50 AM<br>
To: Mondrian developer mailing list<br>
Subject: Re: [Mondrian] Mapping user requests to mondrian MDX and SQL<br>
<br>
The monitor has always seemed to me like something that could be incredibly useful for larger deployments, and it's a shame it hasn't gotten more usage. &nbsp;Because it hasn't been beat on much in the real world I know there are some cases where it gives incorrect
 numbers (e.g. MONDRIAN-1449), but I'd love to see some work to correct any issues.<br>
<br>
<br>
<br>
________________________________________<br>
From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a> [<a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>] On Behalf Of Wright, Jeff [<a href="mailto:jeff.s.wright@truvenhealth.com">jeff.s.wright@truvenhealth.com</a>]<br>
Sent: Friday, April 04, 2014 10:32 AM<br>
To: Mondrian developer mailing list<br>
Subject: Re: [Mondrian] Mapping user requests to mondrian MDX and SQL<br>
<br>
Luc, the monitor API sounds like a window into what’s going on right now. I think the spirit of Bob’s request is for analysis after the fact. We have Mondrian embedded in an application, and would like to correlate the Mondrian logs to the specific report request
 in the surrounding app, and to have that in an slf4j log.<br>
<br>
The JIRA for JMX has 14 votes right now ☺<br>
<a href="http://jira.pentaho.com/browse/MONDRIAN-1448">http://jira.pentaho.com/browse/MONDRIAN-1448</a><br>
<br>
--jeff<br>
<br>
From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a> [<a href="mailto:mondrian-bounces@pentaho.org">mailto:mondrian-bounces@pentaho.org</a>] On Behalf Of Baldwin, Bob<br>
Sent: Friday, April 04, 2014 10:28 AM<br>
To: Mondrian developer mailing list<br>
Subject: Re: [Mondrian] Mapping user requests to mondrian MDX and SQL<br>
<br>
Thanks Luc for the quick response!<br>
<br>
I’ll investigate the monitor and see if it fits our needs. We would also be interested in the JMX support if that feature were to be resurrected.<br>
<br>
Bob<br>
<br>
From: <a href="mailto:mondrian-bounces@pentaho.org%3cmailto:mondrian-bounces@pentaho.org">
mondrian-bounces@pentaho.org&lt;mailto:mondrian-bounces@pentaho.org</a>&gt; [<a href="mailto:mondrian-bounces@pentaho.org">mailto:mondrian-bounces@pentaho.org</a>] On Behalf Of Luc Boudreau<br>
Sent: Friday, April 04, 2014 10:22 AM<br>
To: Mondrian developer mailing list<br>
Subject: Re: [Mondrian] Mapping user requests to mondrian MDX and SQL<br>
<br>
There's an easier way to track them.<br>
<br>
In Mondrian 3.3.X, we have introduced the Mondrian monitor API.<br>
<br>
&nbsp;&nbsp;&nbsp;final Monitor monitor =<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MondrianServer.forConnection(rolapConnection)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.getMonitor();<br>
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?<br>
We also have a branch with JMX support, but we haven't had much traction for that feature so it stayed on the back burner for a while now. Maybe now's the time to resurrect it.<br>
Luc<br>
<br>
On Fri, Apr 4, 2014 at 10:02 AM, Baldwin, Bob &lt;<a href="mailto:robert.w.baldwin@truvenhealth.com%3cmailto:robert.w.baldwin@truvenhealth.com">robert.w.baldwin@truvenhealth.com&lt;mailto:robert.w.baldwin@truvenhealth.com</a>&gt;&gt; wrote:<br>
We are currently trying to map a user request for a report to the MDX and the SQL generated by Mondrian.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
Thanks for any help/direction.<br>
<br>
Truven Health Analytics<br>
Bob Baldwin<br>
Software Engineer<br>
<br>
Truven Health Analytics<br>
O: 734.786.5365&lt;<a href="tel:734.786.5365">tel:734.786.5365</a>&gt;<br>
<a href="mailto:robert.w.baldwin@truvenhealth.com%3cmailto:robert.w.baldwin@truvenhealth.com">robert.w.baldwin@truvenhealth.com&lt;mailto:robert.w.baldwin@truvenhealth.com</a>&gt;<br>
truvenhealth.com&lt;<a href="http://truvenhealth.com">http://truvenhealth.com</a>&gt;<br>
<br>
[<a href="cid:image001.gif@01CF4FF1.309138D0">cid:image001.gif@01CF4FF1.309138D0</a>]<br>
<br>
<br>
_______________________________________________<br>
Mondrian mailing list<br>
<a href="mailto:Mondrian@pentaho.org%3cmailto:Mondrian@pentaho.org">Mondrian@pentaho.org&lt;mailto:Mondrian@pentaho.org</a>&gt;<br>
<a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a><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">http://lists.pentaho.org/mailman/listinfo/mondrian</a><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">http://lists.pentaho.org/mailman/listinfo/mondrian</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</body>
</html>