Skip to content

Commit

Permalink
Merge pull request #35 from ufcg-lsd/cost-dashboard-impl
Browse files Browse the repository at this point in the history
implements cost dashboard
  • Loading branch information
armstrongmsg authored Apr 30, 2020
2 parents 237327e + c0446f4 commit 15dbb05
Show file tree
Hide file tree
Showing 4 changed files with 514 additions and 1 deletion.
2 changes: 2 additions & 0 deletions visualizer/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
from flask import Flask
from visualizer.api.v10 import rest
from visualizer.service import api
from visualizer.utils import logger


def main():
app = Flask(__name__)
app.register_blueprint(rest)
logger.configure_logging()
app.run(host='0.0.0.0', port=api.port, debug=True)
5 changes: 4 additions & 1 deletion visualizer/service/api/v10.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ def stop_visualization(data, app_id):
raise exceptions.BadRequestException()

plugin = data['plugin']

# TODO We need to think in a better design for this
if plugin == 'kubejobs' or plugin == 'stream_kubejobs':
if plugin == 'kubejobs'\
or plugin == 'kubejobs_cost'\
or plugin == 'stream_kubejobs':
# Call the executor by app_id and stop the visualization.
visualized_apps[app_id].stop_visualization()

Expand Down
6 changes: 6 additions & 0 deletions visualizer/utils/datasources/datasource_influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
'./visualizer/utils/templates/dashboard-job-influxdb-kubejobs.template'
VERTICAL_TEMPLATE_PATH = \
'./visualizer/utils/templates/dashboard-job-influxdb-vertical.template'
K8S_COST_TEMPLATE_PATH = \
'./visualizer/utils/templates/' \
'dashboard-job-influxdb-kubejobs-cost.template'

LOG_FILE = "influx-ds.log"
LOG_NAME = "influx-ds"
Expand All @@ -50,6 +53,9 @@ def __init__(self, monitor_plugin, database_data, app_id):
monitor_plugin == 'stream_kubejobs'):
self.dashboard_path = K8S_TEMPLATE_PATH

elif(monitor_plugin == 'kubejobs_cost'):
self.dashboard_path = K8S_COST_TEMPLATE_PATH

elif(monitor_plugin == 'external_api'):
self.dashboard_path = VERTICAL_TEMPLATE_PATH

Expand Down
Loading

0 comments on commit 15dbb05

Please sign in to comment.