• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NIT-Administrative-Systems / SysDev-laravel-soa / 21218718699

21 Jan 2026 05:10PM UTC coverage: 39.583% (-5.5%) from 45.13%
21218718699

Pull #185

github

web-flow
Merge 2ff0207a2 into 35f9e968a
Pull Request #185: EventHub command protection and restyling

7 of 196 new or added lines in 9 files covered. (3.57%)

6 existing lines in 5 files now uncovered.

285 of 720 relevant lines covered (39.58%)

13.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Console/Commands/EventHub/QueueOverview.php
1
<?php
2

3
namespace Northwestern\SysDev\SOA\Console\Commands\EventHub;
4

5
use Illuminate\Console\Command;
6
use Northwestern\SysDev\SOA\Console\Commands\Concerns\FormatsCommandOutput;
7
use Northwestern\SysDev\SOA\EventHub;
8

9
use function Laravel\Prompts\note;
10
use function Laravel\Prompts\spin;
11
use function Laravel\Prompts\table;
12

13
class QueueOverview extends Command
14
{
15
    use FormatsCommandOutput;
16

17
    protected $signature = 'eventhub:queue:status {duration?}';
18

19
    protected $description = 'Display statistics & information about any queues available for reading';
20

21
    public function __construct(
22
        protected EventHub\Queue $queue_api,
23
        protected EventHub\DeadLetterQueue $dlq_api
24
    ) {
UNCOV
25
        parent::__construct();
×
26
    }
27

28
    public function handle(): int
29
    {
30
        $duration = $this->argument('duration');
×
NEW
31
        $duration = $duration !== null ? (int) $duration : null;
×
32

NEW
33
        $queues = spin(
×
NEW
34
            fn () => $this->queue_api->listAll($duration),
×
NEW
35
            'Fetching queue information...'
×
NEW
36
        );
×
37

NEW
38
        if (count($queues) === 0) {
×
NEW
39
            $this->components->error('You have no queues available.');
×
40

NEW
41
            return self::FAILURE;
×
42
        }
43

44
        foreach ($queues as $queue_detail) {
×
45
            $stats = collect($queue_detail['queueStatistics']);
×
46
            $stat_headers = collect($stats->first())->keys();
×
47

NEW
48
            $dlq_info = spin(
×
NEW
49
                fn () => $this->dlq_api->getInfo($queue_detail['topicName'], $duration),
×
NEW
50
                "Fetching DLQ info for {$queue_detail['topicName']}..."
×
NEW
51
            );
×
UNCOV
52
            $dlq_stats = collect($dlq_info['queueStatistics']);
×
53

54
            // Remove some of the less exciting information to cut down on visual clutter
55
            $info_to_display = collect($queue_detail)->except(['queueStatistics', 'topicName', 'name', 'eventHubAccount']);
×
56

NEW
57
            $this->divider();
×
NEW
58
            $this->newLine();
×
NEW
59
            $this->line(vsprintf(' <fg=white>Queue:</> <bg=magenta;fg=white;options=bold> %s </>', [$queue_detail['topicName']]));
×
NEW
60
            $this->newLine();
×
61

62
            foreach ($info_to_display as $key => $value) {
×
NEW
63
                $this->styledDetail($key, $value);
×
64
            }
65

NEW
66
            $this->newLine();
×
NEW
67
            note('Queue Statistics');
×
NEW
68
            table(headers: $stat_headers->all(), rows: $stats->all());
×
NEW
69
            $this->newLine();
×
70

NEW
71
            note('Dead Letter Queue Statistics');
×
NEW
72
            table(headers: $stat_headers->all(), rows: $dlq_stats->all());
×
73
        }
74

NEW
75
        return self::SUCCESS;
×
76
    }
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc