Attempt fix of PgSQL metrics

This commit is contained in:
James Brooks
2019-04-13 13:08:32 +01:00
parent adea4b269b
commit 1c79f07baa
+2 -2
View File
@@ -38,7 +38,7 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac
"AND {$this->getMetricPointsTable()}.created_at >= (NOW() - INTERVAL '{$minutes}' MINUTE) ". "AND {$this->getMetricPointsTable()}.created_at >= (NOW() - INTERVAL '{$minutes}' MINUTE) ".
"AND {$this->getMetricPointsTable()}.created_at <= NOW() ". "AND {$this->getMetricPointsTable()}.created_at <= NOW() ".
"GROUP BY to_char({$this->getMetricPointsTable()}.created_at, 'HH24:MI') ". "GROUP BY to_char({$this->getMetricPointsTable()}.created_at, 'HH24:MI') ".
"ORDER BY to_char({$this->getMetricPointsTable()}.created_at, 'HH24:MI')", [ "ORDER BY {$this->getMetricPointsTable()}.created_at", [
'metricId' => $metric->id, 'metricId' => $metric->id,
]); ]);
@@ -62,7 +62,7 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac
"AND {$this->getMetricPointsTable()}.created_at >= (NOW() - INTERVAL '{$hour}' HOUR) ". "AND {$this->getMetricPointsTable()}.created_at >= (NOW() - INTERVAL '{$hour}' HOUR) ".
"AND {$this->getMetricPointsTable()}.created_at <= NOW() ". "AND {$this->getMetricPointsTable()}.created_at <= NOW() ".
"GROUP BY to_char({$this->getMetricPointsTable()}.created_at, 'HH24:00') ". "GROUP BY to_char({$this->getMetricPointsTable()}.created_at, 'HH24:00') ".
"ORDER BY to_char({$this->getMetricPointsTable()}.created_at, 'HH24:00')", [ "ORDER BY {$this->getMetricPointsTable()}.created_at", [
'metricId' => $metric->id, 'metricId' => $metric->id,
]); ]);