Commit Graph

18 Commits

Author SHA1 Message Date
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
f223e264c1 Switch back to jenseggers/date 2017-03-09 19:42:35 +00:00
James Brooks
2b75eca7d0 Remove jenssegers/date and solely use Carbon 2017-01-02 16:11:15 +00: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
a8bdc5bf52 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-10-30 17:32:41 +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
712b1078f2 Fixes metrics repository in PGSQL. Closes #1741 2016-05-05 17:59:30 +01:00
James Brooks
f9bc46b460 Refactored the way we store metrics 2016-04-25 20:42:00 +01:00
James Brooks
58f755d136 Fix Last hour metric points. Closes #1482 2016-02-20 19:39:07 +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
6d97c2e3ee Fixes #1354 Postgres Last Hour Metrics 2016-01-20 09:26:02 +00:00
James Brooks
3a0c052f8b Last hour of metric points 2015-12-24 11:27:22 +00:00
James Brooks
02d59e3424 Finish the PgSqlRepository for metrics. Closes #1035 2015-10-14 20:59:11 +01:00
James Brooks
7136457b49 Improved metric repository for per-db methods. Closes #921 2015-08-30 22:36:19 +01:00