mirror of https://github.com/portainer/portainer
parent
3a6e9d2fbe
commit
7d78871eee
|
@ -162,6 +162,7 @@ function (Settings, $scope, Messages, $timeout, Container, ContainerTop, $stateP
|
|||
$scope.networkName = Object.keys(data.networks)[0];
|
||||
data.network = data.networks[$scope.networkName];
|
||||
}
|
||||
if(data.network) {
|
||||
var rxBytes = 0, txBytes = 0;
|
||||
if (lastRxBytes !== 0 || lastTxBytes !== 0) {
|
||||
// These will be zero on first call, ignore to prevent large graph spike
|
||||
|
@ -173,6 +174,7 @@ function (Settings, $scope, Messages, $timeout, Container, ContainerTop, $stateP
|
|||
networkChart.addData([rxBytes, txBytes], new Date(data.read).toLocaleTimeString());
|
||||
networkChart.removeData();
|
||||
}
|
||||
}
|
||||
|
||||
function calculateCPUPercent(stats) {
|
||||
// Same algorithm the official client uses: https://github.com/docker/docker/blob/master/api/client/stats.go#L195-L208
|
||||
|
|
Loading…
Reference in New Issue