-
Notifications
You must be signed in to change notification settings - Fork 10
/
apiFuncToQueries.py
51 lines (34 loc) · 1.58 KB
/
apiFuncToQueries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from DBContentsProvider import DBContentsProvider
from DataFlowModeling.DataFlowModelCreator import DataFlowModelCreator
from CheckModeling.CheckOverlayCreator import CheckOverlayCreator
from QueryGeneration.ModelToQuery import ModelToQuery
from Debug.ModelPrinter import ModelPrinter
class APIFuncToQueries:
def run(self, sinkSymbol):
contentProvider = DBContentsProvider()
modelCreator = DataFlowModelCreator(contentProvider)
modelCreator.setSourceDistInCluster(0.2)
modelCreator.setInvocDistInCluster(3)
modelCreator.setMinNumMemersInInvocCluster(4)
modelCreator.setTopnInvocClusters(10000)
modelCreator.createDataFlowModels(sinkSymbol)
models = modelCreator.getModels()
overlayCreator = CheckOverlayCreator(contentProvider)
overlayCreator.setMinCondObserved(3) # <- changed from 4
overlayCreator.setMinFracChecks(10) # <- changed from 10 # NOT USED!
overlayCreator.setTopnCheckHist(10) # <- changed from 10
overlayCreator.createForModels(models)
models = overlayCreator.getModels()
modelPrinter = ModelPrinter()
# modelPrinter.printSummary(models)
# modelPrinter.printAll(models)
converter = ModelToQuery()
for model in models:
query = converter.convert(model)
# print 'ClusterId: ' + str(model.clusterId)
print query
if __name__ == '__main__':
import sys
apiFunc = sys.argv[1]
tool = APIFuncToQueries()
tool.run(apiFunc)