support oracle v12 in ottertune server
This commit is contained in:
committed by
Dana Van Aken
parent
494b23678e
commit
8743c0c2b1
@@ -158,7 +158,7 @@ def set_field(fields):
|
||||
|
||||
def main():
|
||||
final_metrics = []
|
||||
with open('oracle.txt', 'r') as f:
|
||||
with open('oracle12.txt', 'r') as f:
|
||||
num = 0
|
||||
|
||||
lines = f.readlines()
|
||||
@@ -186,7 +186,7 @@ def main():
|
||||
elif num == 2:
|
||||
fields['summary'] = line
|
||||
fields['scope'] = 'global'
|
||||
fields['dbms'] = 18 # oracle
|
||||
fields['dbms'] = 12 # oracle
|
||||
fields['category'] = ''
|
||||
fields['enumvals'] = None
|
||||
fields['context'] = ''
|
||||
@@ -201,9 +201,9 @@ def main():
|
||||
entry['fields'] = fields
|
||||
final_metrics.append(entry)
|
||||
num = (num + 1) % 3
|
||||
with open('oracle_knobs.json', 'w') as f:
|
||||
with open('oracle-12_knobs.json', 'w') as f:
|
||||
json.dump(final_metrics, f, indent=4)
|
||||
shutil.copy("oracle_knobs.json", "../../../../website/fixtures/oracle_knobs.json")
|
||||
shutil.copy("oracle-12_knobs.json", "../../../../website/fixtures/oracle-12_knobs.json")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@ import shutil
|
||||
|
||||
def main():
|
||||
final_metrics = []
|
||||
with open('oracle.txt', 'r') as f:
|
||||
with open('oracle12.txt', 'r') as f:
|
||||
odd = 0
|
||||
entry = {}
|
||||
fields = {}
|
||||
@@ -31,12 +31,12 @@ def main():
|
||||
fields['metric_type'] = 3 # stat
|
||||
if fields['name'] == "global.user commits":
|
||||
fields['metric_type'] = 1 # counter
|
||||
fields['dbms'] = 18 # oracle
|
||||
fields['dbms'] = 12 # oracle
|
||||
entry['fields'] = fields
|
||||
final_metrics.append(entry)
|
||||
with open('oracle_metrics.json', 'w') as f:
|
||||
with open('oracle-12_metrics.json', 'w') as f:
|
||||
json.dump(final_metrics, f, indent=4)
|
||||
shutil.copy('oracle_metrics.json', '../../../../website/fixtures/oracle_metrics.json')
|
||||
shutil.copy('oracle-12_metrics.json', '../../../../website/fixtures/oracle-12_metrics.json')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,51 +1,59 @@
|
||||
[
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":2,
|
||||
"fields":{
|
||||
"type":2,
|
||||
"version":"9.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":3,
|
||||
"fields":{
|
||||
"type":2,
|
||||
"version":"9.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":4,
|
||||
"fields":{
|
||||
"type":2,
|
||||
"version":"9.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":1,
|
||||
"fields":{
|
||||
"type":2,
|
||||
"version":"9.6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":9,
|
||||
"fields":{
|
||||
"type":9,
|
||||
"version":"5.6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":18,
|
||||
"fields":{
|
||||
"type":4,
|
||||
"version":"19.0.0.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
[
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":2,
|
||||
"fields":{
|
||||
"type":2,
|
||||
"version":"9.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":3,
|
||||
"fields":{
|
||||
"type":2,
|
||||
"version":"9.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":4,
|
||||
"fields":{
|
||||
"type":2,
|
||||
"version":"9.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":1,
|
||||
"fields":{
|
||||
"type":2,
|
||||
"version":"9.6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":9,
|
||||
"fields":{
|
||||
"type":9,
|
||||
"version":"5.6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":12,
|
||||
"fields":{
|
||||
"type":4,
|
||||
"version":"12.2.0.1.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"website.DBMSCatalog",
|
||||
"pk":19,
|
||||
"fields":{
|
||||
"type":4,
|
||||
"version":"19.0.0.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
8229
server/website/website/fixtures/oracle-19_knobs.json
Normal file
8229
server/website/website/fixtures/oracle-19_knobs.json
Normal file
File diff suppressed because it is too large
Load Diff
22123
server/website/website/fixtures/oracle-19_metrics.json
Normal file
22123
server/website/website/fixtures/oracle-19_metrics.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -19,8 +19,10 @@ def load_initial_data(apps, schema_editor):
|
||||
"postgres-94_metrics.json",
|
||||
"myrocks-5.6_knobs.json",
|
||||
"myrocks-5.6_metrics.json",
|
||||
"oracle_knobs.json",
|
||||
"oracle_metrics.json"
|
||||
"oracle-12_knobs.json",
|
||||
"oracle-12_metrics.json",
|
||||
"oracle-19_knobs.json",
|
||||
"oracle-19_metrics.json",
|
||||
]
|
||||
for fixture in initial_data_fixtures:
|
||||
call_command("loaddata", fixture, app_label="website")
|
||||
|
||||
@@ -98,7 +98,7 @@ class ConfigurationRecommendation(UpdateTask): # pylint: disable=abstract-metho
|
||||
def on_success(self, retval, task_id, args, kwargs):
|
||||
super(ConfigurationRecommendation, self).on_success(retval, task_id, args, kwargs)
|
||||
|
||||
result_id = args[0][0]['newest_result_id']
|
||||
result_id = retval['result_id']
|
||||
result = Result.objects.get(pk=result_id)
|
||||
|
||||
# Replace result with formatted result
|
||||
@@ -324,6 +324,7 @@ def configuration_recommendation_ddpg(result_info): # pylint: disable=invalid-n
|
||||
conf_map = {k: knob_data[i] for i, k in enumerate(knob_labels)}
|
||||
conf_map_res = {}
|
||||
conf_map_res['status'] = 'good'
|
||||
conf_map_res['result_id'] = result_id
|
||||
conf_map_res['recommendation'] = conf_map
|
||||
conf_map_res['info'] = 'INFO: ddpg'
|
||||
for k in knob_labels:
|
||||
@@ -340,6 +341,7 @@ def configuration_recommendation(recommendation_input):
|
||||
if target_data['bad'] is True:
|
||||
target_data_res = {}
|
||||
target_data_res['status'] = 'bad'
|
||||
target_data_res['result_id'] = target_data['newest_result_id']
|
||||
target_data_res['info'] = 'WARNING: no training data, the config is generated randomly'
|
||||
target_data_res['recommendation'] = target_data['config_recommend']
|
||||
return target_data_res
|
||||
@@ -595,6 +597,7 @@ def configuration_recommendation(recommendation_input):
|
||||
conf_map = {k: best_config[i] for i, k in enumerate(X_columnlabels)}
|
||||
conf_map_res = {}
|
||||
conf_map_res['status'] = 'good'
|
||||
conf_map_res['result_id'] = target_data['newest_result_id']
|
||||
conf_map_res['recommendation'] = conf_map
|
||||
conf_map_res['info'] = 'INFO: training data size is {}'.format(X_scaled.shape[0])
|
||||
return conf_map_res
|
||||
|
||||
Reference in New Issue
Block a user