reload default metrics in normalized_db_time object

This commit is contained in:
yangdsh 2020-04-24 19:17:03 -04:00 committed by Dana Van Aken
parent 37e0d58ce0
commit 3f0c82abbd
2 changed files with 10 additions and 0 deletions

View File

@ -52,6 +52,12 @@ class NormalizedDBTime(BaseTargetObjective):
for metric in MetricCatalog.objects.filter(dbms=dbms):
self.default_values[metric.name] = metric.default
def reload_default_metrics(self):
dbms = DBMSCatalog.objects.get(type=DBMSType.ORACLE, version='12.2.0.1.0')
self.default_values = {}
for metric in MetricCatalog.objects.filter(dbms=dbms):
self.default_values[metric.name] = metric.default
def compute(self, metrics, observation_time):
extra_io_metrics = ["log file sync"]
not_io_metrics = ["read by other session"]

View File

@ -660,6 +660,10 @@ def handle_result_files(session, files, execution_times=None):
metric = MetricCatalog.objects.get(dbms=dbms, name=name)
metric.default = numeric_metric_dict[name]
metric.save()
all_target_objectives = target_objectives.get_all(session.dbms.pk)
normalized_db_time = all_target_objectives.get('db_time', None)
if normalized_db_time is not None:
normalized_db_time.reload_default_metrics()
numeric_metric_dict = parser.convert_dbms_metrics(
dbms.pk, metric_dict, observation_time, session.target_objective)
metric_data.data = JSONUtil.dumps(numeric_metric_dict)