var lookup = {},
    result = [];

JSON.parse(value).forEach(function (item) {
    if (item.name === "scheduler_e2e_scheduling_duration_seconds_count"){
        var label_result = item.labels.result;

        if (lookup[label_result]) {
            return;
        }
        lookup[label_result] = 1;
        result.push({
            '{#TYPE}': 'totals',
            '{#RESULT}': label_result
        });

      }
    else if  (item.name === "scheduler_e2e_scheduling_duration_seconds_bucket"){
        result.push({
            '{#TYPE}': 'buckets',
            '{#RESULT}': item.labels.result,
            '{#LE}': item.labels.le
        });
    }
});

return JSON.stringify(result);