]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: added iSCSI IOPS/throughput metrics
authorJason Dillaman <dillaman@redhat.com>
Tue, 31 Oct 2017 15:05:47 +0000 (11:05 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 31 Oct 2017 15:12:25 +0000 (11:12 -0400)
Fixes: http://tracker.ceph.com/issues/21391
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/pybind/mgr/dashboard/rbd_iscsi.html
src/pybind/mgr/dashboard/rbd_iscsi.py

index d49796cff79d5f06fa982eea8cfcf6df4c2d9a4e..ef648e149cef101ea6c3e6986fdd93db75ff87fa 100644 (file)
@@ -10,7 +10,8 @@
             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>
index 007abd110442dd9576b54a5277def287b151e43d..6f5e75ed1804a80110069a99d077a05ffc9bdcc7 100644 (file)
@@ -54,6 +54,14 @@ class DaemonsAndImages(RemoteViewCache):
                             [[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'])