From ce4acfd07653d0fda5f12560b6ff06eeb60b93f6 Mon Sep 17 00:00:00 2001 From: paulfantom Date: Sun, 3 Jul 2016 14:43:54 +0200 Subject: [PATCH] implement `_get_raw_data` --- python.d/apache.chart.py | 2 +- python.d/apache_cache.chart.py | 2 +- python.d/nginx.chart.py | 2 +- python.d/phpfpm.chart.py | 2 +- python.d/python_modules/base.py | 9 +-------- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/python.d/apache.chart.py b/python.d/apache.chart.py index bc154091..f0f4fe2e 100644 --- a/python.d/apache.chart.py +++ b/python.d/apache.chart.py @@ -92,7 +92,7 @@ class Service(UrlService): :return: dict """ try: - raw = self._get_data().split("\n") + raw = self._get_raw_data().split("\n") except AttributeError: return None data = {} diff --git a/python.d/apache_cache.chart.py b/python.d/apache_cache.chart.py index a05b4ba4..438296b4 100644 --- a/python.d/apache_cache.chart.py +++ b/python.d/apache_cache.chart.py @@ -34,7 +34,7 @@ class Service(LogService): :return: dict """ try: - raw = self._get_data() + raw = self._get_raw_data() if raw is None: return None except (ValueError, AttributeError): diff --git a/python.d/nginx.chart.py b/python.d/nginx.chart.py index 668209c5..c50d0b72 100644 --- a/python.d/nginx.chart.py +++ b/python.d/nginx.chart.py @@ -61,7 +61,7 @@ class Service(UrlService): :return: dict """ try: - raw = self._get_data().split(" ") + raw = self._get_raw_data().split(" ") return {'active': int(raw[2]), 'requests': int(raw[7]), 'reading': int(raw[11]), diff --git a/python.d/phpfpm.chart.py b/python.d/phpfpm.chart.py index e8c01fd0..024e6f5c 100755 --- a/python.d/phpfpm.chart.py +++ b/python.d/phpfpm.chart.py @@ -62,7 +62,7 @@ class Service(UrlService): :return: dict """ try: - raw = self._get_data().split('\n') + raw = self._get_raw_data().split('\n') except AttributeError: return None data = {} diff --git a/python.d/python_modules/base.py b/python.d/python_modules/base.py index 114e9fda..7b338c97 100644 --- a/python.d/python_modules/base.py +++ b/python.d/python_modules/base.py @@ -303,16 +303,9 @@ class SimpleService(BaseService): self.definitions = {} BaseService.__init__(self, configuration=configuration, name=name) - def _get_raw_data(self): - """ - Get raw data from http request - :return: str - """ - return "" - def _get_data(self): """ - Format data received from request + Get some data :return: dict """ return {} -- 2.39.2