@@ -16,14 +16,36 @@ import KindPredicatesLog
16
16
float getBadness ( ComputeSimple simple ) {
17
17
exists ( float maxTupleCount , float resultSize , float largestDependency , float denom |
18
18
resultSize = simple .getResultSize ( ) and
19
- maxTupleCount = max ( simple . getPipelineRun ( ) . getCount ( _ ) ) and
19
+ extractInformation ( simple , maxTupleCount , _ , _ , _ , _ ) and
20
20
largestDependency = max ( simple .getDependencies ( ) .getADependency ( ) .getResultSize ( ) ) and
21
21
denom = resultSize .maximum ( largestDependency ) and
22
22
denom > 0 and // avoid division by zero (which would create a NaN result).
23
23
result = maxTupleCount / denom
24
24
)
25
25
}
26
26
27
- from ComputeSimple evt , float f
28
- where f = getBadness ( evt ) and f > 1.5
29
- select evt , f order by f desc
27
+ pragma [ nomagic]
28
+ predicate hasPipelineRun ( ComputeSimple simple , PipeLineRun run ) { run = simple .getPipelineRun ( ) }
29
+
30
+ predicate extractInformation (
31
+ ComputeSimple simple , float maxTupleCount , int pipelineIndex , Array tuples ,
32
+ Array duplicationPercentages , Array ra
33
+ ) {
34
+ exists ( PipeLineRun run |
35
+ hasPipelineRun ( simple , run ) and
36
+ maxTupleCount = max ( run .getCount ( _) ) and
37
+ pragma [ only_bind_out ] ( tuples .getFloat ( pipelineIndex ) ) = maxTupleCount and
38
+ tuples = run .getCounts ( ) and
39
+ duplicationPercentages = run .getDuplicationPercentage ( ) and
40
+ ra = simple .getRa ( )
41
+ )
42
+ }
43
+
44
+ from
45
+ ComputeSimple evt , float f , float maxTupleCount , int pipelineIndex , Array tuples ,
46
+ Array duplicationPercentages , Array ra
47
+ where
48
+ f = getBadness ( evt ) and
49
+ f > 1.5 and
50
+ extractInformation ( evt , maxTupleCount , pipelineIndex , tuples , duplicationPercentages , ra )
51
+ select evt , f , pipelineIndex , tuples , duplicationPercentages , ra order by f desc
0 commit comments