var refresh = function() {
$.get("{{ url_prefix }}/rbd_iscsi_data", function(data) {
_.extend(content_data, data);
- setTimeout(refresh, 30000);
+ $('.inlinesparkline').sparkline();
+ setTimeout(refresh, 5000);
});
};
return moment(date_str * 1000).fromNow();
}
+ rivets.formatters.sparkline_data = function(time_series) {
+ result = "";
+ for (var i = 1; i < time_series.length; ++i) {
+ var delta_v = time_series[i][1] - time_series[i - 1][1];
+ var delta_t = time_series[i][0] - time_series[i - 1][0];
+ result += (delta_v / delta_t + ",");
+ }
+ return result;
+ };
+
rivets.bind($("div#content"), content_data);
- setTimeout(refresh, 30000);
+ $('.inlinesparkline').sparkline();
+ setTimeout(refresh, 5000);
$('#daemons').DataTable({
'paging' : true,
<th>Image</th>
<th>Active/Optimized</th>
<th>Active/Non-Optimized</th>
+ <th>Read Bytes</th>
+ <th>Write Bytes</th>
+ <th>Read Ops</th>
+ <th>Write Ops</th>
<th>A/O Since</th>
</tr>
</thead>
<td>{image.name}</td>
<td>{image.optimized_paths}</td>
<td>{image.non_optimized_paths}</td>
+ <td>{image.stats.rd_bytes | dimless_binary}/s <span class="inlinesparkline" rv-html="image.stats_history.rd_bytes | sparkline_data"></span></td>
+ <td>{image.stats.wr_bytes | dimless_binary}/s <span class="inlinesparkline" rv-html="image.stats_history.wr_bytes | sparkline_data"></span></td>
+ <td>{image.stats.rd | dimless}/s</td>
+ <td>{image.stats.wr | dimless}/s</td>
<td>{image.optimized_since | relative_date}</td>
</tr>
</tbody>
[[0,0]])[-1][1] / 1000000000
if lock_acquired_time > image.get('optimized_since', None):
image['optimized_since'] = lock_acquired_time
+ image['stats'] = {}
+ image['stats_history'] = {}
+ for s in ['rd', 'wr', 'rd_bytes', 'wr_bytes']:
+ perf_key = "{}{}".format(perf_key_prefix, s)
+ image['stats'][s] = self._module.get_rate(
+ 'tcmu-runner', service_id, perf_key)
+ image['stats_history'][s] = self._module.get_counter(
+ 'tcmu-runner', service_id, perf_key)[perf_key]
else:
daemon['non_optimized_paths'] += 1
image['non_optimized_paths'].append(server['hostname'])