| blib/lib/PAGI/Middleware/WebSocket/RateLimit.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| condition | 11 | 18 | 61.1 |
| line | l | !l | condition |
|---|---|---|---|
| 78 | 3 | 3 | $config->{'messages_per_second'} // 100 |
| 79 | 2 | 4 | $config->{'bytes_per_second'} // 1048576 |
| 80 | 2 | 4 | $config->{'burst_multiplier'} // 2 |
| 82 | 0 | 6 | $config->{'close_code'} // 1008 |
| 83 | 0 | 6 | $config->{'close_reason'} // "Rate limit exceeded" |
| 138 | 0 | 0 | ($event->{'text'} // $event->{'bytes'}) // "" |
| line | l | !l&&r | !l&&!r | condition |
|---|---|---|---|---|
| 87 | 1 | 5 | 0 | $config->{'on_error'} // sub { my($error, $event) = @_; warn "WebSocket::RateLimit send failed: $error\n"; } |
| 138 | 5 | 0 | 0 | $event->{'text'} // $event->{'bytes'} |