summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-05-13 18:08:05 +0000
committerGerrit Code Review <review@openstack.org>2016-05-13 18:08:05 +0000
commit2d1a47f6fdb216f7e2071ea635a830ecebd9034f (patch)
treef579ce23a540fc2928e2552d6ada5263530cd311
parentb536e942866387fbfa9ddb4cb1d77cbbb607e861 (diff)
parenta72e031506b6602b1ec71f36f9fc68ee27a809b9 (diff)
Merge "New Horizon Dashboard plugin for Kiloeyes Metrics"
-rw-r--r--kiloeyes_horizon/MANIFEST.in12
-rw-r--r--kiloeyes_horizon/README.rst40
-rw-r--r--kiloeyes_horizon/enabled/_50_kiloeyes_ui.py10
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/__init__.py0
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/cpu_perc/__init__.py0
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py24
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html13
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py19
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py20
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py24
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/dashboard.py27
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/disk_space/__init__.py0
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py24
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html27
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py19
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py20
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/disk_space/views.py26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/inputoutput/__init__.py0
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py24
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py19
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py20
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/load_avg/__init__.py0
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py24
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py19
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py20
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/load_avg/views.py26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/network/__init__.py0
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/network/panel.py24
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/network/tests.py19
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/network/urls.py20
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/network/views.py26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_mem/__init__.py0
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py24
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html35
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py19
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py20
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_mem/views.py26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_thrdcount/__init__.py0
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py24
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html40
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py19
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py20
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py26
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js1
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss1
-rw-r--r--kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html11
-rw-r--r--kiloeyes_horizon/setup.py32
51 files changed, 948 insertions, 0 deletions
diff --git a/kiloeyes_horizon/MANIFEST.in b/kiloeyes_horizon/MANIFEST.in
new file mode 100644
index 0000000..fb1ad12
--- /dev/null
+++ b/kiloeyes_horizon/MANIFEST.in
@@ -0,0 +1,12 @@
1include setup.py
2recursive-include kiloeyes_ui/templates *
3recursive-include kiloeyes_ui/static *
4recursive-include kiloeyes_ui/load_avg/templates *
5recursive-include kiloeyes_ui/cpu_perc/templates *
6recursive-include kiloeyes_ui/process_thrdcount/templates *
7recursive-include kiloeyes_ui/process_mem/templates *
8recursive-include kiloeyes_ui/network/templates *
9recursive-include kiloeyes_ui/disk_space/templates *
10recursive-include kiloeyes_ui/inputoutput/templates *
11
12
diff --git a/kiloeyes_horizon/README.rst b/kiloeyes_horizon/README.rst
new file mode 100644
index 0000000..a0ee78e
--- /dev/null
+++ b/kiloeyes_horizon/README.rst
@@ -0,0 +1,40 @@
1===============================================================
2Kiloeyes UI: Kiloeyes Extension for the OpenStack Dashboard (Horizon)
3===============================================================
4
5Kiloeyes UI is a Horizon Dashboard to monitor openstack metrics collected by Kiloeyes.
6It uses the standard Horizon extension systems, and maintains code and styling
7consistency where possible.
8
9Most of the developer information, as well as an overview of Horizon, can be
10found in the `Horizon documentation online`_.
11
12.. _Horizon documentation online: http://docs.openstack.org/developer/horizon/index.html
13
14Getting Started
15===============
16
17The quickest way to get up and running is:
18
19 1. Setup a basic `Devstack installation`_
20 2. Clone `Kiloeyes` with ``git clone https://github.com/openstack/kiloeyes``
21 3. Open ``/horizon/``
22 4. Run ``./tools/with_venv.sh pip install --upgrade <kiloeyes home>/kiloeyes/kiloeyes_horizon/dist/kiloeyes_horizon-0.0.1.tar.gz``.
23 5. Copy ``<kiloeyes home>/kiloeyes/kiloeyes_horizon/enabled/_50_kiloeyes_ui.py`` to ``/horizon/openstack_dashboard/enabled``
24 6. Copy and paste below configs to ``/horizon/openstack_dashboard/local/local_settings.py``
25
26 ``KIBANA_HOST = "<IP Address of Kibana Host>"
27 KIBANA_URL = "http://%s:5601" % KIBANA_HOST``
28
29Building Documentation
30======================
31
32This documentation is written by contributors who wats to add new panel to the dashboard.
33After adding the desired panels
34
35 1. Add the panel name in ``/kiloeyes/kiloeyes_horizon/kiloeyes_ui/dashboard.py``
36 2. Include the new panel template in ``/kiloeyes/kiloeyes_horizon/MANIFEST.in``
37 example: ``recursive-include kiloeyes_ui/<new panel>/templates *``
38 3. Run ``python Setup.py sdist``
39
40 After this, Follow the steps in ``Getting Started``
diff --git a/kiloeyes_horizon/enabled/_50_kiloeyes_ui.py b/kiloeyes_horizon/enabled/_50_kiloeyes_ui.py
new file mode 100644
index 0000000..95add00
--- /dev/null
+++ b/kiloeyes_horizon/enabled/_50_kiloeyes_ui.py
@@ -0,0 +1,10 @@
1# The name of the dashboard to be added to HORIZON['dashboards']. Required.
2DASHBOARD = 'kiloeyes_ui'
3
4# If set to True, this dashboard will not be added to the settings.
5DISABLED = False
6
7# A list of applications to be added to INSTALLED_APPS.
8ADD_INSTALLED_APPS = [
9 'kiloeyes_ui',
10]
diff --git a/kiloeyes_horizon/kiloeyes_ui/__init__.py b/kiloeyes_horizon/kiloeyes_ui/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/__init__.py
diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/__init__.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/__init__.py
diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py
new file mode 100644
index 0000000..cfc4d52
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py
@@ -0,0 +1,24 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.utils.translation import ugettext_lazy as _
14
15import horizon
16from kiloeyes_ui import dashboard
17
18
19class Cpu_Perc(horizon.Panel):
20 name = _("CPU Perc")
21 slug = "cpu_perc"
22
23
24dashboard.Kiloeyes_Ui.register(Cpu_Perc)
diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html
new file mode 100644
index 0000000..147697d
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html
@@ -0,0 +1,13 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Cpu_Perc" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Cpu_Perc") %}
7{% endblock page_header %}
8
9{% block main %}
10{{ kibana_url }}
11{% endblock %}
12
13
diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py
new file mode 100644
index 0000000..29564a5
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py
@@ -0,0 +1,19 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from horizon.test import helpers as test
14
15
16class Cpu_PercTests(test.TestCase):
17 # Unit tests for cpu_perc.
18 def test_me(self):
19 self.assertTrue(1 + 1 == 2)
diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py
new file mode 100644
index 0000000..4285f50
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py
@@ -0,0 +1,20 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf.urls import url
14
15from kiloeyes_ui.cpu_perc import views
16
17
18urlpatterns = [
19 url(r'^$', views.IndexView.as_view(), name='index'),
20]
diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py
new file mode 100644
index 0000000..f85a3d9
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py
@@ -0,0 +1,24 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf import settings
14from horizon import views
15
16
17class IndexView(views.APIView):
18 # A very simple class-based view...
19 template_name = 'kiloeyes_ui/cpu_perc/index.html'
20
21 def get_data(self, request, context, *args, **kwargs):
22 # Add data to the context here...
23 context['kibana_url'] = settings.KIBANA_URL
24 return context
diff --git a/kiloeyes_horizon/kiloeyes_ui/dashboard.py b/kiloeyes_horizon/kiloeyes_ui/dashboard.py
new file mode 100644
index 0000000..3c418a7
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/dashboard.py
@@ -0,0 +1,27 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.utils.translation import ugettext_lazy as _
14
15import horizon
16
17
18class Kiloeyes_Ui(horizon.Dashboard):
19 name = _("Kiloeyes")
20 slug = "kiloeyes_ui"
21 panels = ('load_avg', 'process_thrdcount', 'process_mem', 'network',
22 'disk_space', 'inputoutput', ) # Add your panels here.
23 default_panel = 'load_avg' # Specify the slug of
24 # the dashboard's default panel.
25
26
27horizon.register(Kiloeyes_Ui)
diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/__init__.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/__init__.py
diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py
new file mode 100644
index 0000000..682c254
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py
@@ -0,0 +1,24 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.utils.translation import ugettext_lazy as _
14
15import horizon
16from kiloeyes_ui import dashboard
17
18
19class Disk_Space(horizon.Panel):
20 name = _("Disk Space")
21 slug = "disk_space"
22
23
24dashboard.Kiloeyes_Ui.register(Disk_Space)
diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html b/kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html
new file mode 100644
index 0000000..b7fe487
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html
@@ -0,0 +1,27 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Disk Space" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Disk Space") %}
7{% endblock page_header %}
8
9{% block main %}
10<div>
11{% trans "Project ID:" %}
12{{ project_id }}
13</div>
14<div>
15<iframe src="{{ kibana_url }}/app/kibana#/visualize/edit/Disk-Space-Utilization-By-Project?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),
16time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',
17key:project_id,negate:!f,value:'{{ project_id }}'),query:(match:(project_id:(query:'{{ project_id }}',type:phrase))))),
18linked:!f,query:(query:(bool:(must:!((wildcard:(name:disk.space_used_perc)),(term:(_type:metrics)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),
19schema:metric,type:avg),(id:'2',params:(extended_bounds:(),field:timestamp,interval:86400000),schema:segment,type:histogram),
20(id:'3',params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms)),listeners:(),
21params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,
22interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,shareYAxis:!t,showCircles:!t,smoothLines:!f,times:!(),yAxis:()),
23title:'Disk%20Space%20Utilization%20By%20Project',type:line))" height="600" width="800"></iframe>
24</div>
25{% endblock %}
26
27
diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py
new file mode 100644
index 0000000..9689ec5
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py
@@ -0,0 +1,19 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from horizon.test import helpers as test
14
15
16class Disk_Space(test.TestCase):
17 # Unit tests for load_avg.
18 def test_me(self):
19 self.assertTrue(1 + 1 == 2)
diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py
new file mode 100644
index 0000000..be71b8f
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py
@@ -0,0 +1,20 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf.urls import url
14
15from kiloeyes_ui.disk_space import views
16
17
18urlpatterns = [
19 url(r'^$', views.IndexView.as_view(), name='index'),
20]
diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/views.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/views.py
new file mode 100644
index 0000000..255fcaa
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/views.py
@@ -0,0 +1,26 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf import settings
14from horizon import views
15
16
17class IndexView(views.APIView):
18 # A very simple class-based view...
19 template_name = 'kiloeyes_ui/disk_space/index.html'
20
21 def get_data(self, request, context, *args, **kwargs):
22 # Add data to the context here...
23 context['project_id'] = kwargs.get('project_id',
24 request.user.tenant_id)
25 context['kibana_url'] = settings.KIBANA_URL
26 return context
diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/__init__.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/__init__.py
diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py
new file mode 100644
index 0000000..470254a
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py
@@ -0,0 +1,24 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.utils.translation import ugettext_lazy as _
14
15import horizon
16from kiloeyes_ui import dashboard
17
18
19class Inputoutput(horizon.Panel):
20 name = _("IO")
21 slug = "inputoutput"
22
23
24dashboard.Kiloeyes_Ui.register(Inputoutput)
diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html b/kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html
new file mode 100644
index 0000000..ccb4314
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html
@@ -0,0 +1,26 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "IO" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("IO") %}
7{% endblock page_header %}
8
9{% block main %}
10<div>
11{% trans "Project ID:" %}
12{{ project_id }}
13</div>
14<div>
15<iframe src="{{ kibana_url }}/app/kibana#/visualize/edit/IO?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),
16time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',key:project_id,negate:!f,
17value:'{{ project_id }}'),query:(match:(project_id:(query:'{{ project_id }}',type:phrase))))),linked:!f,
18query:(query:(bool:(must:!((wildcard:(name:'io*')),(term:(_type:metrics)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),schema:metric,type:sum),
19(id:'2',params:(extended_bounds:(),field:timestamp,interval:86400000),schema:segment,type:histogram),(id:'3',params:(field:name,order:desc,orderBy:_term,size:0),
20schema:group,type:terms),(id:'4',params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms)),listeners:(),
21params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,
22setYExtents:!f,shareYAxis:!t,showCircles:!t,smoothLines:!f,times:!(),yAxis:()),title:IO,type:line))" height="600" width="80%"></iframe>
23</div>
24{% endblock %}
25
26
diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py
new file mode 100644
index 0000000..d874154
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py
@@ -0,0 +1,19 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from horizon.test import helpers as test
14
15
16class Inputoutput(test.TestCase):
17 # Unit tests for load_avg.
18 def test_me(self):
19 self.assertTrue(1 + 1 == 2)
diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py
new file mode 100644
index 0000000..06d0b52
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py
@@ -0,0 +1,20 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf.urls import url
14
15from kiloeyes_ui.inputoutput import views
16
17
18urlpatterns = [
19 url(r'^$', views.IndexView.as_view(), name='index'),
20]
diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py
new file mode 100644
index 0000000..1b889f8
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py
@@ -0,0 +1,26 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf import settings
14from horizon import views
15
16
17class IndexView(views.APIView):
18 # A very simple class-based view...
19 template_name = 'kiloeyes_ui/inputoutput/index.html'
20
21 def get_data(self, request, context, *args, **kwargs):
22 # Add data to the context here...
23 context['project_id'] = kwargs.get('project_id',
24 request.user.tenant_id)
25 context['kibana_url'] = settings.KIBANA_URL
26 return context
diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/__init__.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/__init__.py
diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py
new file mode 100644
index 0000000..d6b938a
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py
@@ -0,0 +1,24 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.utils.translation import ugettext_lazy as _
14
15import horizon
16from kiloeyes_ui import dashboard
17
18
19class Load_Avg(horizon.Panel):
20 name = _("Load Avg")
21 slug = "load_avg"
22
23
24dashboard.Kiloeyes_Ui.register(Load_Avg)
diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html b/kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html
new file mode 100644
index 0000000..1a82e29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html
@@ -0,0 +1,26 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Load Average" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Load Average") %}
7{% endblock page_header %}
8
9{% block main %}
10<div>
11{% trans "Project ID: "%}
12{{ project_id }}
13</div>
14<div>
15<iframe src="{{ kibana_url }}/app/kibana#/visualize/edit/Load-Average?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),
16time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(),linked:!f,query:(query:(match:(_type:metrics))),uiState:(vis:(colors:('Sum%20of%20value':%233F6833))),
17vis:(aggs:!((id:'1',params:(field:value),schema:metric,type:avg),(id:'2',params:(extended_bounds:(),field:timestamp,interval:86400000),schema:segment,type:histogram),
18(id:'3',params:(filters:!((input:(query:(term:(name:load.avg_1_min))),label:'Average%20Load%201%20min'),(input:(query:(term:(name:load.avg_5_min))),
19label:'Average%20Load%205%20min'),(input:(query:(term:(name:load.avg_15_min))),label:'Average%20Load%2015%20min'))),schema:group,type:filters),(id:'4',
20params:(filters:!((input:(query:(term:(project_id:'{{ project_id }}'))),label:'Project ID')),row:!t),schema:split,type:filters)),listeners:(),
21params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,shareYAxis:!t,
22showCircles:!t,smoothLines:!f,times:!(),yAxis:()),title:'Load%20Average',type:line))" height="600" width="80%"></iframe>
23</div>
24{% endblock %}
25
26
diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py
new file mode 100644
index 0000000..fd3b56f
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py
@@ -0,0 +1,19 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from horizon.test import helpers as test
14
15
16class Load_AvgTests(test.TestCase):
17 # Unit tests for load_avg.
18 def test_me(self):
19 self.assertTrue(1 + 1 == 2)
diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py
new file mode 100644
index 0000000..077449a
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py
@@ -0,0 +1,20 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf.urls import url
14
15from kiloeyes_ui.load_avg import views
16
17
18urlpatterns = [
19 url(r'^$', views.IndexView.as_view(), name='index'),
20]
diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/views.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/views.py
new file mode 100644
index 0000000..7c52f5a
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/views.py
@@ -0,0 +1,26 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf import settings
14from horizon import views
15
16
17class IndexView(views.APIView):
18 # A very simple class-based view...
19 template_name = 'kiloeyes_ui/load_avg/index.html'
20
21 def get_data(self, request, context, *args, **kwargs):
22 # Add data to the context here...
23 context['project_id'] = kwargs.get('project_id',
24 request.user.tenant_id)
25 context['kibana_url'] = settings.KIBANA_URL
26 return context
diff --git a/kiloeyes_horizon/kiloeyes_ui/network/__init__.py b/kiloeyes_horizon/kiloeyes_ui/network/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/network/__init__.py
diff --git a/kiloeyes_horizon/kiloeyes_ui/network/panel.py b/kiloeyes_horizon/kiloeyes_ui/network/panel.py
new file mode 100644
index 0000000..137fa65
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/network/panel.py
@@ -0,0 +1,24 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.utils.translation import ugettext_lazy as _
14
15import horizon
16from kiloeyes_ui import dashboard
17
18
19class Network(horizon.Panel):
20 name = _("Network")
21 slug = "network"
22
23
24dashboard.Kiloeyes_Ui.register(Network)
diff --git a/kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html b/kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html
new file mode 100644
index 0000000..92c3bc7
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html
@@ -0,0 +1,26 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Network" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Network") %}
7{% endblock page_header %}
8
9{% block main %}
10<div>
11{% trans "Project ID:" %}
12{{ project_id }}
13</div>
14<div>
15<iframe src="{{ kibana_url }}/app/kibana#/visualize/edit/Network?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),
16time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',key:project_id,negate:!f,
17value:'{{ project_id }}'),query:(match:(project_id:(query:'{{ project_id }}',type:phrase))))),linked:!f,
18query:(query:(bool:(must:!((wildcard:(name:'net*')),(term:(_type:metrics)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),schema:metric,type:sum),(id:'2',
19params:(extended_bounds:(),field:timestamp,interval:86400000),schema:segment,type:histogram),(id:'3',params:(field:name,order:desc,orderBy:_term,size:0),
20schema:group,type:terms),(id:'4',params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms)),listeners:(),params:(addLegend:!t,
21addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,shareYAxis:!t,showCircles:!t,
22smoothLines:!f,times:!(),yAxis:()),title:Network,type:line))" height="600" width="800"></iframe>
23</div>
24{% endblock %}
25
26
diff --git a/kiloeyes_horizon/kiloeyes_ui/network/tests.py b/kiloeyes_horizon/kiloeyes_ui/network/tests.py
new file mode 100644
index 0000000..1c701d1
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/network/tests.py
@@ -0,0 +1,19 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from horizon.test import helpers as test
14
15
16class Network(test.TestCase):
17 # Unit tests for load_avg.
18 def test_me(self):
19 self.assertTrue(1 + 1 == 2)
diff --git a/kiloeyes_horizon/kiloeyes_ui/network/urls.py b/kiloeyes_horizon/kiloeyes_ui/network/urls.py
new file mode 100644
index 0000000..fa51837
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/network/urls.py
@@ -0,0 +1,20 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf.urls import url
14
15from kiloeyes_ui.network import views
16
17
18urlpatterns = [
19 url(r'^$', views.IndexView.as_view(), name='index'),
20]
diff --git a/kiloeyes_horizon/kiloeyes_ui/network/views.py b/kiloeyes_horizon/kiloeyes_ui/network/views.py
new file mode 100644
index 0000000..e702a6e
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/network/views.py
@@ -0,0 +1,26 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf import settings
14from horizon import views
15
16
17class IndexView(views.APIView):
18 # A very simple class-based view...
19 template_name = 'kiloeyes_ui/network/index.html'
20
21 def get_data(self, request, context, *args, **kwargs):
22 # Add data to the context here...
23 context['project_id'] = kwargs.get('project_id',
24 request.user.tenant_id)
25 context['kibana_url'] = settings.KIBANA_URL
26 return context
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/__init__.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/__init__.py
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py
new file mode 100644
index 0000000..827fa83
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py
@@ -0,0 +1,24 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.utils.translation import ugettext_lazy as _
14
15import horizon
16from kiloeyes_ui import dashboard
17
18
19class Process_Mem(horizon.Panel):
20 name = _("Process Memory")
21 slug = "process_mem"
22
23
24dashboard.Kiloeyes_Ui.register(Process_Mem)
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html b/kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html
new file mode 100644
index 0000000..63d17ba
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html
@@ -0,0 +1,35 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Process Memory" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Process Memory in Bytes") %}
7{% endblock page_header %}
8
9{% block main %}
10<div>
11{% trans "Project ID:" %}
12{{ project_id }}
13</div>
14<div>
15<iframe src="{{ kibana_url }}/app/kibana#/visualize/edit/Process-Memory-Bytes?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),
16time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',key:project_id,
17negate:!f,value:'{{project_id}}'),query:(match:(project_id:(query:'{{project_id}}',type:phrase))))),linked:!f,
18query:(query:(bool:(must:!((term:(_type:metrics)),(term:(name:process.mem.rss_mbytes)))))),
19uiState:(vis:(colors:('{{project_id}}':%23508642),legendOpen:!t)),
20vis:(aggs:!((id:'1',params:(field:value),schema:metric,type:sum),(id:'2',params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms),
21(id:'3',params:(field:dimensions.process_name,order:desc,orderBy:_term,size:0),schema:segment,type:terms)),listeners:(),
22params:(addLegend:!t,addTooltip:!t,isDonut:!f,shareYAxis:!t),title:'Process%20Memory%20Bytes',type:pie))" height="600" width="800"></iframe>
23<iframe src="{{ kibana_url }}/app/kibana#/visualize/edit/Process-Mem-Bytes-vs-Time?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),
24time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',key:project_id,negate:!f,
25value:'{{project_id}}'),query:(match:(project_id:(query:'{{project_id}}',type:phrase))))),
26linked:!f,query:(query:(bool:(must:!((term:(_type:metrics)),(term:(name:process.mem.rss_mbytes)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),
27schema:metric,type:sum),(id:'2',params:(extended_bounds:(),field:timestamp,interval:86400000),schema:segment,type:histogram),
28(id:'3',params:(field:dimensions.process_name,order:desc,orderBy:_term,size:0),schema:group,type:terms),(id:'4',
29params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms)),listeners:(),
30params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,
31shareYAxis:!t,showCircles:!t,smoothLines:!f,times:!(),yAxis:()),title:'Process%20Mem%20Bytes%20vs%20Time',type:line))" height="600" width="800"></iframe>
32</div>
33{% endblock %}
34
35
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py
new file mode 100644
index 0000000..43c562f
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py
@@ -0,0 +1,19 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from horizon.test import helpers as test
14
15
16class Process_Mem(test.TestCase):
17 # Unit tests for load_avg.
18 def test_me(self):
19 self.assertTrue(1 + 1 == 2)
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py
new file mode 100644
index 0000000..30fb7c7
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py
@@ -0,0 +1,20 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf.urls import url
14
15from kiloeyes_ui.process_mem import views
16
17
18urlpatterns = [
19 url(r'^$', views.IndexView.as_view(), name='index'),
20]
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/views.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/views.py
new file mode 100644
index 0000000..556276e
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/views.py
@@ -0,0 +1,26 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf import settings
14from horizon import views
15
16
17class IndexView(views.APIView):
18 # A very simple class-based view...
19 template_name = 'kiloeyes_ui/process_mem/index.html'
20
21 def get_data(self, request, context, *args, **kwargs):
22 # Add data to the context here...
23 context['project_id'] = kwargs.get('project_id',
24 request.user.tenant_id)
25 context['kibana_url'] = settings.KIBANA_URL
26 return context
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/__init__.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/__init__.py
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py
new file mode 100644
index 0000000..60aa5df
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py
@@ -0,0 +1,24 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.utils.translation import ugettext_lazy as _
14
15import horizon
16from kiloeyes_ui import dashboard
17
18
19class Process_Thrdcount(horizon.Panel):
20 name = _("Process Thread Count")
21 slug = "process_thrdcount"
22
23
24dashboard.Kiloeyes_Ui.register(Process_Thrdcount)
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html
new file mode 100644
index 0000000..6061d28
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html
@@ -0,0 +1,40 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Process Thread Count" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Process Thread Count") %}
7{% endblock page_header %}
8
9{% block main %}
10<div>
11{% trans "Project ID:" %}
12{{ project_id }}
13</div>
14<div>
15<iframe src="{{ kibana_url }}/app/kibana#/visualize/edit/Process-Thread-Count?embed=true
16&_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-15m,mode:quick,to:now))
17&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',
18key:project_id,negate:!f,value:'{{project_id}}'),
19query:(match:(project_id:(query:'{{project_id}}',type:phrase))))),linked:!f,
20query:(query:(bool:(must:!((term:(_type:metrics)),(term:(name:process.thread_count)))))),
21uiState:(vis:(colors:('{{project_id}}':%23962D82),
22legendOpen:!t)),
23vis:(aggs:!((id:'1',params:(field:value),schema:metric,type:sum),(id:'2',
24params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms),
25(id:'3',params:(field:dimensions.process_name,order:desc,orderBy:_term,size:0),schema:segment,type:terms)),
26listeners:(),params:(addLegend:!t,addTooltip:!t,isDonut:!f,shareYAxis:!t),title:'Process%20Thread%20Count',type:pie))"
27height="600" width="800"></iframe>
28<iframe src="{{ kibana_url }}/app/kibana#/visualize/edit/Process-Thread-Count-vs-Time?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-15m,mode:quick,to:now))
29&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',
30key:project_id,negate:!f,value:'{{project_id}}'),query:(match:(project_id:(query:'{{project_id}}',type:phrase))))),
31linked:!f,query:(query:(bool:(must:!((term:(_type:metrics)),(term:(name:process.thread_count)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),
32schema:metric,type:sum),(id:'2',params:(extended_bounds:(),field:timestamp,interval:86400000),schema:segment,type:histogram),
33(id:'3',params:(field:dimensions.process_name,order:desc,orderBy:_term,size:0),schema:group,type:terms),
34(id:'4',params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms)),listeners:(),
35params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,
36shareYAxis:!t,showCircles:!t,smoothLines:!f,times:!(),yAxis:()),title:'Process%20Thread%20Count%20vs%20Time',type:line))" height="600" width="800"></iframe>
37</div>
38{% endblock %}
39
40
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py
new file mode 100644
index 0000000..ea54971
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py
@@ -0,0 +1,19 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from horizon.test import helpers as test
14
15
16class Process_ThrdcountTests(test.TestCase):
17 # Unit tests for load_avg.
18 def test_me(self):
19 self.assertTrue(1 + 1 == 2)
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py
new file mode 100644
index 0000000..cb54046
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py
@@ -0,0 +1,20 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf.urls import url
14
15from kiloeyes_ui.process_thrdcount import views
16
17
18urlpatterns = [
19 url(r'^$', views.IndexView.as_view(), name='index'),
20]
diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py
new file mode 100644
index 0000000..30dca93
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py
@@ -0,0 +1,26 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from django.conf import settings
14from horizon import views
15
16
17class IndexView(views.APIView):
18 # A very simple class-based view...
19 template_name = 'kiloeyes_ui/process_thrdcount/index.html'
20
21 def get_data(self, request, context, *args, **kwargs):
22 # Add data to the context here...
23 context['project_id'] = kwargs.get('project_id',
24 request.user.tenant_id)
25 context['kibana_url'] = settings.KIBANA_URL
26 return context
diff --git a/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js b/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js
new file mode 100644
index 0000000..59c981b
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js
@@ -0,0 +1 @@
/* Additional JavaScript for kiloeyes_ui. */
diff --git a/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss b/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss
new file mode 100644
index 0000000..431771b
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss
@@ -0,0 +1 @@
/* Additional SCSS for {{ dash_name }}. */
diff --git a/kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html b/kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html
new file mode 100644
index 0000000..d03ae24
--- /dev/null
+++ b/kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html
@@ -0,0 +1,11 @@
1{% extends 'base.html' %}
2
3{% block sidebar %}
4 {% include 'horizon/common/_sidebar.html' %}
5{% endblock %}
6
7{% block main %}
8 {% include "horizon/_messages.html" %}
9 {% block kiloeyes_ui_main %}{% endblock %}
10{% endblock %}
11
diff --git a/kiloeyes_horizon/setup.py b/kiloeyes_horizon/setup.py
new file mode 100644
index 0000000..0f60022
--- /dev/null
+++ b/kiloeyes_horizon/setup.py
@@ -0,0 +1,32 @@
1#!/usr/bin/env python
2# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
18
19from setuptools import find_packages
20from setuptools import setup
21
22setup(
23 name='kiloeyes_horizon',
24 version='0.0.1',
25 url='https://github.com/openstack/kiloeyes/kiloeyes_horizon',
26 author='Vishnu Govindaraj',
27 author_email='vg249@cornell.edu',
28 packages=find_packages(),
29 include_package_data=True,
30 setup_requires=['pbr'],
31 pbr=True,
32)