mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-28 11:41:46 +03:00
Optimize diskio plugin in the webui
This commit is contained in:
parent
a5e021a559
commit
fc4e0f40ce
@ -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>
|
||||
|
@ -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)
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user