Commit d6158bc2 by Tobias Skarhed

All tests passing

parent e4c2476f
...@@ -175,12 +175,7 @@ export class PrometheusDatasource { ...@@ -175,12 +175,7 @@ export class PrometheusDatasource {
responseIndex: index, responseIndex: index,
refId: activeTargets[index].refId, refId: activeTargets[index].refId,
}; };
console.log('format: ' + transformerOptions.format);
console.log('resultType: ' + response.data.data.resultType);
console.log('legendFormat: ' + transformerOptions.legendFormat);
// console.log(result);
this.resultTransformer.transform(result, response, transformerOptions); this.resultTransformer.transform(result, response, transformerOptions);
// console.log(result);
}); });
return { data: result }; return { data: result };
...@@ -237,7 +232,6 @@ export class PrometheusDatasource { ...@@ -237,7 +232,6 @@ export class PrometheusDatasource {
if (start > end) { if (start > end) {
throw { message: 'Invalid time range' }; throw { message: 'Invalid time range' };
} }
// console.log(query.expr);
var url = '/api/v1/query_range'; var url = '/api/v1/query_range';
var data = { var data = {
......
...@@ -6,9 +6,7 @@ export class ResultTransformer { ...@@ -6,9 +6,7 @@ export class ResultTransformer {
transform(result: any, response: any, options: any) { transform(result: any, response: any, options: any) {
let prometheusResult = response.data.data.result; let prometheusResult = response.data.data.result;
console.log(prometheusResult);
// console.log(options);
// console.log(result);
if (options.format === 'table') { if (options.format === 'table') {
result.push(this.transformMetricDataToTable(prometheusResult, options.responseListLength, options.refId)); result.push(this.transformMetricDataToTable(prometheusResult, options.responseListLength, options.refId));
} else if (options.format === 'heatmap') { } else if (options.format === 'heatmap') {
...@@ -28,7 +26,6 @@ export class ResultTransformer { ...@@ -28,7 +26,6 @@ export class ResultTransformer {
} }
} }
} }
// console.log(result);
} }
transformMetricData(metricData, options, start, end) { transformMetricData(metricData, options, start, end) {
...@@ -140,7 +137,6 @@ export class ResultTransformer { ...@@ -140,7 +137,6 @@ export class ResultTransformer {
if (!label || label === '{}') { if (!label || label === '{}') {
label = options.query; label = options.query;
} }
console.log(label);
return label; return label;
} }
...@@ -160,7 +156,6 @@ export class ResultTransformer { ...@@ -160,7 +156,6 @@ export class ResultTransformer {
var labelPart = _.map(_.toPairs(labelData), function(label) { var labelPart = _.map(_.toPairs(labelData), function(label) {
return label[0] + '="' + label[1] + '"'; return label[0] + '="' + label[1] + '"';
}).join(','); }).join(',');
console.log(metricName);
return metricName + '{' + labelPart + '}'; return metricName + '{' + labelPart + '}';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment