| | |
| | | <?php |
| | | namespace JVBase\managers\queue; |
| | | use DateTimeInterface; |
| | | use wpdb; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | |
| | | final class Metrics |
| | | { |
| | | public function __construct( |
| | | private \wpdb $db, |
| | | private wpdb $db, |
| | | private string $queueTable, |
| | | private string $statsTable |
| | | ) {} |
| | |
| | | /* ---------- Historical metrics (stats table) ---------- */ |
| | | |
| | | public function dailySummary( |
| | | \DateTimeInterface $from, |
| | | \DateTimeInterface $to |
| | | DateTimeInterface $from, |
| | | DateTimeInterface $to |
| | | ): array { |
| | | $sql = " |
| | | SELECT |
| | |
| | | |
| | | |
| | | public function dailyByType( |
| | | \DateTimeInterface $from, |
| | | \DateTimeInterface $to |
| | | DateTimeInterface $from, |
| | | DateTimeInterface $to |
| | | ): array { |
| | | $sql = " |
| | | SELECT |