Fixed lint errors

This commit is contained in:
dvanaken 2020-03-19 19:39:57 -04:00 committed by Dana Van Aken
parent c423a4d435
commit 8eb79c3cc4
3 changed files with 9 additions and 5 deletions

View File

@ -220,10 +220,14 @@ class BaseParser:
'Unknown metric type for {}: {}'.format(name, metadata.metric_type)) 'Unknown metric type for {}: {}'.format(name, metadata.metric_type))
target_list = target_objectives.get_all(self.dbms_id) target_list = target_objectives.get_all(self.dbms_id)
if target_objective not in target_list:
raise ValueError(
"Invalid target objective '{}'. Expected one of: {}.".format(
target_objective, ', '.join(target_list.keys())))
for target_name, target_instance in target_list.items(): for target_name, target_instance in target_list.items():
metric_data[target_name] = target_instance.compute( metric_data[target_name] = target_instance.compute(
base_metric_data, observation_time) base_metric_data, observation_time)
LOG.info("Added target '%s=%s' to metric data", target_name, metric_data[target_name])
return metric_data return metric_data

View File

@ -84,9 +84,9 @@ class TargetObjectives:
self._default_target_objective = THROUGHPUT self._default_target_objective = THROUGHPUT
def register(self): def register(self):
from ..myrocks.target_objective import target_objective_list as _myrocks_list from ..myrocks.target_objective import target_objective_list as _myrocks_list # pylint: disable=import-outside-toplevel
from ..oracle.target_objective import target_objective_list as _oracle_list from ..oracle.target_objective import target_objective_list as _oracle_list # pylint: disable=import-outside-toplevel
from ..postgres.target_objective import target_objective_list as _postgres_list from ..postgres.target_objective import target_objective_list as _postgres_list # pylint: disable=import-outside-toplevel
if not self.registered(): if not self.registered():
LOG.info('Registering target objectives...') LOG.info('Registering target objectives...')

View File

@ -4,8 +4,8 @@
# Copyright (c) 2017-18, Carnegie Mellon University Database Group # Copyright (c) 2017-18, Carnegie Mellon University Database Group
# #
from ..base.target_objective import BaseTargetObjective, BaseThroughput, LESS_IS_BETTER
from website.types import DBMSType from website.types import DBMSType
from ..base.target_objective import BaseTargetObjective, BaseThroughput, LESS_IS_BETTER
class DBTime(BaseTargetObjective): class DBTime(BaseTargetObjective):