<commit_before>(function(){
    'use strict';

    angular.module('motech-server')
        .service('ServerInfoService', service);

    service.$inject = ['$q', '$rootScope', '$http', 'ServerService'];
    function service($q, $rootScope, $http, ServerService){
        var service = this;

        service.information = {};
        service.running = false;

        ServerService.whenReady()
        .then(function(){
            service.running = true;
            updateInformation();
        });

        function updateInformation(){
            $q.all({
                time: $http.get(ServerService.formatURL('module/server/gettime'), {}),
                uptime: $http.get(ServerService.formatURL('module/server/getUptime'), {}),
                node: $http.get(ServerService.formatURL('module/server/getNodeName'), {}),
                eventChannel: $http.get(ServerService.formatURL('module/server/isInboundChannelActive'), {})
            }).then(function(responses){
                var information = {};

                information.currentStamp = responses.time.data;
                information.currentTime = formatDate(information.currentStamp);

                information.uptimeStamp = responses.uptime.data;
                information.uptime = formatTimeSince(information.uptimeStamp);

                information.node = responses.node.data;
                information.eventChannel = responses.eventChannel.data;

                service.information = information;
            });
        }<commit_msg>MOTECH-2376: Consolidate Server Status API (#71)<commit_after>(function(){
    'use strict';

    angular.module('motech-server')
        .service('ServerInfoService', service);

    service.$inject = ['$q', '$rootScope', '$http', 'ServerService'];
    function service($q, $rootScope, $http, ServerService){
        var service = this;

        service.information = {};
        service.running = false;

        ServerService.whenReady()
        .then(function(){
            service.running = true;
            updateInformation();
        });

        function updateInformation(){
            $q.all({
                status: $http.get(ServerService.formatURL('module/server/getStatus'), {}),
            }).then(function(response){
                var information = {};

                information.currentStamp = response.status.data[0].time;
                information.currentTime = formatDate(information.currentStamp);

                information.uptimeStamp = response.status.data[0].uptime;
                information.uptime = formatTimeSince(information.uptimeStamp);

                information.node = response.status.data[0].nodeName;
                information.eventChannel = response.status.data[0].inboundChannelActive;

                service.information = information;
            });
        }
{'fraction_non_alphanumeric': 0.12934973637961336, 'fraction_numerical': 0.0035149384885764497, 'mean_word_length': 2.234090909090909, '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': '1863425', 'n_tokens_mistral': 731, 'n_tokens_neox': 683, 'n_words': 109}