Commit b748b5e2 authored by Evan Hunt's avatar Evan Hunt
Browse files

[master] fix cache/ADB stats in new stats schema

    new stats that were added for 9.10 (changes 3319-3326) were not
    all updated when the new statistics schema was merged (change 3418).

3484.	[bug]		Some statistics were incorrectly rendered in XML.
			[RT #32587]
parent 8d21efc1
3484. [bug] Some statistics were incorrectly rendered in XML.
[RT #32587]
3483. [placeholder]
3482. [func] dig +nssearch now prints name servers that don't
......
......@@ -366,7 +366,7 @@
</table>
<h2>Resolver Statistics (Common)</h2>
<table class="counters">
<xsl:for-each select="server/counters[@type=&quot;restat&quot;]/counter">
<xsl:for-each select="server/counters[@type=&quot;resstat&quot;]/counter">
<xsl:sort select="." data-type="number" order="descending"/>
<xsl:variable name="css-class4">
<xsl:choose>
......@@ -406,6 +406,55 @@
</xsl:for-each>
</table>
</xsl:for-each>
<xsl:for-each select="views/view">
<h3>ADB Statistics for View <xsl:value-of select="@name"/></h3>
<table class="counters">
<xsl:for-each select="counters[@type=&quot;adbstat&quot;]/counter[.&gt;0]">
<xsl:sort select="." data-type="number" order="descending"/>
<xsl:variable name="css-class5">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class5}">
<th>
<xsl:value-of select="@name"/>
</th>
<td>
<xsl:value-of select="."/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
<xsl:for-each select="views/view">
<h3>Cache Statistics for View <xsl:value-of select="@name"/></h3>
<table class="counters">
<xsl:for-each select="counters[@type=&quot;cachestats&quot;]/counter[.&gt;0]">
<xsl:sort select="." data-type="number" order="descending"/>
<xsl:variable name="css-class5">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class5}">
<th>
<xsl:value-of select="@name"/>
</th>
<td>
<xsl:value-of select="."/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
<h3>Cache DB RRsets for View <xsl:value-of select="@name"/></h3>
<xsl:for-each select="views/view">
<table class="counters">
......@@ -614,6 +663,12 @@
<xsl:value-of select="taskmgr/thread-model/tasks-running"/>
</td>
</tr>
<tr class="odd">
<th>Tasks Ready</th>
<td>
<xsl:value-of select="taskmgr/thread-model/tasks-ready"/>
</td>
</tr>
</table>
<br/>
<h2>Tasks</h2>
......@@ -624,6 +679,7 @@
<th>References</th>
<th>State</th>
<th>Quantum</th>
<th>Events</th>
</tr>
<xsl:for-each select="taskmgr/tasks/task">
<xsl:sort select="name"/>
......@@ -649,6 +705,9 @@
<td>
<xsl:value-of select="quantum"/>
</td>
<td>
<xsl:value-of select="events"/>
</td>
</tr>
</xsl:for-each>
</table>
......
......@@ -371,7 +371,7 @@ static char xslmsg[] =
" </table>\n"
" <h2>Resolver Statistics (Common)</h2>\n"
" <table class=\"counters\">\n"
" <xsl:for-each select=\"server/counters[@type=&quot;restat&quot;]/counter\">\n"
" <xsl:for-each select=\"server/counters[@type=&quot;resstat&quot;]/counter\">\n"
" <xsl:sort select=\".\" data-type=\"number\" order=\"descending\"/>\n"
" <xsl:variable name=\"css-class4\">\n"
" <xsl:choose>\n"
......@@ -411,6 +411,55 @@ static char xslmsg[] =
" </xsl:for-each>\n"
" </table>\n"
" </xsl:for-each>\n"
"\n"
"\n"
" <xsl:for-each select=\"views/view\">\n"
" <h3>ADB Statistics for View <xsl:value-of select=\"@name\"/></h3>\n"
" <table class=\"counters\">\n"
" <xsl:for-each select=\"counters[@type=&quot;adbstat&quot;]/counter[.&gt;0]\">\n"
" <xsl:sort select=\".\" data-type=\"number\" order=\"descending\"/>\n"
" <xsl:variable name=\"css-class5\">\n"
" <xsl:choose>\n"
" <xsl:when test=\"position() mod 2 = 0\">even</xsl:when>\n"
" <xsl:otherwise>odd</xsl:otherwise>\n"
" </xsl:choose>\n"
" </xsl:variable>\n"
" <tr class=\"{$css-class5}\">\n"
" <th>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </th>\n"
" <td>\n"
" <xsl:value-of select=\".\"/>\n"
" </td>\n"
" </tr>\n"
" </xsl:for-each>\n"
" </table>\n"
" </xsl:for-each>\n"
"\n"
" <xsl:for-each select=\"views/view\">\n"
" <h3>Cache Statistics for View <xsl:value-of select=\"@name\"/></h3>\n"
" <table class=\"counters\">\n"
" <xsl:for-each select=\"counters[@type=&quot;cachestats&quot;]/counter[.&gt;0]\">\n"
" <xsl:sort select=\".\" data-type=\"number\" order=\"descending\"/>\n"
" <xsl:variable name=\"css-class5\">\n"
" <xsl:choose>\n"
" <xsl:when test=\"position() mod 2 = 0\">even</xsl:when>\n"
" <xsl:otherwise>odd</xsl:otherwise>\n"
" </xsl:choose>\n"
" </xsl:variable>\n"
" <tr class=\"{$css-class5}\">\n"
" <th>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </th>\n"
" <td>\n"
" <xsl:value-of select=\".\"/>\n"
" </td>\n"
" </tr>\n"
" </xsl:for-each>\n"
" </table>\n"
" </xsl:for-each>\n"
"\n"
"\n"
" <h3>Cache DB RRsets for View <xsl:value-of select=\"@name\"/></h3>\n"
" <xsl:for-each select=\"views/view\">\n"
" <table class=\"counters\">\n"
......@@ -619,6 +668,12 @@ static char xslmsg[] =
" <xsl:value-of select=\"taskmgr/thread-model/tasks-running\"/>\n"
" </td>\n"
" </tr>\n"
" <tr class=\"odd\">\n"
" <th>Tasks Ready</th>\n"
" <td>\n"
" <xsl:value-of select=\"taskmgr/thread-model/tasks-ready\"/>\n"
" </td>\n"
" </tr>\n"
" </table>\n"
" <br/>\n"
" <h2>Tasks</h2>\n"
......@@ -629,6 +684,7 @@ static char xslmsg[] =
" <th>References</th>\n"
" <th>State</th>\n"
" <th>Quantum</th>\n"
" <th>Events</th>\n"
" </tr>\n"
" <xsl:for-each select=\"taskmgr/tasks/task\">\n"
" <xsl:sort select=\"name\"/>\n"
......@@ -654,6 +710,9 @@ static char xslmsg[] =
" <td>\n"
" <xsl:value-of select=\"quantum\"/>\n"
" </td>\n"
" <td>\n"
" <xsl:value-of select=\"events\"/>\n"
" </td>\n"
" </tr>\n"
" </xsl:for-each>\n"
" </table>\n"
......
......@@ -971,21 +971,28 @@ generatexml(ns_server_t *server, int *buflen, xmlChar **buf) {
TRY0(xmlTextWriterEndElement(writer)); /* cache */
}
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR
"cachestats"));
TRY0(dns_cache_renderxml(view->cache, writer));
TRY0(xmlTextWriterEndElement(writer)); /* cachestats */
if (view->adbstats != NULL) {
/* <adbstats> */
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "adbstat"));
if (view->resstats != NULL) {
result = dump_counters(view->adbstats,
isc_statsformat_xml, writer,
"adbstat", adbstats_xmldesc,
NULL, adbstats_xmldesc,
dns_adbstats_max,
adbstats_index, adbstat_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS)
goto error;
}
TRY0(xmlTextWriterEndElement(writer)); /* </adbstats> */
/* <cachestats> */
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "cachestats"));
TRY0(dns_cache_renderxml(view->cache, writer));
TRY0(xmlTextWriterEndElement(writer)); /* </cachestats> */
TRY0(xmlTextWriterEndElement(writer)); /* view */
......@@ -1074,7 +1081,6 @@ generatexml(ns_server_t *server, int *buflen, xmlChar **buf) {
resstat_values, 0);
if (result != ISC_R_SUCCESS)
goto error;
TRY0(xmlTextWriterEndElement(writer)); /* counters type=resstat */
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
......
......@@ -1400,15 +1400,14 @@ static int
renderstat(const char *name, isc_uint64_t value, xmlTextWriterPtr writer) {
int xmlrc;
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "cachestat"));
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"));
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR name));
TRY0(xmlTextWriterEndElement(writer)); /* name */
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "value"));
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
TRY0(xmlTextWriterWriteAttribute(writer,
ISC_XMLCHAR "name", ISC_XMLCHAR name));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" ISC_PRINT_QUADFORMAT "u", value));
TRY0(xmlTextWriterEndElement(writer)); /* value */
TRY0(xmlTextWriterEndElement(writer)); /* cachestat */
"%" ISC_PRINT_QUADFORMAT "u",
value));
TRY0(xmlTextWriterEndElement(writer)); /* counter */
error:
return (xmlrc);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment