<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to write DQL to comparison jvm metric data of two timeframe in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250055#M1031</link>
    <description>&lt;P&gt;Hi ,&lt;BR /&gt;I want to write one DQL which can compare&amp;nbsp; jvm metric i.e.&amp;nbsp;dt.runtime.jvm.threads.count data of two timeframe. Can somebody please how I can use lookup to join the two data set here.&lt;BR /&gt;&lt;BR /&gt;I want to show metric name and&amp;nbsp; average of&amp;nbsp; thread count samples&amp;nbsp; of 2 timeframe&lt;/P&gt;&lt;P&gt;Metric name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; June test 1&amp;nbsp; &amp;nbsp; &amp;nbsp;June Test 2&lt;BR /&gt;dt.runtime.jvm.threads.count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 59&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 69&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2024 09:26:04 GMT</pubDate>
    <dc:creator>heramb_sawant</dc:creator>
    <dc:date>2024-07-08T09:26:04Z</dc:date>
    <item>
      <title>How to write DQL to comparison jvm metric data of two timeframe</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250055#M1031</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;I want to write one DQL which can compare&amp;nbsp; jvm metric i.e.&amp;nbsp;dt.runtime.jvm.threads.count data of two timeframe. Can somebody please how I can use lookup to join the two data set here.&lt;BR /&gt;&lt;BR /&gt;I want to show metric name and&amp;nbsp; average of&amp;nbsp; thread count samples&amp;nbsp; of 2 timeframe&lt;/P&gt;&lt;P&gt;Metric name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; June test 1&amp;nbsp; &amp;nbsp; &amp;nbsp;June Test 2&lt;BR /&gt;dt.runtime.jvm.threads.count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 59&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 69&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 09:26:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250055#M1031</guid>
      <dc:creator>heramb_sawant</dc:creator>
      <dc:date>2024-07-08T09:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DQL to comparison jvm metric data of two timeframe</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250072#M1032</link>
      <description>&lt;P&gt;Any help will be appreciated&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Heramb Sawant&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 11:54:59 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250072#M1032</guid>
      <dc:creator>heramb_sawant</dc:creator>
      <dc:date>2024-07-08T11:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DQL to comparison jvm metric data of two timeframe</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250133#M1035</link>
      <description>&lt;P&gt;I hope it helps:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries tc=avg(dt.runtime.jvm.threads.count), from: "2024-07-01T00:00", to: "2024-07-02T00:00"
| lookup [
  timeseries tc_ref=avg(dt.runtime.jvm.threads.count), shift:-1d
], sourceField:timeframe, lookupField:timeframe, fields:{tc_ref}
| fields metric="dt.runtime.jvm.threads.count", test=arrayAvg(tc), tc_ref=arrayAvg(tc_ref)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1720472580811.png" style="width: 872px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21010iD3A3F251A0E78DC8/image-dimensions/872x218?v=v2" width="872" height="218" role="button" title="krzysztof_hoja_0-1720472580811.png" alt="krzysztof_hoja_0-1720472580811.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 21:03:48 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250133#M1035</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-07-08T21:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DQL to comparison jvm metric data of two timeframe</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250257#M1039</link>
      <description>&lt;P&gt;Thanks Kris&amp;nbsp; for providing this DQL, this definitely giving comparison&amp;nbsp; but I&amp;nbsp; am specifically looking to compare two test&amp;nbsp; release timeframes. I modified dql by adding test timeframe window like below but&amp;nbsp;tc_ref is giving null .&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;timeseries tc=avg(dt.runtime.jvm.threads.count), from: "&lt;STRONG&gt;2024-06-04T00:00", to: "2024-06-05T00:00&lt;/STRONG&gt;"&lt;BR /&gt;| lookup [&lt;BR /&gt;timeseries tc_ref=avg(dt.runtime.jvm.threads.count), from: "&lt;STRONG&gt;2024-07-04T00:00", to: "2024-07-05T00:00&lt;/STRONG&gt;"&lt;BR /&gt;], sourceField:timeframe, lookupField:timeframe, fields:{tc_ref}&lt;BR /&gt;| fields metric="dt.runtime.jvm.threads.count", test=arrayAvg(tc), tc_ref=arrayAvg(tc_ref)&lt;BR /&gt;&lt;BR /&gt;Please help . is there need to change lookup and source Field??&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Heramb sawant&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 12:47:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250257#M1039</guid>
      <dc:creator>heramb_sawant</dc:creator>
      <dc:date>2024-07-10T12:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DQL to comparison jvm metric data of two timeframe</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250296#M1041</link>
      <description>&lt;P&gt;What &lt;EM&gt;&lt;STRONG&gt;shift:&lt;/STRONG&gt;&lt;/EM&gt; parameter does is some sort of "cheating"&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;.&amp;nbsp;It&amp;nbsp;&lt;SPAN&gt;shifts the timeframe specified in the basic query parameters&amp;nbsp; and maps the resulting data points to timestamps from the original timeframe. Because I used &lt;EM&gt;&lt;STRONG&gt;lookup&lt;/STRONG&gt;&lt;/EM&gt; requires joining condition I used timeframe frame, because it was the same due to this effect. Logically in this case join condition is not needed, because both queries will return always 1 record.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You can observe this effect on chart when we remove aggregation to single value. I used append so we can have 2 different records, each with individual timeframe. This query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries tc=avg(dt.runtime.jvm.threads.count), from: "2024-07-01T00:00", to: "2024-07-02T00:00"
| append [
  timeseries tc_ref=avg(dt.runtime.jvm.threads.count), shift:-1d
]&lt;/LI-CODE&gt;&lt;P&gt;Produces this result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1720636115836.png" style="width: 841px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21047iD0C0ECF7B9F5DD2F/image-dimensions/841x435?v=v2" width="841" height="435" role="button" title="krzysztof_hoja_0-1720636115836.png" alt="krzysztof_hoja_0-1720636115836.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;black line represents data for June 30th, but it is mapped into July 1st&lt;/P&gt;&lt;P&gt;Result of such query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries tc=avg(dt.runtime.jvm.threads.count), from: "2024-07-01T00:00", to: "2024-07-02T00:00"
| append [
  timeseries tc_ref=avg(dt.runtime.jvm.threads.count), from: "2024-06-30T00:00", to: "2024-07-01T00:00"
]&lt;/LI-CODE&gt;&lt;P&gt;looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_1-1720636226221.png" style="width: 814px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21048i00FA09752B0F9ECD/image-dimensions/814x419?v=v2" width="814" height="419" role="button" title="krzysztof_hoja_1-1720636226221.png" alt="krzysztof_hoja_1-1720636226221.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and in raw form:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_2-1720636272724.png" style="width: 796px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21049i67E7CDAB36505234/image-dimensions/796x361?v=v2" width="796" height="361" role="button" title="krzysztof_hoja_2-1720636272724.png" alt="krzysztof_hoja_2-1720636272724.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see timeframe field is different, so when used in &lt;STRONG&gt;&lt;EM&gt;lookup&lt;/EM&gt;&lt;/STRONG&gt; join condition it did not connect records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There&amp;nbsp; are many possible solutions. This way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries tc=avg(dt.runtime.jvm.threads.count), from: "2024-07-01T00:00", to: "2024-07-02T00:00"
| append [
  timeseries tc=avg(dt.runtime.jvm.threads.count), from: "2024-06-30T00:00", to: "2024-07-01T00:00"
]
| fields timeframe, tc = arrayAvg(tc)&lt;/LI-CODE&gt;&lt;P&gt;result will be presented with 2 rows and by looking at timeframe column, you can see what is actual and what is reference value:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_3-1720636626084.png" style="width: 850px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21050iA09C8E087C621381/image-dimensions/850x257?v=v2" width="850" height="257" role="button" title="krzysztof_hoja_3-1720636626084.png" alt="krzysztof_hoja_3-1720636626084.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but you can always combine this into single row:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries tc=avg(dt.runtime.jvm.threads.count), from: "2024-07-01T00:00", to: "2024-07-02T00:00"
| append [
  timeseries tc_ref=avg(dt.runtime.jvm.threads.count), from: "2024-06-30T00:00", to: "2024-07-01T00:00"
]
| summarize {tc=takeAny(arrayAvg(tc)), tc_ref=takeAny(arrayAvg(tc_ref))}, by: {metric="dt.runtime.jvm.threads.count"}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_4-1720636923100.png" style="width: 838px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21051i45341CCB924E736B/image-dimensions/838x178?v=v2" width="838" height="178" role="button" title="krzysztof_hoja_4-1720636923100.png" alt="krzysztof_hoja_4-1720636923100.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 18:43:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250296#M1041</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-07-10T18:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DQL to comparison jvm metric data of two timeframe</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250498#M1043</link>
      <description>&lt;P&gt;Thanks you so much for the&amp;nbsp; examples with detailed explanation.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Heramb Sawant&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 12:21:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-write-DQL-to-comparison-jvm-metric-data-of-two-timeframe/m-p/250498#M1043</guid>
      <dc:creator>heramb_sawant</dc:creator>
      <dc:date>2024-07-12T12:21:00Z</dc:date>
    </item>
  </channel>
</rss>

