… | |
… | |
225 | <ul> |
225 | <ul> |
226 | EOF |
226 | EOF |
227 | |
227 | |
228 | for ( |
228 | for ( |
229 | ["download queue", $queue_file], |
229 | ["download queue", $queue_file], |
230 | ["other queue", $queue_index], |
230 | $verbose ? (["other queue", $queue_index]) |
|
|
231 | : (), |
231 | ) { |
232 | ) { |
232 | my ($name, $queue) = @$_; |
233 | my ($name, $queue) = @$_; |
233 | my @waiters = $queue->waiters; |
234 | my @waiters = $queue->waiters; |
234 | $waiters[$_]{idx} = $_ + 1 for 0..$#waiters; |
235 | $waiters[$_]{idx} = $_ + 1 for 0..$#waiters; |
235 | |
236 | |
236 | if (@waiters) { |
237 | if (@waiters) { |
237 | $content .= "<li>$name<br />".(scalar @waiters)." client(s); $queue->{started} downloads started; $queue->{slots} slots free;"; |
238 | $content .= "<li>$name<br />".(scalar @waiters)." client(s); $queue->{started} downloads started; $queue->{slots} slots free;"; |
238 | |
239 | |
239 | $content .= "<p>Waiting time until download starts, estimated:<ul>"; |
240 | $content .= "<p>Waiting time until download starts, estimated:<ul>"; |
240 | for ( |
241 | for ( |
241 | ["by most recently started transfer", $queue->{lastspb}], |
|
|
242 | ["by queue average", $queue->{avgspb}], |
242 | ["by queue average", $queue->{avgspb}], |
|
|
243 | $verbose ? (["by most recently started transfer", $queue->{lastspb}], |
243 | ["by next client in queue", $waiters[0]{spb}], |
244 | ["by next client in queue", $waiters[0]{spb}]) |
|
|
245 | : (), |
244 | ) { |
246 | ) { |
245 | my ($by, $spb) = @$_; |
247 | my ($by, $spb) = @$_; |
246 | $content .= "<li>$by<br />"; |
248 | $content .= "<li>$by<br />"; |
247 | if ($spb) { |
249 | if ($spb) { |
248 | $content .= sprintf "100 KB file: <b>%s</b>; 1 MB file: <b>%s</b>; 100MB file: <b>%s</b>;", |
250 | $content .= sprintf "100 KB file: <b>%s</b>; 1 MB file: <b>%s</b>; 100MB file: <b>%s</b>;", |