   var path = "/render?target=transformNull(summarize(stats.timers." + domain + ".channels.mean,'1hour'))&from=-1days&format=json";
   var data = [];
   var raw = yield exports.fetchData(path);
-
-  _.forEach(raw.data, function (item) {
-    data.push({
-      avgResp: item[0],
-      timestamp: moment.unix(item[1])
-    });
-  });
-
-  return this.body = data
+  return this.body = exports.convertToRequiredFormat(raw, 'retrieveAverageLoadTimePerHour');
 }`
 
 exports.retrieveChannelMetrics = `function *(type, channelId) {

  return data;
}`

exports.fetchData = fetchData

  var results = {}, path = ''
  var render_url = "/render?target=transformNull(summarize(stats.counters." + domain + ".channels." + channelId

  if (type == 'status') {
    for (i = 0; i < status_array.length; i++) {
      path = render_url + ".statuses." + status_array[i] + ".count,'1week'))&from=-1weeks&format=json";
      results[status_array[i]] = yield exports.fetchData(path);
    }
    ;

    var failed = 'data' in results.Failed ? results.Failed.data[0][0] + results.Failed.data[1][0] : 0,
      processing = 'data'  in results.Processing ? results.Processing.data[0][0] + results.Processing.data[1][0] : 0,
