<commit_before>/**
 * Created by ahindle on 08/11/14.
 */

var msiofApp = angular.module('msiofApp', ['ui.bootstrap', 'angularMoment']).config(function($interpolateProvider){
		  $interpolateProvider.startSymbol('{[{').endSymbol('}]}');
});

msiofApp.controller('HomeCtrl', function ($scope, $http, $interval) {
		  $scope.servers = {};
		  $scope.loaded = false;
		  $scope.sortBy = '+name';
		  $scope.sortOptions = {
					 'Name': '+name',
					 'Memory Usage': '-mem.percentage.usage',
					 'CPU Usage': '-cpu.percentage.usage',
					 'Load Average': '-system.loadavg'
		  };

		  $scope.setSort = function(sortValue) {
					 $scope.sortBy = sortValue;
		  }

		  $scope.getConnectionCount = function(server) {
					 return Object.keys(server.conns).length;
		  };

		  $scope.updateServers = function() {
					 $http({
								method: 'GET',
								url: '/servers/' + $scope.apiKey,
					 }).then(function(response){
								var data = response.data;
								$scope.servers = data;<commit_msg>add sort by disk usage<commit_after>/**
 * Created by ahindle on 08/11/14.
 */

var msiofApp = angular.module('msiofApp', ['ui.bootstrap', 'angularMoment']).config(function($interpolateProvider){
		  $interpolateProvider.startSymbol('{[{').endSymbol('}]}');
});

msiofApp.controller('HomeCtrl', function ($scope, $http, $interval) {
		  $scope.servers = {};
		  $scope.loaded = false;
		  $scope.sortBy = '+name';
		  $scope.sortOptions = {
					 'Name': '+name',
					 'Issues': '-hasIssues',
					 'Memory Usage': '-mem.percentage.usage',
					 'CPU Usage': '-cpu.percentage.usage',
					 'Disk Usage': '-disk.percentage.usage',
					 'Load Average': '-system.loadavg',
		  };

		  $scope.setSort = function(sortValue) {
					 $scope.sortBy = sortValue;
		  }

		  $scope.getConnectionCount = function(server) {
					 return Object.keys(server.conns).length;
		  };

		  $scope.updateServers = function() {
					 $http({
								method: 'GET',
								url: '/servers/' + $scope.apiKey,
					 }).then(function(response){
								var data = response.data;
								$scope.servers = data;
{'fraction_non_alphanumeric': 0.18360498561840843, 'fraction_numerical': 0.005752636625119847, 'mean_word_length': 3.028957528957529, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6386805', 'n_tokens_mistral': 865, 'n_tokens_neox': 654, 'n_words': 120}