 exports.fetcGlobalStatusMetrics = `function *(allowedIds) {
   var filtersObject = this.request.query;
   var userRequesting = this.authenticated,
-      path = '',
-      results = {},
-      final = {};
-  var allowedIds = allowedIds.length > 0 ? allowedIds : yield metrics.getAllowedChannelIDs(userRequesting)
+    path = '',
+    results = {},
+    final = {};
+  allowedIds = allowedIds.length > 0 ? allowedIds : yield metrics.getAllowedChannelIDs(userRequesting)
   var data = []
   var status_array = ['Processing', 'Failed', 'Completed', 'Successful', 'Completed with error(s)']
 
   for (var j = 0; j < allowedIds.length; j++) {
-      var render_url = "/render?target=transformNull(summarize(stats.counters." + domain + ".channels." + allowedIds[j]
-      for (i = 0; i < status_array.length; i++) {
-        path = render_url + ".statuses." + status_array[i] + ".count,'1week'))&from=-1days&format=json";
-        results[status_array[i]] = yield exports.fetchData(path);
-        final[status_array[i]] = 'data' in results[status_array[i]] ? results[status_array[i]].data[0][0] : 0;
+    var render_url = "/render?target=transformNull(summarize(stats.counters." + domain + ".channels." + allowedIds[j]
+    for (i = 0; i < status_array.length; i++) {
+      path = render_url + ".statuses." + status_array[i] + ".count,'1week'))&from=-1days&format=json";
+      results[status_array[i]] = yield exports.fetchData(path);
+      final[status_array[i]] = 'data' in results[status_array[i]] ? results[status_array[i]].data[0][0] : 0;
 
-      }
+    }
 
     data.push({
-      _id : {"channelID": allowedIds[j] },
+      _id: {"channelID": allowedIds[j]},
       failed: final.Failed,
       successful: final.Successful,
-      processing:final.Processing,
-      completed:final.Completed,
-      completedWErrors:final['Completed with error(s)']
+      processing: final.Processing,
+      completed: final.Completed,
+      completedWErrors: final['Completed with error(s)']
     });
   }
 

  return data;
}`

exports.fetchData = fetchData



fetchData = `function* fetchData(path) {
  var data = {};
  var options = {
    url: 'http://' + statsd_server.host + path
  };
  var response = yield request(options);

  var info = JSON.parse(response.body);
  if (info.length) {

    var i = 0;
    _.forEach(info, function (item) {
