File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
extensions/ql-vscode/src/log-insights Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { createHash } from "crypto" ;
1
2
import type { EvaluationLogScanner } from "./log-scanner" ;
2
3
import type { SummaryEvent } from "./log-summary" ;
3
4
4
5
export interface PipelineSummary {
5
6
steps : string [ ] ;
6
7
/** Total counts for each step in the RA array, across all iterations */
7
8
counts : number [ ] ;
9
+ hash : string ;
8
10
}
9
11
10
12
/**
@@ -188,6 +190,7 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {
188
190
const pipelineSummary = ( pipelineSummaries [ raReference ] ??= {
189
191
steps : event . ra [ raReference ] ,
190
192
counts : counts . map ( ( ) => 0 ) ,
193
+ hash : getPipelineHash ( event . ra [ raReference ] ) ,
191
194
} ) ;
192
195
const { counts : totalTuplesPerStep } = pipelineSummary ;
193
196
for ( let i = 0 , length = counts . length ; i < length ; ++ i ) {
@@ -232,3 +235,11 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {
232
235
233
236
onDone ( ) : void { }
234
237
}
238
+
239
+ function getPipelineHash ( steps : string [ ] ) {
240
+ const md5 = createHash ( "md5" ) ;
241
+ for ( const step of steps ) {
242
+ md5 . write ( step ) ;
243
+ }
244
+ return md5 . digest ( "base64" ) ;
245
+ }
You can’t perform that action at this time.
0 commit comments