|
| 1 | +import { join } from "path"; |
| 2 | + |
| 3 | +function findQueryLogFile(resultPath: string): string { |
| 4 | + return join(resultPath, "query.log"); |
| 5 | +} |
| 6 | + |
| 7 | +function findQueryEvalLogFile(resultPath: string): string { |
| 8 | + return join(resultPath, "evaluator-log.jsonl"); |
| 9 | +} |
| 10 | + |
| 11 | +function findQueryEvalLogSummaryFile(resultPath: string): string { |
| 12 | + return join(resultPath, "evaluator-log.summary"); |
| 13 | +} |
| 14 | + |
| 15 | +function findJsonQueryEvalLogSummaryFile(resultPath: string): string { |
| 16 | + return join(resultPath, "evaluator-log.summary.jsonl"); |
| 17 | +} |
| 18 | + |
| 19 | +function findQueryEvalLogSummarySymbolsFile(resultPath: string): string { |
| 20 | + return join(resultPath, "evaluator-log.summary.symbols.json"); |
| 21 | +} |
| 22 | + |
| 23 | +function findQueryEvalLogEndSummaryFile(resultPath: string): string { |
| 24 | + return join(resultPath, "evaluator-log-end.summary"); |
| 25 | +} |
| 26 | + |
| 27 | +/** |
| 28 | + * Provides paths to the files that can be generated in the output directory for a query evaluation. |
| 29 | + */ |
| 30 | +export class QueryOutputDir { |
| 31 | + constructor(public readonly querySaveDir: string) {} |
| 32 | + |
| 33 | + get dilPath() { |
| 34 | + return join(this.querySaveDir, "results.dil"); |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * Get the path that the compiled query is if it exists. Note that it only exists when using the legacy query server. |
| 39 | + */ |
| 40 | + get compileQueryPath() { |
| 41 | + return join(this.querySaveDir, "compiledQuery.qlo"); |
| 42 | + } |
| 43 | + |
| 44 | + get csvPath() { |
| 45 | + return join(this.querySaveDir, "results.csv"); |
| 46 | + } |
| 47 | + |
| 48 | + get logPath() { |
| 49 | + return findQueryLogFile(this.querySaveDir); |
| 50 | + } |
| 51 | + |
| 52 | + get evalLogPath() { |
| 53 | + return findQueryEvalLogFile(this.querySaveDir); |
| 54 | + } |
| 55 | + |
| 56 | + get evalLogSummaryPath() { |
| 57 | + return findQueryEvalLogSummaryFile(this.querySaveDir); |
| 58 | + } |
| 59 | + |
| 60 | + get jsonEvalLogSummaryPath() { |
| 61 | + return findJsonQueryEvalLogSummaryFile(this.querySaveDir); |
| 62 | + } |
| 63 | + |
| 64 | + get evalLogSummarySymbolsPath() { |
| 65 | + return findQueryEvalLogSummarySymbolsFile(this.querySaveDir); |
| 66 | + } |
| 67 | + |
| 68 | + get evalLogEndSummaryPath() { |
| 69 | + return findQueryEvalLogEndSummaryFile(this.querySaveDir); |
| 70 | + } |
| 71 | + |
| 72 | + get bqrsPath() { |
| 73 | + return join(this.querySaveDir, "results.bqrs"); |
| 74 | + } |
| 75 | +} |
0 commit comments