Skip to content

Commit f85b17d

Browse files
authored
Merge pull request #134 from flask-dashboard/development
Development
2 parents 24da232 + b431fb1 commit f85b17d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+962
-700
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Documentation Status](https://readthedocs.org/projects/flask-monitoringdashboard/badge/?version=latest)](http://flask-monitoringdashboard.readthedocs.io/en/latest/?badge=latest)
44
[![codecov](https://codecov.io/gh/flask-dashboard/Flask-MonitoringDashboard/branch/master/graph/badge.svg)](https://codecov.io/gh/flask-dashboard/Flask-MonitoringDashboard)
55
[![PyPI version](https://badge.fury.io/py/Flask-MonitoringDashboard.svg)](https://badge.fury.io/py/Flask-MonitoringDashboard)
6+
[![Gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Flask-MonitoringDashboard/Lobby)
67
[![Py-version](https://img.shields.io/pypi/pyversions/flask_monitoringdashboard.svg)](https://img.shields.io/pypi/pyversions/flask_monitoringdashboard.svg)
78
[![Downloads](http://pepy.tech/badge/flask-monitoringdashboard)](http://pepy.tech/count/flask-monitoringdashboard)
89

docs/changelog.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.
66
Please note that the changes before version 1.10.0 have not been documented.
77

88

9-
Unreleased
9+
v1.13.0
1010
----------
1111
Changed
1212

13-
- Added mean CPU
13+
- Added boxplot of CPU loads
1414

15-
- Updated documentation
15+
- Updated naming scheme of all graphs
16+
17+
- Implemented two configuration options: the local timezone and the option to automatically monitor new endpoints
1618

1719
- Updated the Test-Monitoring initialization
1820

21+
- Updated Database support for MySQL
1922

2023
v1.12.0
2124
-------

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
version = constants['version']
2929

3030
release = version
31-
copyright = '{}, {}'.format(datetime.datetime.now().year, author)
31+
copyright = '{}, {}'.format(datetime.datetime.utcnow().year, author)
3232

3333
# -- General configuration ---------------------------------------------------
3434

docs/configuration.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ contains the entry point of the app. The following things can be configured:
5454
APP_VERSION=1.0
5555
CUSTOM_LINK=dashboard
5656
DATABASE=sqlite:////<path to your project>/dashboard.db
57+
DEFAULT_MONITOR=True
58+
TIMEZONE='Europe/Amsterdam'
5759
USERNAME=admin
5860
PASSWORD=admin
5961
GUEST_USERNAME=guest
6062
GUEST_PASSWORD=['dashboardguest!', 'second_pw!']
6163
GIT=/<path to your project>/.git/
6264
OUTLIER_DETECTION_CONSTANT=2.5
63-
DASHBOARD_ENABLED = True
65+
DASHBOARD_ENABLED=True
6466
TEST_DIR=/<path to your project>/tests/
6567
COLORS={'main':'[0,97,255]',
6668
'static':'[255,153,0]'}
@@ -75,6 +77,19 @@ This might look a bit overwhelming, but the following list explains everything i
7577
- **DATABASE:** Suppose you have multiple projects where you're working on and want to separate the results.
7678
Then you can specify different database_names, such that the result of each project is stored in its own database.
7779

80+
- **DEFAULT_MONITOR:** When this configuration is set to True, new endpoints are automatically monitored by the Dashboard.
81+
82+
- **TIMEZONE:** The timezone for converting a UTC timestamp to a local timestamp. For a list of all
83+
timezones, use the following:
84+
85+
.. code-block:: python
86+
87+
import pytz # pip install pytz
88+
print(pytz.all_timezones)
89+
90+
The dashboard saves the time of every request by default in a UTC-timestamp. However, if you want to display
91+
it in a local timestamp, you need this property.
92+
7893
- **USERNAME** and **PASSWORD:** Must be used for logging into the Dashboard.
7994
Thus both are required.
8095

docs/contact.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@ Developing-team
66
---------------
77
Currently, the team consists of three active developers:
88

9-
+------------+----------------------------------------------------------------------+
10-
| |Picture1| | | **Patrick Vogel** |
11-
| | | |
12-
| | | Core developer |
13-
| | | |
14-
| | | **E-mail:** `patrickvogel@live.nl <mailto:patrickvogel@live.nl>`_. |
15-
+------------+----------------------------------------------------------------------+
16-
| |Picture2| | | **Thijs Klooster** |
17-
| | | |
18-
| | | Test Monitor Specialist |
19-
+------------+----------------------------------------------------------------------+
20-
| |Picture3| | | **Bogdan Petre** |
21-
| | | |
22-
| | | Outlier Specialist |
23-
+------------+----------------------------------------------------------------------+
9+
.. table::
10+
:widths: 2, 7
11+
12+
+------------+----------------------------------------------------------------------+
13+
| |Picture1| | | **Patrick Vogel** |
14+
| | | |
15+
| | | Core developer |
16+
| | | |
17+
| | | **E-mail:** `patrickvogel@live.nl <mailto:patrickvogel@live.nl>`_. |
18+
+------------+----------------------------------------------------------------------+
19+
| |Picture2| | | **Thijs Klooster** |
20+
| | | |
21+
| | | Test Monitor Specialist |
22+
+------------+----------------------------------------------------------------------+
23+
| |Picture3| | | **Bogdan Petre** |
24+
| | | |
25+
| | | Outlier Specialist |
26+
+------------+----------------------------------------------------------------------+
2427

2528
.. |Picture1| image:: https://avatars2.githubusercontent.com/u/17162650?s=460&v=4
2629
..:width: 100px

docs/developing.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ and views. Together this forms a Model-View-Controller-pattern:
4444
- **fmd_dashboard/overview.html**: For rendering the `Overview-page`_.
4545
- **fmd_dashboard/graph.html**: For rendering the following graphs:
4646

47-
- Heatmap
47+
- Hourly load
4848
- Version Usage
4949
- Requests per endpoint
50-
- Time per version
5150
- Time per endpoint
5251

5352
- **fmd_dashboard/graph-details.html**: For rendering the following graphs:
5453

55-
- Heatmap
54+
- Hourly load
5655
- Time per version per user
5756
- Time per version per ip
5857
- Time per version
@@ -67,7 +66,7 @@ and views. Together this forms a Model-View-Controller-pattern:
6766
.. _`Configuration-page`: http://localhost:5000/dashboard/configuration
6867
.. _`Login-page`: http://localhost:5000/dashboard/login
6968
.. _`Rules-page`: http://localhost:5000/dashboard/rules
70-
.. _`Overview-page`: http://localhost:5000/dashboard/measurements/overview
69+
.. _`Overview-page`: http://localhost:5000/dashboard/overview
7170
.. _`Testmonitor-page`: http://localhost:5000/dashboard/testmonitor
7271

7372
- **views**: Contains all Flask route-functions that the Dashboard defines.
@@ -84,7 +83,12 @@ The following tools are used for helping the development of the Dashboard:
8483
shown as the default branch on Github. The Master branch will approximately be updated every
8584
week. Every push to the master will be combined with a new version that is released in
8685
`PyPi <https://pypi.org/project/Flask-MonitoringDashboard>`_. This branch is also used to
87-
compute the `Code coverage`_ and build the documentation_.
86+
compute the `Code coverage`_ and build the documentation_. In case of a PR from development
87+
into master, take care of the following two things:
88+
89+
1. The version must be updated in flask_monitoringdashboard/constants.json
90+
91+
2. The changelog should be updated in docs/changelog.rst
8892

8993
.. _`Code coverage`: https://codecov.io/gh/flask-dashboard/Flask-MonitoringDashboard
9094

docs/functionality.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ To enable Travis to run your unit tests and send the results to the Dashboard, t
129129

130130
.. code-block:: bash
131131
132-
python -m flask_monitoringdashboard.collect_performance --test_folder=./tests --times=5 --url=https://yourdomain.org/dashboard
132+
python -m flask_monitoringdashboard.collect_performance \
133+
--test_folder=./tests \
134+
--times=5 \
135+
--url=https://yourdomain.org/dashboard
133136
134137
The `test_folder` argument specifies where the performance collection process can find the unit tests to use.
135138
The `times` argument (optional, default: 5) specifies how many times to run each of the unit tests.
@@ -182,9 +185,9 @@ The 'Dashboard'-menu contains the following content:
182185

183186
1. **Overview:** A table with the all the endpoints that are being monitored (or have been monitored in the past).
184187
This table provides information about when the endpoint is last being requested, how often it is requested and what
185-
the median execution time is. Furthermore, it has a 'Details' button on the right. This is explained further in (7.).
188+
the median execution time is. Furthermore, it has a 'Details' button on the right. This is explained further in (6).
186189

187-
2. **Heatmap:** This graph provides information for each hour of the day of how often the endpoint is being requested. In
190+
2. **Hourly load:** This graph provides information for each hour of the day of how often the endpoint is being requested. In
188191
this graph it is possible to detect popular hours during the day.
189192

190193
3. **Version Usage**: This graph provides information about the distribution of the utilization of the requests per version.
@@ -193,17 +196,14 @@ The 'Dashboard'-menu contains the following content:
193196
4. **Requests per endpoint:** This graph provides a row of information per day. In this graph, you can find
194197
whether the total number of requests grows over days.
195198

196-
5. **Time per version:** This graph provides a row of information per application-version. In this graph, you can
197-
find whether the execution time for all requests grows over the versions of the application.
198-
199-
6. **Time per endpoint:** This graph provides a row of information per endpoint. In that row, you can find all the
199+
5. **Time per endpoint:** This graph provides a row of information per endpoint. In that row, you can find all the
200200
requests for that endpoint. This provides information whether certain endpoints perform better (in terms of
201201
execution time) than other endpoints.
202202

203-
7. For each endpoint, there is a 'Details'-button (alternatively, you can click on the row itself). This provides the following
203+
6. For each endpoint, there is a 'Details'-button (alternatively, you can click on the row itself). This provides the following
204204
information (thus, all information below is specific for a single endpoint):
205205

206-
- **Heatmap:** The same heatmap as explained in (2.), but this time it is focused on the data of that particular
206+
- **Hourly load:** The same hourly load as explained in (2), but this time it is focused on the data of that particular
207207
endpoint only.
208208

209209
- **Time per version per user:** A circle plot with the average execution time per user per version. Thus, this

flask_monitoringdashboard/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def bind(app):
5555

5656
@user_app.after_request
5757
def after_request(response):
58-
hit_time_stamp = str(datetime.datetime.now())
58+
hit_time_stamp = str(datetime.datetime.utcnow())
5959
home = os.path.expanduser("~")
6060
log = open(home + '/endpoint_hits.log', 'a')
6161
log.write('"{}","{}"\n'.format(hit_time_stamp, request.endpoint))

flask_monitoringdashboard/collect_performance.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
for case in suite:
4141
for test in case:
4242
test_result = None
43-
start_time_stamp = str(datetime.datetime.now())
43+
start_time_stamp = str(datetime.datetime.utcnow())
4444
time_before = time.time()
4545
test_result = test.run(test_result)
4646
time_after = time.time()
47-
end_time_stamp = str(datetime.datetime.now())
47+
end_time_stamp = str(datetime.datetime.utcnow())
4848
log.write('"{}","{}","{}"\n'.format(start_time_stamp, end_time_stamp, str(test)))
4949
execution_time = (time_after - time_before) * 1000
5050
data['test_runs'].append(
51-
{'name': str(test), 'exec_time': execution_time, 'time': str(datetime.datetime.now()),
51+
{'name': str(test), 'exec_time': execution_time, 'time': str(datetime.datetime.utcnow()),
5252
'successful': test_result.wasSuccessful(), 'iter': iteration + 1})
5353
log.close()
5454

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.12.5",
2+
"version": "1.13.0",
33
"author": "Patrick Vogel, Thijs Klooster & Bogdan Petre",
44
"email": "patrickvogel@live.nl"
55
}

0 commit comments

Comments
 (0)