Browse Source

Merge "New Horizon Dashboard plugin for Kiloeyes Metrics"

changes/34/319134/1
Jenkins 3 years ago
parent
commit
2d1a47f6fd
51 changed files with 948 additions and 0 deletions
  1. 12
    0
      kiloeyes_horizon/MANIFEST.in
  2. 40
    0
      kiloeyes_horizon/README.rst
  3. 10
    0
      kiloeyes_horizon/enabled/_50_kiloeyes_ui.py
  4. 0
    0
      kiloeyes_horizon/kiloeyes_ui/__init__.py
  5. 0
    0
      kiloeyes_horizon/kiloeyes_ui/cpu_perc/__init__.py
  6. 24
    0
      kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py
  7. 13
    0
      kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html
  8. 19
    0
      kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py
  9. 20
    0
      kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py
  10. 24
    0
      kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py
  11. 27
    0
      kiloeyes_horizon/kiloeyes_ui/dashboard.py
  12. 0
    0
      kiloeyes_horizon/kiloeyes_ui/disk_space/__init__.py
  13. 24
    0
      kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py
  14. 27
    0
      kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html
  15. 19
    0
      kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py
  16. 20
    0
      kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py
  17. 26
    0
      kiloeyes_horizon/kiloeyes_ui/disk_space/views.py
  18. 0
    0
      kiloeyes_horizon/kiloeyes_ui/inputoutput/__init__.py
  19. 24
    0
      kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py
  20. 26
    0
      kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html
  21. 19
    0
      kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py
  22. 20
    0
      kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py
  23. 26
    0
      kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py
  24. 0
    0
      kiloeyes_horizon/kiloeyes_ui/load_avg/__init__.py
  25. 24
    0
      kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py
  26. 26
    0
      kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html
  27. 19
    0
      kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py
  28. 20
    0
      kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py
  29. 26
    0
      kiloeyes_horizon/kiloeyes_ui/load_avg/views.py
  30. 0
    0
      kiloeyes_horizon/kiloeyes_ui/network/__init__.py
  31. 24
    0
      kiloeyes_horizon/kiloeyes_ui/network/panel.py
  32. 26
    0
      kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html
  33. 19
    0
      kiloeyes_horizon/kiloeyes_ui/network/tests.py
  34. 20
    0
      kiloeyes_horizon/kiloeyes_ui/network/urls.py
  35. 26
    0
      kiloeyes_horizon/kiloeyes_ui/network/views.py
  36. 0
    0
      kiloeyes_horizon/kiloeyes_ui/process_mem/__init__.py
  37. 24
    0
      kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py
  38. 35
    0
      kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html
  39. 19
    0
      kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py
  40. 20
    0
      kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py
  41. 26
    0
      kiloeyes_horizon/kiloeyes_ui/process_mem/views.py
  42. 0
    0
      kiloeyes_horizon/kiloeyes_ui/process_thrdcount/__init__.py
  43. 24
    0
      kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py
  44. 40
    0
      kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html
  45. 19
    0
      kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py
  46. 20
    0
      kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py
  47. 26
    0
      kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py
  48. 1
    0
      kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js
  49. 1
    0
      kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss
  50. 11
    0
      kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html
  51. 32
    0
      kiloeyes_horizon/setup.py

+ 12
- 0
kiloeyes_horizon/MANIFEST.in View File

@@ -0,0 +1,12 @@
1
+include setup.py
2
+recursive-include kiloeyes_ui/templates *
3
+recursive-include kiloeyes_ui/static *
4
+recursive-include kiloeyes_ui/load_avg/templates *
5
+recursive-include kiloeyes_ui/cpu_perc/templates *
6
+recursive-include kiloeyes_ui/process_thrdcount/templates *
7
+recursive-include kiloeyes_ui/process_mem/templates *
8
+recursive-include kiloeyes_ui/network/templates *
9
+recursive-include kiloeyes_ui/disk_space/templates *
10
+recursive-include kiloeyes_ui/inputoutput/templates *
11
+
12
+

+ 40
- 0
kiloeyes_horizon/README.rst View File

@@ -0,0 +1,40 @@
1
+===============================================================
2
+Kiloeyes UI: Kiloeyes Extension for the OpenStack Dashboard (Horizon)
3
+===============================================================
4
+
5
+Kiloeyes UI is a Horizon Dashboard to monitor openstack metrics collected by Kiloeyes.
6
+It uses the standard Horizon extension systems, and maintains code and styling
7
+consistency where possible.
8
+
9
+Most of the developer information, as well as an overview of Horizon, can be
10
+found in the `Horizon documentation online`_.
11
+
12
+.. _Horizon documentation online: http://docs.openstack.org/developer/horizon/index.html
13
+
14
+Getting Started
15
+===============
16
+
17
+The 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
+
29
+Building Documentation
30
+======================
31
+
32
+This documentation is written by contributors who wats to add new panel to the dashboard.
33
+After 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``

+ 10
- 0
kiloeyes_horizon/enabled/_50_kiloeyes_ui.py View File

@@ -0,0 +1,10 @@
1
+# The name of the dashboard to be added to HORIZON['dashboards']. Required.
2
+DASHBOARD = 'kiloeyes_ui'
3
+
4
+# If set to True, this dashboard will not be added to the settings.
5
+DISABLED = False
6
+
7
+# A list of applications to be added to INSTALLED_APPS.
8
+ADD_INSTALLED_APPS = [
9
+    'kiloeyes_ui',
10
+]

+ 0
- 0
kiloeyes_horizon/kiloeyes_ui/__init__.py View File


+ 0
- 0
kiloeyes_horizon/kiloeyes_ui/cpu_perc/__init__.py View File


+ 24
- 0
kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py View File

@@ -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
+
13
+from django.utils.translation import ugettext_lazy as _
14
+
15
+import horizon
16
+from kiloeyes_ui import dashboard
17
+
18
+
19
+class Cpu_Perc(horizon.Panel):
20
+    name = _("CPU Perc")
21
+    slug = "cpu_perc"
22
+
23
+
24
+dashboard.Kiloeyes_Ui.register(Cpu_Perc)

+ 13
- 0
kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html View File

@@ -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
+

+ 19
- 0
kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py View File

@@ -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
+
13
+from horizon.test import helpers as test
14
+
15
+
16
+class Cpu_PercTests(test.TestCase):
17
+    # Unit tests for cpu_perc.
18
+    def test_me(self):
19
+        self.assertTrue(1 + 1 == 2)

+ 20
- 0
kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py View File

@@ -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
+
13
+from django.conf.urls import url
14
+
15
+from kiloeyes_ui.cpu_perc import views
16
+
17
+
18
+urlpatterns = [
19
+    url(r'^$', views.IndexView.as_view(), name='index'),
20
+]

+ 24
- 0
kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py View File

@@ -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
+
13
+from django.conf import settings
14
+from horizon import views
15
+
16
+
17
+class 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

+ 27
- 0
kiloeyes_horizon/kiloeyes_ui/dashboard.py View File

@@ -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
+
13
+from django.utils.translation import ugettext_lazy as _
14
+
15
+import horizon
16
+
17
+
18
+class 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
+
27
+horizon.register(Kiloeyes_Ui)

+ 0
- 0
kiloeyes_horizon/kiloeyes_ui/disk_space/__init__.py View File


+ 24
- 0
kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py View File

@@ -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
+
13
+from django.utils.translation import ugettext_lazy as _
14
+
15
+import horizon
16
+from kiloeyes_ui import dashboard
17
+
18
+
19
+class Disk_Space(horizon.Panel):
20
+    name = _("Disk Space")
21
+    slug = "disk_space"
22
+
23
+
24
+dashboard.Kiloeyes_Ui.register(Disk_Space)

+ 27
- 0
kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html View File

@@ -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),
16
+time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',
17
+key:project_id,negate:!f,value:'{{ project_id }}'),query:(match:(project_id:(query:'{{ project_id }}',type:phrase))))),
18
+linked:!f,query:(query:(bool:(must:!((wildcard:(name:disk.space_used_perc)),(term:(_type:metrics)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),
19
+schema: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:(),
21
+params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,
22
+interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,shareYAxis:!t,showCircles:!t,smoothLines:!f,times:!(),yAxis:()),
23
+title:'Disk%20Space%20Utilization%20By%20Project',type:line))" height="600" width="800"></iframe>
24
+</div>
25
+{% endblock %}
26
+
27
+

+ 19
- 0
kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py View File

@@ -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
+
13
+from horizon.test import helpers as test
14
+
15
+
16
+class Disk_Space(test.TestCase):
17
+    # Unit tests for load_avg.
18
+    def test_me(self):
19
+        self.assertTrue(1 + 1 == 2)

+ 20
- 0
kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py View File

@@ -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
+
13
+from django.conf.urls import url
14
+
15
+from kiloeyes_ui.disk_space import views
16
+
17
+
18
+urlpatterns = [
19
+    url(r'^$', views.IndexView.as_view(), name='index'),
20
+]

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/disk_space/views.py View File

@@ -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
+
13
+from django.conf import settings
14
+from horizon import views
15
+
16
+
17
+class 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

+ 0
- 0
kiloeyes_horizon/kiloeyes_ui/inputoutput/__init__.py View File


+ 24
- 0
kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py View File

@@ -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
+
13
+from django.utils.translation import ugettext_lazy as _
14
+
15
+import horizon
16
+from kiloeyes_ui import dashboard
17
+
18
+
19
+class Inputoutput(horizon.Panel):
20
+    name = _("IO")
21
+    slug = "inputoutput"
22
+
23
+
24
+dashboard.Kiloeyes_Ui.register(Inputoutput)

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html View File

@@ -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),
16
+time:(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,
17
+value:'{{ project_id }}'),query:(match:(project_id:(query:'{{ project_id }}',type:phrase))))),linked:!f,
18
+query:(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),
20
+schema:group,type:terms),(id:'4',params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms)),listeners:(),
21
+params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,
22
+setYExtents:!f,shareYAxis:!t,showCircles:!t,smoothLines:!f,times:!(),yAxis:()),title:IO,type:line))" height="600" width="80%"></iframe>
23
+</div>
24
+{% endblock %}
25
+
26
+

+ 19
- 0
kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py View File

@@ -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
+
13
+from horizon.test import helpers as test
14
+
15
+
16
+class Inputoutput(test.TestCase):
17
+    # Unit tests for load_avg.
18
+    def test_me(self):
19
+        self.assertTrue(1 + 1 == 2)

+ 20
- 0
kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py View File

@@ -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
+
13
+from django.conf.urls import url
14
+
15
+from kiloeyes_ui.inputoutput import views
16
+
17
+
18
+urlpatterns = [
19
+    url(r'^$', views.IndexView.as_view(), name='index'),
20
+]

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py View File

@@ -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
+
13
+from django.conf import settings
14
+from horizon import views
15
+
16
+
17
+class 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

+ 0
- 0
kiloeyes_horizon/kiloeyes_ui/load_avg/__init__.py View File


+ 24
- 0
kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py View File

@@ -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
+
13
+from django.utils.translation import ugettext_lazy as _
14
+
15
+import horizon
16
+from kiloeyes_ui import dashboard
17
+
18
+
19
+class Load_Avg(horizon.Panel):
20
+    name = _("Load Avg")
21
+    slug = "load_avg"
22
+
23
+
24
+dashboard.Kiloeyes_Ui.register(Load_Avg)

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html View File

@@ -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),
16
+time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(),linked:!f,query:(query:(match:(_type:metrics))),uiState:(vis:(colors:('Sum%20of%20value':%233F6833))),
17
+vis:(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))),
19
+label:'Average%20Load%205%20min'),(input:(query:(term:(name:load.avg_15_min))),label:'Average%20Load%2015%20min'))),schema:group,type:filters),(id:'4',
20
+params:(filters:!((input:(query:(term:(project_id:'{{ project_id }}'))),label:'Project ID')),row:!t),schema:split,type:filters)),listeners:(),
21
+params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,shareYAxis:!t,
22
+showCircles:!t,smoothLines:!f,times:!(),yAxis:()),title:'Load%20Average',type:line))" height="600" width="80%"></iframe>
23
+</div>
24
+{% endblock %}
25
+
26
+

+ 19
- 0
kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py View File

@@ -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
+
13
+from horizon.test import helpers as test
14
+
15
+
16
+class Load_AvgTests(test.TestCase):
17
+    # Unit tests for load_avg.
18
+    def test_me(self):
19
+        self.assertTrue(1 + 1 == 2)

+ 20
- 0
kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py View File

@@ -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
+
13
+from django.conf.urls import url
14
+
15
+from kiloeyes_ui.load_avg import views
16
+
17
+
18
+urlpatterns = [
19
+    url(r'^$', views.IndexView.as_view(), name='index'),
20
+]

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/load_avg/views.py View File

@@ -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
+
13
+from django.conf import settings
14
+from horizon import views
15
+
16
+
17
+class 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

+ 0
- 0
kiloeyes_horizon/kiloeyes_ui/network/__init__.py View File


+ 24
- 0
kiloeyes_horizon/kiloeyes_ui/network/panel.py View File

@@ -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
+
13
+from django.utils.translation import ugettext_lazy as _
14
+
15
+import horizon
16
+from kiloeyes_ui import dashboard
17
+
18
+
19
+class Network(horizon.Panel):
20
+    name = _("Network")
21
+    slug = "network"
22
+
23
+
24
+dashboard.Kiloeyes_Ui.register(Network)

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html View File

@@ -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),
16
+time:(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,
17
+value:'{{ project_id }}'),query:(match:(project_id:(query:'{{ project_id }}',type:phrase))))),linked:!f,
18
+query:(query:(bool:(must:!((wildcard:(name:'net*')),(term:(_type:metrics)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),schema:metric,type:sum),(id:'2',
19
+params:(extended_bounds:(),field:timestamp,interval:86400000),schema:segment,type:histogram),(id:'3',params:(field:name,order:desc,orderBy:_term,size:0),
20
+schema: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,
21
+addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,shareYAxis:!t,showCircles:!t,
22
+smoothLines:!f,times:!(),yAxis:()),title:Network,type:line))" height="600" width="800"></iframe>
23
+</div>
24
+{% endblock %}
25
+
26
+

+ 19
- 0
kiloeyes_horizon/kiloeyes_ui/network/tests.py View File

@@ -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
+
13
+from horizon.test import helpers as test
14
+
15
+
16
+class Network(test.TestCase):
17
+    # Unit tests for load_avg.
18
+    def test_me(self):
19
+        self.assertTrue(1 + 1 == 2)

+ 20
- 0
kiloeyes_horizon/kiloeyes_ui/network/urls.py View File

@@ -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
+
13
+from django.conf.urls import url
14
+
15
+from kiloeyes_ui.network import views
16
+
17
+
18
+urlpatterns = [
19
+    url(r'^$', views.IndexView.as_view(), name='index'),
20
+]

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/network/views.py View File

@@ -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
+
13
+from django.conf import settings
14
+from horizon import views
15
+
16
+
17
+class 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

+ 0
- 0
kiloeyes_horizon/kiloeyes_ui/process_mem/__init__.py View File


+ 24
- 0
kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py View File

@@ -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
+
13
+from django.utils.translation import ugettext_lazy as _
14
+
15
+import horizon
16
+from kiloeyes_ui import dashboard
17
+
18
+
19
+class Process_Mem(horizon.Panel):
20
+    name = _("Process Memory")
21
+    slug = "process_mem"
22
+
23
+
24
+dashboard.Kiloeyes_Ui.register(Process_Mem)

+ 35
- 0
kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html View File

@@ -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),
16
+time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(('$state':(store:appState),meta:(alias:!n,apply:!t,disabled:!f,index:'data_*',key:project_id,
17
+negate:!f,value:'{{project_id}}'),query:(match:(project_id:(query:'{{project_id}}',type:phrase))))),linked:!f,
18
+query:(query:(bool:(must:!((term:(_type:metrics)),(term:(name:process.mem.rss_mbytes)))))),
19
+uiState:(vis:(colors:('{{project_id}}':%23508642),legendOpen:!t)),
20
+vis:(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:(),
22
+params:(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),
24
+time:(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,
25
+value:'{{project_id}}'),query:(match:(project_id:(query:'{{project_id}}',type:phrase))))),
26
+linked:!f,query:(query:(bool:(must:!((term:(_type:metrics)),(term:(name:process.mem.rss_mbytes)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),
27
+schema: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',
29
+params:(field:project_id,order:desc,orderBy:_term,row:!t,size:0),schema:split,type:terms)),listeners:(),
30
+params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,
31
+shareYAxis:!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
+

+ 19
- 0
kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py View File

@@ -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
+
13
+from horizon.test import helpers as test
14
+
15
+
16
+class Process_Mem(test.TestCase):
17
+    # Unit tests for load_avg.
18
+    def test_me(self):
19
+        self.assertTrue(1 + 1 == 2)

+ 20
- 0
kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py View File

@@ -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
+
13
+from django.conf.urls import url
14
+
15
+from kiloeyes_ui.process_mem import views
16
+
17
+
18
+urlpatterns = [
19
+    url(r'^$', views.IndexView.as_view(), name='index'),
20
+]

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/process_mem/views.py View File

@@ -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
+
13
+from django.conf import settings
14
+from horizon import views
15
+
16
+
17
+class 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

+ 0
- 0
kiloeyes_horizon/kiloeyes_ui/process_thrdcount/__init__.py View File


+ 24
- 0
kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py View File

@@ -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
+
13
+from django.utils.translation import ugettext_lazy as _
14
+
15
+import horizon
16
+from kiloeyes_ui import dashboard
17
+
18
+
19
+class Process_Thrdcount(horizon.Panel):
20
+    name = _("Process Thread Count")
21
+    slug = "process_thrdcount"
22
+
23
+
24
+dashboard.Kiloeyes_Ui.register(Process_Thrdcount)

+ 40
- 0
kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html View File

@@ -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_*',
18
+key:project_id,negate:!f,value:'{{project_id}}'),
19
+query:(match:(project_id:(query:'{{project_id}}',type:phrase))))),linked:!f,
20
+query:(query:(bool:(must:!((term:(_type:metrics)),(term:(name:process.thread_count)))))),
21
+uiState:(vis:(colors:('{{project_id}}':%23962D82),
22
+legendOpen:!t)),
23
+vis:(aggs:!((id:'1',params:(field:value),schema:metric,type:sum),(id:'2',
24
+params:(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)),
26
+listeners:(),params:(addLegend:!t,addTooltip:!t,isDonut:!f,shareYAxis:!t),title:'Process%20Thread%20Count',type:pie))" 
27
+height="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_*',
30
+key:project_id,negate:!f,value:'{{project_id}}'),query:(match:(project_id:(query:'{{project_id}}',type:phrase))))),
31
+linked:!f,query:(query:(bool:(must:!((term:(_type:metrics)),(term:(name:process.thread_count)))))),uiState:(),vis:(aggs:!((id:'1',params:(field:value),
32
+schema: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:(),
35
+params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,drawLinesBetweenPoints:!t,interpolate:linear,radiusRatio:9,scale:linear,setYExtents:!f,
36
+shareYAxis:!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
+

+ 19
- 0
kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py View File

@@ -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
+
13
+from horizon.test import helpers as test
14
+
15
+
16
+class Process_ThrdcountTests(test.TestCase):
17
+    # Unit tests for load_avg.
18
+    def test_me(self):
19
+        self.assertTrue(1 + 1 == 2)

+ 20
- 0
kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py View File

@@ -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
+
13
+from django.conf.urls import url
14
+
15
+from kiloeyes_ui.process_thrdcount import views
16
+
17
+
18
+urlpatterns = [
19
+    url(r'^$', views.IndexView.as_view(), name='index'),
20
+]

+ 26
- 0
kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py View File

@@ -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
+
13
+from django.conf import settings
14
+from horizon import views
15
+
16
+
17
+class 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

+ 1
- 0
kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js View File

@@ -0,0 +1 @@
1
+/* Additional JavaScript for kiloeyes_ui. */

+ 1
- 0
kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss View File

@@ -0,0 +1 @@
1
+/* Additional SCSS for {{ dash_name }}. */

+ 11
- 0
kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html View File

@@ -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
+

+ 32
- 0
kiloeyes_horizon/setup.py View File

@@ -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
+
19
+from setuptools import find_packages
20
+from setuptools import setup
21
+
22
+setup(
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
+)

Loading…
Cancel
Save