| 1 | <?php |
||
| 17 | final class Delay implements ManagerInterface |
||
| 18 | { |
||
| 19 | use UriParser; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * SQL Driver switch |
||
| 23 | * @var DatabaseHandler |
||
| 24 | */ |
||
| 25 | private $switch; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Handler |
||
| 29 | * @var ManagerInterface |
||
| 30 | */ |
||
| 31 | private $handler; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Delay constructor. |
||
| 35 | * |
||
| 36 | * @param PDO $pdo |
||
| 37 | */ |
||
| 38 | public function __construct(PDO $pdo) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Client |
||
| 46 | * |
||
| 47 | * @param DelayInterface $client |
||
| 48 | * @return ClientInterface |
||
| 49 | */ |
||
| 50 | public function client(DelayInterface $client) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Clean the delay table |
||
| 57 | * |
||
| 58 | * @param int $delay - in seconds |
||
| 59 | * @return bool |
||
| 60 | */ |
||
| 61 | public function clean($delay = 60) |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Top X wait time |
||
| 68 | * |
||
| 69 | * @param int $limit |
||
| 70 | * @param int $min |
||
| 71 | * @return array |
||
| 72 | */ |
||
| 73 | public function getTopWaitTimes($limit = 100, $min = 0) |
||
| 77 | } |
||
| 78 |