@@ -13,6 +13,8 @@ class Object extends JSON::Object {
13
13
14
14
int getNumber ( string key ) { result = this .getValue ( key ) .( JSON:: Number ) .getValue ( ) .toInt ( ) }
15
15
16
+ float getFloat ( string key ) { result = this .getValue ( key ) .( JSON:: Number ) .getValue ( ) .toFloat ( ) }
17
+
16
18
Array getArray ( string key ) { result = this .getValue ( key ) }
17
19
18
20
Object getObject ( string key ) { result = this .getValue ( key ) }
@@ -31,9 +33,20 @@ class Array extends JSON::Array {
31
33
32
34
int getNumber ( int i ) { result = this .getChild ( i ) .( JSON:: Number ) .getValue ( ) .toInt ( ) }
33
35
36
+ float getFloat ( int i ) { result = this .getChild ( i ) .( JSON:: Number ) .getValue ( ) .toFloat ( ) }
37
+
34
38
Array getArray ( int i ) { result = this .getChild ( i ) }
35
39
}
36
40
41
+ /**
42
+ * Gets the i'th non-negative number in `a`.
43
+ *
44
+ * This is needed because the evaluator log is padded with -1s in some cases.
45
+ */
46
+ private float getRanked ( Array a , int i ) {
47
+ result = rank [ i + 1 ] ( int j , float f | f = a .getFloat ( j ) and f >= 0 | f order by j )
48
+ }
49
+
37
50
module EvaluatorLog {
38
51
class Entry extends Object { }
39
52
@@ -86,21 +99,21 @@ module EvaluatorLog {
86
99
87
100
string getRAReference ( ) { result = this .getString ( "raReference" ) }
88
101
89
- int getCount ( int i ) { result = this .getArray ( "counts" ) . getNumber ( i ) }
102
+ float getCount ( int i ) { result = getRanked ( this .getArray ( "counts" ) , i ) }
90
103
91
- int getDuplicationPercentage ( int i ) {
92
- result = this .getArray ( "duplicationPercentages" ) . getNumber ( i )
104
+ float getDuplicationPercentage ( int i ) {
105
+ result = getRanked ( this .getArray ( "duplicationPercentages" ) , i )
93
106
}
94
107
95
- int getResultSize ( ) { result = this .getNumber ( "resultSize" ) }
108
+ float getResultSize ( ) { result = this .getFloat ( "resultSize" ) }
96
109
}
97
110
98
111
class PredicateCompleted extends Entry {
99
112
PredicateCompleted ( ) { this .getType ( ) = "PREDICATE_COMPLETED" }
100
113
101
114
int getStartEvent ( ) { result = this .getNumber ( "startEvent" ) }
102
115
103
- int getResultSize ( ) { result = this .getNumber ( "resultSize" ) }
116
+ float getResultSize ( ) { result = this .getFloat ( "resultSize" ) }
104
117
}
105
118
106
119
class QueryCompleted extends Entry {
@@ -118,7 +131,7 @@ module EvaluatorLog {
118
131
class CacheLookup extends Entry {
119
132
CacheLookup ( ) { this .getType ( ) = "CACHE_LOOKUP" }
120
133
121
- int getRelationSize ( ) { result = this .getNumber ( "relationSize" ) }
134
+ float getRelationSize ( ) { result = this .getFloat ( "relationSize" ) }
122
135
}
123
136
124
137
class SentinelEmpty extends Entry {
@@ -214,7 +227,7 @@ module KindPredicatesLog {
214
227
)
215
228
}
216
229
217
- int getResultSize ( ) { result = this .getNumber ( "resultSize" ) }
230
+ float getResultSize ( ) { result = this .getFloat ( "resultSize" ) }
218
231
}
219
232
220
233
class SentinelEmpty extends SummaryEvent {
@@ -230,9 +243,11 @@ module KindPredicatesLog {
230
243
231
244
string getRAReference ( ) { result = this .getString ( "raReference" ) }
232
245
233
- Array getCounts ( ) { result = this .getArray ( "counts" ) }
246
+ float getCount ( int i ) { result = getRanked ( this .getArray ( "counts" ) , i ) }
234
247
235
- Array getDuplicationPercentages ( ) { result = this .getArray ( "duplicationPercentages" ) }
248
+ float getDuplicationPercentage ( int i ) {
249
+ result = getRanked ( this .getArray ( "duplicationPercentages" ) , i )
250
+ }
236
251
}
237
252
238
253
class PipeLineRuns extends Array {
@@ -245,9 +260,23 @@ module KindPredicatesLog {
245
260
PipeLineRun getRun ( int i ) { result = this .getObject ( i ) }
246
261
}
247
262
263
+ class Depencencies extends Object {
264
+ SummaryEvent event ;
265
+
266
+ Depencencies ( ) { event .getObject ( "dependencies" ) = this }
267
+
268
+ SummaryEvent getEvent ( ) { result = event }
269
+
270
+ predicate hasEntry ( string name , string hash ) { this .getString ( name ) = hash }
271
+
272
+ SummaryEvent getADependency ( ) { this .getString ( _) = result .getRAHash ( ) }
273
+ }
274
+
248
275
class ComputeSimple extends SummaryEvent {
249
276
ComputeSimple ( ) { evaluationStrategy = "COMPUTE_SIMPLE" }
250
277
278
+ Depencencies getDependencies ( ) { result = this .getObject ( "dependencies" ) }
279
+
251
280
PipeLineRun getPipelineRun ( ) { result .getArray ( ) = this .getArray ( "pipelineRuns" ) }
252
281
}
253
282
0 commit comments