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

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

24 Feb 2025 09:57PM UTC coverage: 45.13% (-0.1%) from 45.277%
13508657684

Pull #184

github

web-flow
Merge 265b9b845 into a782f5d90
Pull Request #184: Laravel 12 Support

0 of 4 new or added lines in 2 files covered. (0.0%)

1 existing line in 1 file now uncovered.

278 of 616 relevant lines covered (45.13%)

14.48 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\EventHub;
7

8
class QueueOverview extends Command
9
{
10
    protected $signature = 'eventhub:queue:status {duration?}';
11

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

14
    protected $queue_api;
15

16
    protected $dlq_api;
17

18
    public function __construct(EventHub\Queue $queue_api, EventHub\DeadLetterQueue $dlq_api)
19
    {
20
        parent::__construct();
×
21

22
        $this->queue_api = $queue_api;
×
23
        $this->dlq_api = $dlq_api;
×
24
    } // end __construct
25

26
    public function handle()
27
    {
28
        $duration = $this->argument('duration');
×
29
        if ($duration !== null) {
×
30
            $duration = (int) $duration;
×
31
        }
32

33
        $queues = $this->queue_api->listAll($duration);
×
34
        $queue_count = count($queues);
×
35

36
        if ($queue_count === 0) {
×
37
            $this->error('You have no queues available.');
×
38

39
            return 1;
×
40
        }
41

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

46
            $dlq_info = $this->dlq_api->getInfo($queue_detail['topicName'], $duration);
×
47
            $dlq_stats = collect($dlq_info['queueStatistics']);
×
48

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

52
            $this->info(vsprintf('<fg=yellow;options=bold,underscore>Queue %s</>', [$queue_detail['topicName']]));
×
53
            $this->line('');
×
54

55
            foreach ($info_to_display as $key => $value) {
×
56
                if (is_bool($value) === true) {
×
57
                    $value = ($value === true ? 'true' : 'false');
×
58
                }
59

60
                $this->line("<fg=yellow>$key</>: $value");
×
61
            }
62

63
            $this->line('');
×
64
            $this->comment('Queue Statistics');
×
65
            $this->table($stat_headers->all(), $stats);
×
66
            $this->line('');
×
67

68
            $this->comment('Dead Letter Queue Statistics');
×
69
            $this->table($stat_headers->all(), $dlq_stats);
×
70
            $this->line('');
×
71
        }
72

73
        return 0;
×
74
    } // end handle
75

76
} // end QueueOverview
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

© 2025 Coveralls, Inc