reload default metrics in normalized_db_time object
This commit is contained in:
parent
37e0d58ce0
commit
3f0c82abbd
|
@ -52,6 +52,12 @@ class NormalizedDBTime(BaseTargetObjective):
|
||||||
for metric in MetricCatalog.objects.filter(dbms=dbms):
|
for metric in MetricCatalog.objects.filter(dbms=dbms):
|
||||||
self.default_values[metric.name] = metric.default
|
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):
|
def compute(self, metrics, observation_time):
|
||||||
extra_io_metrics = ["log file sync"]
|
extra_io_metrics = ["log file sync"]
|
||||||
not_io_metrics = ["read by other session"]
|
not_io_metrics = ["read by other session"]
|
||||||
|
|
|
@ -660,6 +660,10 @@ def handle_result_files(session, files, execution_times=None):
|
||||||
metric = MetricCatalog.objects.get(dbms=dbms, name=name)
|
metric = MetricCatalog.objects.get(dbms=dbms, name=name)
|
||||||
metric.default = numeric_metric_dict[name]
|
metric.default = numeric_metric_dict[name]
|
||||||
metric.save()
|
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(
|
numeric_metric_dict = parser.convert_dbms_metrics(
|
||||||
dbms.pk, metric_dict, observation_time, session.target_objective)
|
dbms.pk, metric_dict, observation_time, session.target_objective)
|
||||||
metric_data.data = JSONUtil.dumps(numeric_metric_dict)
|
metric_data.data = JSONUtil.dumps(numeric_metric_dict)
|
||||||
|
|
Loading…
Reference in New Issue