Optimize diskio plugin in the webui

This commit is contained in:
Floran Brutel 2016-01-07 19:58:50 +01:00
parent a5e021a559
commit fc4e0f40ce
2 changed files with 11 additions and 10 deletions

View File

@ -6,11 +6,11 @@
<div class="table-cell" ng-show="show.diskio_iops">IOR/s</div>
<div class="table-cell" ng-show="show.diskio_iops">IOW/s</div>
</div>
<div class="table-row" ng-repeat="disk in statsDiskio.disks | orderBy: 'name'">
<div class="table-row" ng-repeat="disk in statsDiskio.disks">
<div class="table-cell text-left">{{disk.name | min_size}}</div>
<div class="table-cell" ng-show="!show.diskio_iops">{{disk.bitrate.txps | bytes}}</div>
<div class="table-cell" ng-show="!show.diskio_iops">{{disk.bitrate.rxps | bytes}}</div>
<div class="table-cell" ng-show="!show.diskio_iops">{{disk.bitrate.txps }}</div>
<div class="table-cell" ng-show="!show.diskio_iops">{{disk.bitrate.rxps }}</div>
<div class="table-cell" ng-show="show.diskio_iops">{{disk.count.txps | bytes}}</div>
<div class="table-cell" ng-show="show.diskio_iops">{{disk.count.rxps | bytes}}</div>
<div class="table-cell" ng-show="show.diskio_iops">{{disk.count.txps }}</div>
<div class="table-cell" ng-show="show.diskio_iops">{{disk.count.rxps }}</div>
</div>

View File

@ -1,9 +1,10 @@
glancesApp.service('GlancesPluginDiskio', function() {
glancesApp.service('GlancesPluginDiskio', function($filter) {
var _pluginName = "diskio";
this.disks = [];
this.setData = function(data, views) {
data = data[_pluginName];
data = $filter('orderBy')(data,'disk_name');
this.disks = [];
for (var i = 0; i < data.length; i++) {
@ -13,12 +14,12 @@ glancesApp.service('GlancesPluginDiskio', function() {
var diskio = {
'name': diskioData['disk_name'],
'bitrate': {
'txps': diskioData['read_bytes'] / timeSinceUpdate,
'rxps': diskioData['write_bytes'] / timeSinceUpdate
'txps': $filter('bytes')(diskioData['read_bytes'] / timeSinceUpdate),
'rxps': $filter('bytes')(diskioData['write_bytes'] / timeSinceUpdate)
},
'count': {
'txps': diskioData['read_count'] / timeSinceUpdate,
'rxps': diskioData['write_count'] / timeSinceUpdate
'txps': $filter('bytes')(diskioData['read_count'] / timeSinceUpdate),
'rxps': $filter('bytes')(diskioData['write_count'] / timeSinceUpdate)
}
};