Skip to content

Commit a7bc954

Browse files
committed
Python: CG trace: Metrics, number of recorded calls not ignored
turned out to be useful after all :P
1 parent 367a498 commit a7bc954

File tree

1 file changed

+9
-6
lines changed
  • python/tools/recorded-call-graph-metrics/ql

1 file changed

+9
-6
lines changed
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
import RecordedCalls
22

3+
// colum i is just used for sorting
34
from string text, float number, float ratio, int i
45
where
56
exists(int all_rcs | all_rcs = count(XMLRecordedCall rc) and ratio = number / all_rcs |
67
text = "XMLRecordedCall" and number = all_rcs and i = 0
78
or
89
text = "IgnoredRecordedCall" and number = count(IgnoredRecordedCall rc) and i = 1
10+
or
11+
text = "not IgnoredRecordedCall" and number = all_rcs - count(IgnoredRecordedCall rc) and i = 2
912
)
1013
or
1114
text = "----------" and
1215
number = 0 and
1316
ratio = 0 and
14-
i = 2
17+
i = 10
1518
or
1619
exists(int all_not_ignored_rcs |
1720
all_not_ignored_rcs = count(XMLRecordedCall rc | not rc instanceof IgnoredRecordedCall) and
1821
ratio = number / all_not_ignored_rcs
1922
|
2023
text = "IdentifiedRecordedCall" and
2124
number = count(IdentifiedRecordedCall rc | not rc instanceof IgnoredRecordedCall) and
22-
i = 3
25+
i = 11
2326
or
2427
text = "UnidentifiedRecordedCall" and
2528
number = count(UnidentifiedRecordedCall rc | not rc instanceof IgnoredRecordedCall) and
26-
i = 4
29+
i = 12
2730
)
2831
or
2932
text = "----------" and
3033
number = 0 and
3134
ratio = 0 and
32-
i = 5
35+
i = 20
3336
or
3437
exists(int all_identified_rcs |
3538
all_identified_rcs = count(IdentifiedRecordedCall rc | not rc instanceof IgnoredRecordedCall) and
@@ -40,14 +43,14 @@ where
4043
count(PointsToBasedCallGraph::ResolvableRecordedCall rc |
4144
not rc instanceof IgnoredRecordedCall
4245
) and
43-
i = 6
46+
i = 21
4447
or
4548
text = "points-to not ResolvableRecordedCall" and
4649
number =
4750
all_identified_rcs -
4851
count(PointsToBasedCallGraph::ResolvableRecordedCall rc |
4952
not rc instanceof IgnoredRecordedCall
5053
) and
51-
i = 7
54+
i = 22
5255
)
5356
select i, text, number, ratio * 100 + "%" as percent order by i

0 commit comments

Comments
 (0)