Skip to content

Commit d58fb54

Browse files
author
Dave Bartolomeo
committed
Better formatting of metrics
1 parent fdc209c commit d58fb54

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

extensions/ql-vscode/src/log-insights/join-order.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class JoinOrderScanner implements EvaluationLogScanner {
192192
private reportProblemIfNecessary(event: SummaryEvent, iteration: number, metric: number): void {
193193
if (metric >= this.warningThreshold) {
194194
this.problemReporter.reportProblem(event.predicateName, event.raHash, iteration,
195-
`Relation '${event.predicateName}' has an inefficient join order. Its join order metric is ${metric}, which is larger than the threshold of ${this.warningThreshold}.`);
195+
`Relation '${event.predicateName}' has an inefficient join order. Its join order metric is ${metric.toFixed(2)}, which is larger than the threshold of ${this.warningThreshold.toFixed(2)}.`);
196196
}
197197
}
198198

extensions/ql-vscode/test/pure-tests/log-scanner.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ describe('log scanners', function() {
3636
expect(problemReporter.problems[0].predicateName).to.equal('#select#ff');
3737
expect(problemReporter.problems[0].raHash).to.equal('1bb43c97jpmuh8r2v0f9hktim63');
3838
expect(problemReporter.problems[0].iteration).to.equal(0);
39-
expect(problemReporter.problems[0].message).to.equal('Relation \'#select#ff\' has an inefficient join order. Its join order metric is 4961.834409325194, which is larger than the threshold of 50.');
39+
expect(problemReporter.problems[0].message).to.equal('Relation \'#select#ff\' has an inefficient join order. Its join order metric is 4961.83, which is larger than the threshold of 50.00.');
4040
});
4141
});

0 commit comments

Comments
 (0)