eclipse / jifa

🔬 Online Heap Dump, GC Log, Thread Dump & JFR File Analyzer.
https://eclipse.github.io/jifa/
Eclipse Public License 2.0
543 stars 96 forks source link

feat: specify query type for a prepared query view #216

Closed jasonk000 closed 1 year ago

jasonk000 commented 1 year ago

This allows prepared query views to specify the query type (sql/oql) when passing the query

There are no existing in-tree users of prepared query views.

Allows passing of Calcite queries directly to a prepared query view, such as follows for showing atlas/spectator metrics.

<el-tab-pane name="atlasMetrics" lazy>
  <span slot="label"> Atlas metrics </span>
  <div v-bind:style="{ 'height': '100%', 'width': resultDivWidth}">
    <Query :file="file"
      queryType='sql'
      @outgoingRefsOfObj="outgoingRefsOfObj"
      @incomingRefsOfObj="incomingRefsOfObj"
      @outgoingRefsOfClass="outgoingRefsOfClass"
      @incomingRefsOfClass="incomingRefsOfClass"
      @pathToGCRootsOfObj="pathToGCRootsOfObj"
      @setSelectedObjectId="setSelectedObjectId"
      preparedQueryType='sql'
      preparedQuery='select m.name metric_name, count(*) metric_count from
        "com.netflix.spectator.api.DefaultId" m group by m.name order by metric_count desc' />
  </div>
</el-tab-pane>