Better formatting of metrics

This commit is contained in:
Dave Bartolomeo
2022-08-11 13:51:11 -04:00
parent fdc209ca08
commit d58fb54928
2 changed files with 2 additions and 2 deletions

View File

@@ -192,7 +192,7 @@ class JoinOrderScanner implements EvaluationLogScanner {
private reportProblemIfNecessary(event: SummaryEvent, iteration: number, metric: number): void {
if (metric >= this.warningThreshold) {
this.problemReporter.reportProblem(event.predicateName, event.raHash, iteration,
`Relation '${event.predicateName}' has an inefficient join order. Its join order metric is ${metric}, which is larger than the threshold of ${this.warningThreshold}.`);
`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)}.`);
}
}

View File

@@ -36,6 +36,6 @@ describe('log scanners', function() {
expect(problemReporter.problems[0].predicateName).to.equal('#select#ff');
expect(problemReporter.problems[0].raHash).to.equal('1bb43c97jpmuh8r2v0f9hktim63');
expect(problemReporter.problems[0].iteration).to.equal(0);
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.');
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.');
});
});