<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2907/">https://reviewboard.asterisk.org/r/2907/</a>
</td>
</tr>
</table>
<br />
<p>Ship it!</p>
<p>- Mark</p>
<br />
<p>On October 15th, 2013, 12:36 p.m. UTC, wdoekes wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By wdoekes.</div>
<p style="color: grey;"><i>Updated Oct. 15, 2013, 12:36 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">When using realtime queues, queues have to be fetched from the database every now and then to see if any info has been changed or to see if the queue has been removed.
The 'queue show' command does a lookup for every queue in memory to see if the queue still exists. However, it also does that when we attempt to get info for a single queue only.
This patch fixes that: if there is an optional queue name that we look for, we skip the realtime lookups for other queues.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">For a very limited set of queues, that extra lookup could become severely slow:
mysql> select count(*) from asterisk_queue;
+----------+
| count(*) |
+----------+
| 471 |
+----------+
Before:
$ time asterisk -nrx 'queue show abcdef'
No such queue: abcdef.
real 0m30.519s
user 0m0.010s
sys 0m0.000s
After:
$ time asterisk -nrx 'queue show abcdef'
No such queue: abcdef.
real 0m0.004s
user 0m0.010s
sys 0m0.000s
(Similar times when the queue *is* found.)</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/branches/1.8/apps/app_queue.c <span style="color: grey">(400957)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2907/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>