diff --git a/libmetric/alarm.py b/libmetric/alarm.py index e359e53..f0fff22 100644 --- a/libmetric/alarm.py +++ b/libmetric/alarm.py @@ -13,9 +13,9 @@ def _aggregate_series(self): return float(self.data_frame[self.series].item()) def evaluate(self): - print "Question: {} {} {}?".format(self.alarm_threshold, + print("Question: {} {} {}?".format(self.alarm_threshold, self.alarm_operator, - self.value) + self.value)) response = False if self.alarm_operator == 'gt': if self.alarm_threshold > self.value: diff --git a/libmetric/cli.py b/libmetric/cli.py index f188659..b8e0f0d 100644 --- a/libmetric/cli.py +++ b/libmetric/cli.py @@ -53,7 +53,7 @@ def _range_metric(engine, url, user, password, partition, query, else: raise Exception("Unsupported engine {}.".format(engine)) - print query.get() + print(query.get()) def range_metric(): @@ -121,7 +121,7 @@ def _range_alarm(engine, url, user, password, partition, query, start, end, 'data_frame': data_frame } result = RangeAlarm(**alarm).evaluate() - print "Response: {}".format(result) + print("Response: {}".format(result)) def range_alarm(): @@ -164,7 +164,7 @@ def _instant_metric(engine, url, user, password, partition, query, moment): else: raise Exception("Unsupported engine {}.".format(engine)) - print query.get() + print(query.get()) def instant_metric(): @@ -222,7 +222,7 @@ def _instant_alarm(engine, url, user, password, partition, query, moment, 'data_frame': data_frame } result = InstantAlarm(**alarm).evaluate() - print "Response: {}".format(result) + print("Response: {}".format(result)) def instant_alarm(): @@ -269,7 +269,7 @@ def _search_metrics(engine, url, user, password, partition, search, else: raise Exception("Unsupported engine {}".format(engine)) - print search.get() + print(search.get()) def search_metrics(): diff --git a/libmetric/query_range.py b/libmetric/query_range.py index b157e40..8cf6212 100644 --- a/libmetric/query_range.py +++ b/libmetric/query_range.py @@ -211,9 +211,9 @@ def get(self): start, end, step = result[0] ds = result[1] rows = result[2] - print start, end, step - print ds - print rows + print(start, end, step) + print(ds) + print(rows) # return self._process(data) def _url(self): diff --git a/libmetric/search.py b/libmetric/search.py index 6045e9c..0619909 100644 --- a/libmetric/search.py +++ b/libmetric/search.py @@ -62,7 +62,7 @@ def _url(self): return self.base_url + url def _process(self, response): - print response + print(response) class RrdSearch(Search): @@ -75,7 +75,7 @@ def _url(self): def get(self): data_sources = set() info = rrdtool.info(self._url()) - for datum, real_value in info.items(): + for datum, real_value in list(info.items()): if datum.startswith('ds'): value = datum.replace('ds[', '').split('].') # if value[0] not in data_source: