You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,8 +19,9 @@ class Monitor extends ConsoleCommand
19
19
protectedfunctionconfigure()
20
20
{
21
21
$this->setName('queuedtracking:monitor');
22
-
$this->setDescription('Shows and updates the current state of the queue every 2 seconds.');
22
+
$this->setDescription("Shows and updates the current state of the queue every 2 seconds.\n Key ,=first page, .=last page, 0-9=move to page section, arrow LEFT=prev page, RIGHT=next page, UP=next 10 pages, DOWN=prev 10 pages, q=quit");
23
23
$this->addRequiredValueOption('iterations', null, 'If set, will limit the number of monitoring iterations done.');
24
+
$this->addRequiredValueOption('perpage', 'p', 'Number of queue worker displayed per page.', 16);
24
25
}
25
26
26
27
/**
@@ -36,6 +37,9 @@ protected function doExecute(): int
$memory = $backend->getMemoryStats(); // I know this will only work with redis currently as it is not defined in backend interface etc. needs to be refactored once we add another backend
90
+
if (microtime(true) - $lastStatsTimer >= 2 || $keyPressed != "")
$memory = $backend->getMemoryStats(); // I know this will only work with redis currently as it is not defined in backend interface etc. needs to be refactored once we add another backend
Copy file name to clipboardExpand all lines: Commands/Process.php
+72-14Lines changed: 72 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,9 @@ protected function configure()
26
26
$this->setName('queuedtracking:process');
27
27
$this->addRequiredValueOption('queue-id', null, 'If set, will only work on that specific queue. For example "0" or "1" (if there are multiple queues). Not recommended when only one worker is in use. If for example 4 workers are in use, you may want to use 0, 1, 2, or 3.');
28
28
$this->addRequiredValueOption('force-num-requests-process-at-once', null, 'If defined, it overwrites the setting of how many requests will be picked out of the queue and processed at once. Must be a number which is >= 1. By default, the configured value from the settings will be used. This can be useful for example if you want to process every single request within the queue. If otherwise a batch size of say 100 is configured, then there may be otherwise 99 requests left in the queue. It can be also useful for testing purposes.');
29
+
$this->addRequiredValueOption('cycle', 'c', 'The proccess will automatically loop for "n" cycle time(s), set "0" to infinite.', 1);
30
+
$this->addRequiredValueOption('sleep', 's', 'Take a nap for "n" second(s) before recycle, minimum is 1 second.', 1);
31
+
$this->addRequiredValueOption('delay', 'd', 'Delay before finished', 0);
29
32
$this->setDescription('Processes all queued tracking requests in case there are enough requests in the queue and in case they are not already in process by another script. To keep track of the queue use the <comment>--verbose</comment> option or execute the <comment>queuedtracking:monitor</comment> command.');
30
33
}
31
34
@@ -76,29 +79,84 @@ protected function doExecute(): int
76
79
thrownew \Exception('Number of requests to process must be a number and at least 1');
77
80
}
78
81
79
-
$output->writeln("<info>Starting to process request sets, this can take a while</info>");
80
-
81
82
register_shutdown_function(function () use ($queueManager) {
#change the number according to how many worker(s) you have
56
+
numprocs=16
57
+
58
+
numprocs_start=0
59
+
stopsignal=TERM
60
+
autostart=true
61
+
autorestart=true
62
+
stopwaitsecs=120
63
+
#priority=1000
64
+
stdout_logfile=/dev/null
65
+
stdout_logfile_maxbytes=0
66
+
redirect_stderr=true
67
+
```
68
+
46
69
__Can I keep track of the state of the queue?__
47
70
48
71
Yes, you can. Just execute the command `./console queuedtracking:monitor`. This will show the current state of the queue. To exit this command you can for example press `CTRL + C` key at the same time.
0 commit comments