report runtime info in counter callbacks
This commit is contained in:
parent
a756529344
commit
f54f515f44
4 changed files with 41 additions and 3 deletions
|
@ -24,22 +24,29 @@
|
|||
if ($subop == "getLabelCounters") {
|
||||
$aid = $_GET["aid"];
|
||||
print "<rpc-reply>";
|
||||
print "<counters>";
|
||||
getLabelCounters($link);
|
||||
if ($aid) {
|
||||
getFeedCounter($link, $aid);
|
||||
}
|
||||
print "</counters>";
|
||||
print "</rpc-reply>";
|
||||
}
|
||||
|
||||
if ($subop == "getFeedCounters") {
|
||||
print "<rpc-reply>";
|
||||
print "<counters>";
|
||||
getFeedCounters($link);
|
||||
print "</counters>";
|
||||
print "</rpc-reply>";
|
||||
}
|
||||
|
||||
if ($subop == "getAllCounters") {
|
||||
print "<rpc-reply>";
|
||||
print "<counters>";
|
||||
getAllCounters($link);
|
||||
print "</counters>";
|
||||
print_runtime_info($link);
|
||||
print "</rpc-reply>";
|
||||
}
|
||||
|
||||
|
@ -71,8 +78,10 @@
|
|||
update_rss_feed($link, $feed_url, $feed_id);
|
||||
}
|
||||
|
||||
print "<rpc-reply>";
|
||||
print "<rpc-reply>";
|
||||
print "<counters>";
|
||||
getFeedCounter($link, $feed_id);
|
||||
print "</counters>";
|
||||
print "</rpc-reply>";
|
||||
|
||||
return;
|
||||
|
@ -108,6 +117,8 @@
|
|||
|
||||
print "<rpc-reply>";
|
||||
|
||||
print "<counters>";
|
||||
|
||||
if ($global_unread_caller != $global_unread) {
|
||||
|
||||
$omode = $_GET["omode"];
|
||||
|
@ -126,6 +137,10 @@
|
|||
|
||||
getGlobalCounters($link, $global_unread);
|
||||
|
||||
print "</counters>";
|
||||
|
||||
print_runtime_info($link);
|
||||
|
||||
print "</rpc-reply>";
|
||||
|
||||
}
|
||||
|
@ -154,7 +169,10 @@
|
|||
}
|
||||
}
|
||||
print "<rpc-reply>";
|
||||
print "<counters>";
|
||||
getAllCounters($link);
|
||||
print "</counters>";
|
||||
print_runtime_info($link);
|
||||
print "</rpc-reply>";
|
||||
}
|
||||
|
||||
|
@ -181,7 +199,10 @@
|
|||
}
|
||||
}
|
||||
print "<rpc-reply>";
|
||||
print "<counters>";
|
||||
getAllCounters($link);
|
||||
print "</counters>";
|
||||
print_runtime_info($link);
|
||||
print "</rpc-reply>";
|
||||
}
|
||||
|
||||
|
@ -190,6 +211,7 @@
|
|||
if (sanity_check($link)) {
|
||||
print "<error error-code=\"0\"/>";
|
||||
print_init_params($link);
|
||||
print_runtime_info($link);
|
||||
}
|
||||
print "</rpc-reply>";
|
||||
}
|
||||
|
|
|
@ -470,6 +470,11 @@ function parse_counters(reply, scheduled_call) {
|
|||
var f_document = getFeedsContext().document;
|
||||
var title_obj = getMainContext();
|
||||
|
||||
if (reply.firstChild && reply.firstChild.firstChild) {
|
||||
debug("<b>wrong element passed to parse_counters, adjusting.</b>");
|
||||
reply = reply.firstChild;
|
||||
}
|
||||
|
||||
debug("F_DOC: " + f_document + ", T_OBJ: " + title_obj);
|
||||
|
||||
for (var l = 0; l < reply.childNodes.length; l++) {
|
||||
|
@ -565,7 +570,9 @@ function all_counters_callback() {
|
|||
|
||||
var reply = xmlhttp_rpc.responseXML.firstChild;
|
||||
|
||||
parse_counters(reply);
|
||||
var counters = reply.firstChild;
|
||||
|
||||
parse_counters(counters);
|
||||
|
||||
} catch (e) {
|
||||
exception_error("all_counters_callback", e);
|
||||
|
|
|
@ -1718,4 +1718,11 @@
|
|||
|
||||
print "</init-params>";
|
||||
}
|
||||
|
||||
function print_runtime_info($link) {
|
||||
print "<runtime-info>";
|
||||
print "<param key=\"daemon_is_running\" value=\"".
|
||||
sprintf("%d", file_is_locked("update_daemon.lock")) . "\"/>";
|
||||
print "</runtime-info>";
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -70,8 +70,10 @@ function refetch_callback() {
|
|||
if (error_code && error_code != 0) {
|
||||
return fatalError(error_code, reply.getAttribute("error-msg"));
|
||||
}
|
||||
|
||||
var counters = reply.firstChild;
|
||||
|
||||
parse_counters(reply, true);
|
||||
parse_counters(counters, true);
|
||||
|
||||
debug("refetch_callback: done");
|
||||
|
||||
|
|
Loading…
Reference in a new issue