}
our $last_highqueue = time();
+our $highest_queue_highwater = 0;
+our $highest_queue_lowwater = 0;
sub callfuncs {
my ($args, $sync, $wf, $message);
ARGS => $args,
ON_FINISH => ($sync ? undef : 'SrSv::IRCd::Queue::finished'), # FIXME
SYNCED => [synced, initial_synced],
- QUEUE_DEPTH_HIGHPRIO => SrSv::IRCd::Queue::queue_size(WF_ALL),
- QUEUE_DEPTH => SrSv::IRCd::Queue::queue_size(WF_MAX), # but not WF_MSG
+ QUEUE_DEPTH_HIGHPRIO => SrSv::IRCd::Queue::queue_size(WF_ALL), # but not WF_MSG
+ QUEUE_DEPTH => SrSv::IRCd::Queue::queue_size(WF_MAX),
};
if(initial_synced && ($message->{QUEUE_DEPTH_HIGHPRIO} > main_conf_queue_lowwater) && ($last_highqueue < time()-5)) {
+ my $queue_depth = $message->{QUEUE_DEPTH_HIGHPRIO};
ircd::privmsg_noloop(main_conf_local, main_conf_operchan, "HIGH TRAFFIC WARNING",
- "Queue depth exceeded @{[main_conf_queue_lowwater]}") if defined(main_conf_operchan);
+ "Queue depth exceeded: $queue_depth > @{[main_conf_queue_lowwater]}") if defined(main_conf_operchan);
ircd::privmsg_noloop(main_conf_local, main_conf_diag, "HIGH TRAFFIC WARNING",
- "Queue depth exceeded @{[main_conf_queue_lowwater]}");
+ "Queue depth exceeded: $queue_depth > @{[main_conf_queue_lowwater]}");
$last_highqueue = time();
}
+ if($message->{QUEUE_DEPTH_HIGHPRIO} > $highest_queue_lowwater) {
+ $highest_queue_lowwater = $message->{QUEUE_DEPTH_HIGHPRIO};
+ }
+ if($message->{QUEUE_DEPTH} > $highest_queue_highwater) {
+ $highest_queue_highwater = $message->{QUEUE_DEPTH};
+ }
+
if($sync) {
message($message);
}
}
+#FIXME: need an Event->timer call here.
+sub check_highqueue() {
+ my @msgs;
+ if($highest_queue_highwater > main_conf_queue_highwater) {
+ push @msgs, "Highest full queue depth: $highest_queue_highwater";
+ }
+ if($highest_queue_lowwater > main_conf_queue_lowwater) {
+ push @msgs, "Highest main queue depth: $highest_queue_lowwater";
+ }
+ if(scalar @msgs) {
+ ircd::privmsg_noloop(main_conf_local, main_conf_diag, @msgs);
+ ircd::privmsg_noloop(main_conf_local, main_conf_operchan, @msgs)
+ if defined(main_conf_operchan);
+ }
+
+ $highest_queue_highwater = $highest_queue_lowwater = 0;
+}
+
sub _realcall($$) {
no strict 'refs';