From 83470dbdc97d4e05cd278c337d91d35a0b8f5e94 Mon Sep 17 00:00:00 2001 From: Armstrong Goes Date: Wed, 26 Feb 2020 13:42:35 +0000 Subject: [PATCH 1/2] Added support for stream-kubejobs monitor plugin --- visualizer/service/api/v10.py | 3 ++- visualizer/utils/datasources/datasource_influx.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/visualizer/service/api/v10.py b/visualizer/service/api/v10.py index 1bbd79f..684bed2 100644 --- a/visualizer/service/api/v10.py +++ b/visualizer/service/api/v10.py @@ -109,7 +109,8 @@ def stop_visualization(data, app_id): raise exceptions.BadRequestException() plugin = data['plugin'] - if plugin == 'kubejobs': + # TODO We need to think in a better design for this + if plugin == 'kubejobs' or plugin == 'stream_kubejobs': # Call the executor by app_id and stop the visualization. visualized_apps[app_id].stop_visualization() diff --git a/visualizer/utils/datasources/datasource_influx.py b/visualizer/utils/datasources/datasource_influx.py index 1776945..f8f2559 100644 --- a/visualizer/utils/datasources/datasource_influx.py +++ b/visualizer/utils/datasources/datasource_influx.py @@ -45,7 +45,8 @@ def __init__(self, monitor_plugin, database_data, app_id): self.datasource_url = database_data['url'] self.datasource_port = database_data['port'] self.database_name = database_data['name'] - if(monitor_plugin == 'kubejobs'): + # TODO We need to think in a better design for this + if(monitor_plugin == 'kubejobs' or monitor_plugin == 'stream_kubejobs'): self.dashboard_path = K8S_TEMPLATE_PATH elif(monitor_plugin == 'external_api'): From 44ae1434d5c62619ae41b4eaedee972e94d48577 Mon Sep 17 00:00:00 2001 From: Armstrong Goes Date: Wed, 29 Apr 2020 18:26:03 -0300 Subject: [PATCH 2/2] Fixed pep8 --- visualizer/utils/datasources/datasource_influx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/visualizer/utils/datasources/datasource_influx.py b/visualizer/utils/datasources/datasource_influx.py index f8f2559..d479bc9 100644 --- a/visualizer/utils/datasources/datasource_influx.py +++ b/visualizer/utils/datasources/datasource_influx.py @@ -46,7 +46,8 @@ def __init__(self, monitor_plugin, database_data, app_id): self.datasource_port = database_data['port'] self.database_name = database_data['name'] # TODO We need to think in a better design for this - if(monitor_plugin == 'kubejobs' or monitor_plugin == 'stream_kubejobs'): + if(monitor_plugin == 'kubejobs' or + monitor_plugin == 'stream_kubejobs'): self.dashboard_path = K8S_TEMPLATE_PATH elif(monitor_plugin == 'external_api'):