Commit Graph

14 Commits

Author SHA1 Message Date
James Brooks
5ff2289eeb Apply fixes from StyleCI 2020-02-27 09:44:35 +00:00
James Brooks
4274395a40 Apply fixes from StyleCI (#2879)
[ci skip] [skip ci]
2018-01-21 20:46:11 +00:00
A
fc2e6f4062 Improves sorting of metric's labels.
When selecting the time of metric's points only the time was selected,
not the date. The issue with this is mainly in the view "Last 12 hours".
Example:
It's 11:10 am and I choose the "Last 12 hours" view, the metrics points
will be from 23:00 yesterday to 11:00 am today.
When giving all these datas and labels to ChartJS, it sorts the points
by label from lower to highter. It means 23:00 (from yesterday) will be
after the datas of today, it doesn't have sense.

To fix it, I've added in the repositories the date in addition to the
time. So it's no longer 11:00 that is selected but 2018-01-15 11:00.
I've updated the Metric vue in order to cut the label when displaying so
it doesn't change the displaying.
Because there are metric views that are based on date but not time,
there is a condition in the Metric vue to cut the string only if the
time is present.

Related to CachetHQ/Cachet#2848
2018-01-15 11:28:41 +01:00
A
d8208be179 Prevents to select metric points in future.
The metrics had problem with the points, if I post/save a metric point
that is created in the future, it was selected.

Example:
It is 10:00 am, I post or save a metric point and it's 'created at'
10:30 am. Using the "Last 12 hours" the metric point would be selected.

This update is applied on all the SQL queries, on minutes, hours, days.

Related to CachetHQ/Cachet#2848
2018-01-15 11:13:57 +01:00
James Brooks
e23a9358e7 Fix metrics when using table prefixes 2016-11-14 18:43:18 +00:00
James Brooks
1c00dec364 Always use dynamic table names 2016-10-30 17:35:57 +00:00
James Brooks
74c646e2f4 Rewrite the Metric repository implementation. Fixes #1900 2016-10-30 17:32:44 +00:00
James Brooks
1fdda03199 Metric repository now knows prefixes. Fixes #1938 2016-07-06 18:42:31 +01:00
James Brooks
f9bc46b460 Refactored the way we store metrics 2016-04-25 20:42:00 +01:00
Graham Campbell
ff6d26cc59 Removed old code 2016-02-02 20:06:16 +00:00
Joseph Cohen
47bba0b927 Remove converting timezone for fetching 2016-02-02 11:15:47 -06:00
Graham Campbell
1b24cdb1c5 Improved the config system 2016-01-29 23:05:31 +00:00
James Brooks
3a0c052f8b Last hour of metric points 2015-12-24 11:27:22 +00:00
James Brooks
7136457b49 Improved metric repository for per-db methods. Closes #921 2015-08-30 22:36:19 +01:00