How to use the mem.max function in mem

To help you get started, we’ve selected a few mem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github michael-simons / biking2 / src / main / webapp / public / js / controllers.js View on Github external
]).then(function(values) {
        $scope.metrics = new Array();

        $scope.metrics["mem.max"]  = values[0].data['measurements'][0]['value'];
        $scope.metrics["mem.used"] = values[1].data['measurements'][0]['value'];
        $scope.metrics["mem.free"] = values[0].data['measurements'][0]['value'] - values[1].data['measurements'][0]['value'];
        $scope.humanizedUptime = moment.duration(values[2].data['measurements'][0]['value'], 'seconds').humanize();

        var max = 10;
        var cur = $scope.memoryConfig.series[0].data.length;

        if (cur === max) {
            $scope.memoryConfig.series[0].data.splice(0, 1);
            $scope.memoryConfig.series[1].data.splice(0, 1);
            $scope.memoryConfig.xAxis.categories.splice(0, 1);
        }
        $scope.memoryConfig.series[0].data.push(formatKibiBytes($scope.metrics["mem.free"]));
        $scope.memoryConfig.series[1].data.push(formatKibiBytes($scope.metrics["mem.used"]));
        $scope.memoryConfig.xAxis.categories.push($filter('date')(new Date(), "HH:mm:ss"));
    });

mem

Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input

MIT
Latest version published 12 months ago

Package Health Score

64 / 100
Full package analysis