1<div>
2
3  <div class="row margin-bottom-half">
4<!-- top row w/ title/time/pill selectors -->
5    <div class="row">
6      <h4 class="inline">
7        <span ng-if="qmc.isSelected(1)">Active Analytics Queries</span>
8        <span ng-if="qmc.isSelected(2)">Completed Analytics Queries</span>
9        <small>
10          {{qmc.updatedTime()}}
11          <span ng-if="qmc.get_update_flag()" class="loading"></span>
12          <span ng-if="!qmc.get_update_flag()" class="loading-placeholder"></span>
13        </small>
14      </h4>
15      <button class="outline tight icon-small indent-1"
16        ng-click="qmc.toggle_update()">
17        <span ng-if="qmc.get_update_flag()" class="icon fa-pause"></span>
18        <span ng-if="!qmc.get_update_flag()" class="icon fa-play"></span>
19        &nbsp;{{qmc.get_toggle_label()}}
20      </button>
21    </div>
22
23    <div class="pills text-right">
24      <a ng-click="qmc.selectTab(1)" ng-class="{selected: qmc.isSelected(1)}">Active</a>
25      <a ng-click="qmc.selectTab(2)" ng-class="{selected: qmc.isSelected(2)}">Completed</a>
26    </div>
27  </div>
28
29<!--  Insufficient permissions ************************************  -->
30  <div id="monitoring_tables" >
31
32<!-- ACTIVE QUERIES TABLE  ************************************  -->
33    <div class="qm-table-active cbui-table" ng-if="qmc.isSelected(1)">
34      <!-- table wrapper -->
35      <div class="cbui-table-header padding-left">
36        <!-- table header row, no <section> wrapper -->
37        <span class="cbui-table-cell flex-grow-3" ng-click="qmc.update_active_sort('statement')">query
38          <span ng-if="qmc.show_up_caret_active('statement')" class="icon fa-caret-up"></span>
39          <span ng-if="qmc.show_down_caret_active('statement')" class="icon fa-caret-down"></span>
40        </span> <span class="cbui-table-cell" ng-click="qmc.update_active_sort('node')">node
41          <span ng-if="qmc.show_up_caret_active('node')" class="icon fa-caret-up"></span>
42          <span ng-if="qmc.show_down_caret_active('node')" class="icon fa-caret-down"></span>
43        </span>
44        <span class="cbui-table-cell" ng-click="qmc.update_active_sort('elapsedTime')">duration
45          <span ng-if="qmc.show_up_caret_active('elapsedTime')" class="icon fa-caret-up"></span>
46          <span ng-if="qmc.show_down_caret_active('elapsedTime')" class="icon fa-caret-down"></span>
47        </span>
48        <span class="cbui-table-cell" ng-click="qmc.update_active_sort('state')">state
49          <span ng-if="qmc.show_up_caret_active('state')" class="icon fa-caret-up"></span>
50          <span ng-if="qmc.show_down_caret_active('state')" class="icon fa-caret-down"></span>
51        </span>
52        <span class="cbui-table-cell" ng-click="qmc.update_active_sort('users')">user
53          <span ng-if="qmc.show_up_caret_active('users')" class="icon fa-caret-up"></span>
54          <span ng-if="qmc.show_down_caret_active('users')" class="icon fa-caret-down"></span>
55        </span> <span class="cbui-table-cell flex-grow-1-5"></span>
56      </div>
57
58      <section
59        ng-repeat="result in qmc.monitoring.active_requests | orderBy:qmc.options().active_sort_by:qmc.options().active_sort_reverse">
60        <div class="cbui-tablerow padding-left">
61          <span
62             class="cbui-table-cell flex-grow-3 cursor-pointer"
63             uib-tooltip="{{result.statement}}"
64             tooltip-placement="auto top"
65             tooltip-append-to-body="true"
66             tooltip-class="break-word">
67            {{result.statement}}
68          </span>
69          <span class="cbui-table-cell">
70            {{result.node}}
71          </span>
72          <span class="cbui-table-cell">
73            {{result.elapsedTime}}
74          </span>
75          <span class="cbui-table-cell">
76            {{result.state}}
77          </span>
78          <span class="cbui-table-cell">
79            {{result.users}}
80          </span>
81          <span class="cbui-table-cell flex-grow-1-5 wrap text-right">
82            <a ng-if="result.plan" ng-click="qmc.showPlan(result.statement,result.plan)">Plan&nbsp;</a>
83            <a ui-sref="app.admin.cbas.workbench({query: result.statement})" class="nowrap">
84              Edit
85            </a>
86            <a ng-if="result.cancellable" class="margin-left-half nowrap" ng-click="qmc.cancelQueryById(result.uuid)">
87              {{qmc.getCancelLabel(result.uuid)}}
88            </a>
89          </span>
90        </div>
91      </section>
92    </div>
93
94<!-- COMPLETED TABLE  ***************************************************  -->
95
96    <div class="qm-table-completed cbui-table" ng-if="qmc.isSelected(2)">
97      <div class="cbui-table-header padding-left">
98        <span class="cbui-table-cell flex-grow-3 wrap" ng-click="qmc.update_completed_sort('statement')">query
99            <span ng-if="qmc.show_up_caret_completed('statement')" class="icon fa-caret-up"></span>
100            <span ng-if="qmc.show_down_caret_completed('statement')" class="icon fa-caret-down"></span>
101        </span>
102          <span class="cbui-table-cell" ng-click="qmc.update_completed_sort('node')">node
103            <span ng-if="qmc.show_up_caret_completed('node')" class="icon fa-caret-up"></span>
104            <span ng-if="qmc.show_down_caret_completed('node')" class="icon fa-caret-down"></span>
105          </span>
106          <span class="cbui-table-cell" ng-click="qmc.update_completed_sort('elapsedTime')">duration
107            <span ng-if="qmc.show_up_caret_completed('elapsedTime')" class="icon fa-caret-up"></span>
108            <span ng-if="qmc.show_down_caret_completed('elapsedTime')" class="icon fa-caret-down"></span>
109          </span>
110          <span class="cbui-table-cell" ng-click="qmc.update_completed_sort('state')">state
111            <span ng-if="qmc.show_up_caret_completed('state')" class="icon fa-caret-up"></span>
112            <span ng-if="qmc.show_down_caret_completed('state')" class="icon fa-caret-down"></span>
113          </span>
114          <span class="cbui-table-cell" ng-click="qmc.update_completed_sort('requestTime')">run at
115            <span ng-if="qmc.show_up_caret_completed('requestTime')" class="icon fa-caret-up"></span>
116            <span ng-if="qmc.show_down_caret_completed('requestTime')" class="icon fa-caret-down"></span>
117          </span>
118          <span class="cbui-table-cell" ng-click="qmc.update_completed_sort('users')">user
119            <span ng-if="qmc.show_up_caret_completed('users')" class="icon fa-caret-up"></span>
120            <span ng-if="qmc.show_down_caret_completed('users')" class="icon fa-caret-down"></span>
121          </span>
122          <span class="cbui-table-cell flex-grow-half"></span>
123      </div>
124
125      <section ng-repeat="result in qmc.monitoring.completed_requests | orderBy:qmc.options().completed_sort_by:qmc.options().completed_sort_reverse">
126        <div class="cbui-tablerow padding-left">
127          <span
128             class="cbui-table-cell flex-grow-3 cursor-pointer"
129             uib-tooltip="{{result.statement}}"
130             tooltip-placement="auto top"
131             tooltip-append-to-body="true"
132             tooltip-class="break-word">
133            {{result.statement}}
134          </span>
135          <span class="cbui-table-cell">
136            {{result.node}}
137          </span>
138          <span class="cbui-table-cell">
139            {{result.elapsedTime}}
140          </span>
141          <!--span class="cbui-table-cell">
142            {{result.resultCount}}
143          </span-->
144          <span ng-class="result.errorCount ? 'orange-3 cbui-table-cell' : 'cbui-table-cell'">
145            {{result.state}}
146            <span ng-if="result.errorCount" tooltip-trigger="'mouseenter'" tooltip-append-to-body="true"
147                class="fa-warning icon orange-3 cursor-pointer" uib-tooltip="{{result.errors}}"></span>
148          </span>
149          <span class="cbui-table-cell cursor-pointer" uib-tooltip="{{result.requestTime}}"
150             tooltip-placement="auto top"
151             tooltip-append-to-body="true"
152             tooltip-class="break-word">
153            {{result.requestTime | limitTo:8:11}} {{result.requestTime | limitTo:3:-3}}
154          </span>
155          <span class="cbui-table-cell">
156            {{result.users}}
157          </span>
158          <span class="cbui-table-cell flex-grow-half text-right">
159            <a ng-if="result.plan" ng-click="qmc.showPlan(result.statement,result.plan)">plan&nbsp;</a>
160            <a ui-sref="app.admin.cbas.workbench({query: result.statement})" class="nowrap">
161              edit
162            </a>
163          </span>
164        </div>
165      </section>
166    </div>
167
168
169<!-- QUERY STATISTICS ****************************************************** -->
170
171  <footer class="footer-analytics">
172    <div class="column vertical-divider">
173      <span class="width-6">Disk Used</span>
174      <span class="text-right width-6">{{qmc.getLatestStat('cbas_disk_used')/1024/1024 | number:1}} MB</span><br>
175      <span class="width-6">Heap Used</span>
176      <span class="text-right width-6">{{qmc.getLatestStat('cbas_heap_used')/1024/1024 | number:1}} MB</span>
177    </div>
178    <div class="column vertical-divider">
179      <span class="width-6">System Load</span>
180      <span class="text-right width-6">{{qmc.getAverageStat('cbas_system_load_average') | number:1}}</span><br>
181      <span class="width-6">Thread Count</span>
182      <span class="text-right width-6">{{qmc.getAverageStat('cbas_thread_count') | number:1}}</span>
183    </div>
184    <div class="column">
185      <span class="width-6">Garbage Collection Rate</span>
186      <span class="text-right width-6">{{qmc.getAverageStat('cbas_gc_count') | number:1}} gc/sec</span><br>
187      <span class="width-6">Garbage Collection Time</span>
188      <span class="text-right width-6">{{qmc.getAverageStat('cbas_gc_time') | number:1}} ms/sec</span>
189    </div>
190  </footer>
191
192
193</div>
194