var updateDashboard = function()

in source/web_site/js/dash.js [588:682]


    var updateDashboard = function(){
        var params = retrieveParams("NumberOfSuccessfulCalls", totalCallCurrentTime);
        var ipParams = retrieveParams("CallsPerUniqueIp", ipQueryTime);
        var userParams = retrieveParams("CallsPerUser", userQueryTime);

        serviceCallQueryTime = getTimeSecsAgo(15*60);
        var serviceTypeParams = retrieveParams("CallsPerServiceType", serviceCallQueryTime);
        var ec2Params = retrieveParams("EC2Calls", ec2CallQueryTime);
        var anomalyParams = retrieveParams("AnomalyScore", anomalyScoreCurrentTime);
        var apiParams = retrieveParams("CallsPerAPI", apiQueryTime);
        var maxIpParams = retrieveParamsFromMaxTable("MaxIP", maxIpQueryTime);


        var docClient = new AWS.DynamoDB.DocumentClient();

        docClient.query(params, function(err, data) {
            if (err) console.log(err);
            else {

                var items = data.Items;
                for (var i=0; i<items.length; i++) {
                    totalSuccessfulCalls += parseInt(items[i].Data.match(/(\d)/)[1]);
                }
                var callTime;
                if (items.length > 0) callTime = items[items.length-1].EventTime.split('.')[0];
                else callTime = getTimeSecsAgo(20).split('.')[0];
                totalCallCtx.innerHTML = "<h4>Count: " + totalSuccessfulCalls + "</h4>";
                totalCallTimeCtx.innerHTML = "<h3><small>Last Updated: " + callTime + " UTC</small></h3>";
                //totalCallCurrentTime = updateLineChart(data, labels, {"Total no of calls" : totalCalls}, quadChart, totalCallCurrentTime);
            }
        });
        docClient.query(ipParams, function(err, data) {
            if (err) console.log(err);
            else {
                ipQueryTime = updateHorizontalBarChart(data, 5, osChart, ipQueryTime, splitFunc);
            }
        });
        docClient.query(userParams, function(err, data) {
            if (err) console.log(err);
            else {
                userQueryTime = updateHorizontalBarChart(data, 5, userCallChart, userQueryTime, splitFunc);
            }
        });

        while(isInFastUpdate);
        isInSlowUpdate = true;
        docClient.query(serviceTypeParams, function(err, data) {
            if (err) console.log(err);
            else {

                serviceCallChartData = updateLineChart(data, serviceCallChartData, serviceCallChart, splitFunc) ;
            }

        });

        ec2CallQueryTime = getTimeSecsAgo(15*60);
        docClient.query(ec2Params, function(err, data) {
            if (err) console.log(err);
            else {
                ec2CallChartData = updateLineChart(data, ec2CallChartData, ec2CallChart, function(label) { result = label.split('|')[1]; if (result == "null") return "SuccessfulCalls"; else return "Failure calls: " + result;}) ;

            }
        });
        isInSlowUpdate = false;

        docClient.query(apiParams, function(err, data) {
            if (err) console.log(err);
            else {
                apiQueryTime = updateHorizontalBarChart(data, 10, apiCallChart, apiQueryTime);
            }
        });
        docClient.query(maxIpParams, function(err, data) {
            if (err) console.log(err);
            else {
                var items = data.Items;
                for (var i=0; i<items.length; i++) {
                    maxIpCallLabels.push(splitLabel(items[i].Hour.replace(' ', 'T')+":"+items[i].Minute+" IP:" + items[i].IP));
                    maxIpCallMap["Max calls per IP"].push(parseInt(items[i].MaxCount));
                }
                if (items.length>0) {
                    maxIpQueryTime = items[items.length-1].Hour+":"+items[items.length-1].Minute+":00.000";
                    updateData(maxIpChart, maxIpCallLabels, Object.values(maxIpCallMap), Object.keys(maxIpCallMap));
                }
                else {
                    var defaultTime = getTimeSecsAgo(30);
                    if (maxIpQueryTime < defaultTime) maxIpQueryTime = defaultTime;
                }
            }
        });


        setTimeout( function() {
            updateDashboard();
        }, 60000);
    }