src/dumpstats.c
static int stats_dump_li_stats(struct stream_interface *si, struct proxy *px, struct listener *l, int flags)
{
	if (si->applet.ctx.stats.flags & STAT_FMT_HTML) {
		chunk_appendf(&trash, "<tr class=socket>");
		if (px->cap & PR_CAP_BE && px->srv && (si->applet.ctx.stats.flags & STAT_ADMIN)) {
			/* Column sub-heading for Enable or Disable server */
			chunk_appendf(&trash, "<td></td>");
		}
		chunk_appendf(&trash,
		              /* frontend name, listener name */
		              "<td class=ac><a name=\"%s/+%s\"></a>%s"
		              "<a class=lfsb href=\"#%s/+%s\">%s</a>"
		              "",
		              px->id, l->name,
		              (flags & ST_SHLGNDS)?"<u>":"",
		              px->id, l->name, l->name);

		if (flags & ST_SHLGNDS) {
			char str[INET6_ADDRSTRLEN];
			int port;

			chunk_appendf(&trash, "<div class=tips>");

			port = get_host_port(&l->addr);
			switch (addr_to_str(&l->addr, str, sizeof(str))) {
			case AF_INET:
				chunk_appendf(&trash, "IPv4: %s:%d, ", str, port);
				break;
			case AF_INET6:
				chunk_appendf(&trash, "IPv6: [%s]:%d, ", str, port);
				break;
			case AF_UNIX:
				chunk_appendf(&trash, "unix, ");
				break;
			case -1:
				chunk_appendf(&trash, "(%s), ", strerror(errno));
				break;
			}

			/* id */
			chunk_appendf(&trash, "id: %d</div>", l->luid);
		}

		chunk_appendf(&trash,
			      /* queue */
		              "%s</td><td colspan=3></td>"
		              /* sessions rate: current, max, limit */
		              "<td colspan=3>&nbsp;</td>"
		              /* sessions: current, max, limit, total, lbtot */
		              "<td>%s</td><td>%s</td><td>%s</td>"
		              "<td>%s</td><td>&nbsp;</td>"
		              /* bytes: in, out */
		              "<td>%s</td><td>%s</td>"
		              "",
		              (flags & ST_SHLGNDS)?"</u>":"",
		              U2H(l->nbconn), U2H(l->counters->conn_max), U2H(l->maxconn),
		              U2H(l->counters->cum_conn), U2H(l->counters->bytes_in), U2H(l->counters->bytes_out));

		chunk_appendf(&trash,
		              /* denied: req, resp */
		              "<td>%s</td><td>%s</td>"
		              /* errors: request, connect, response */
		              "<td>%s</td><td></td><td></td>"
		              /* warnings: retries, redispatches */
		              "<td></td><td></td>"
		              /* server status: reflect listener status */
		              "<td class=ac>%s</td>"
		              /* rest of server: nothing */
		              "<td class=ac colspan=8></td></tr>"
		              "",
		              U2H(l->counters->denied_req), U2H(l->counters->denied_resp),
		              U2H(l->counters->failed_req),
		              (l->nbconn < l->maxconn) ? (l->state == LI_LIMITED) ? "WAITING" : "OPEN" : "FULL");
	}
	else { /* CSV mode */
		chunk_appendf(&trash,
		              /* pxid, name, queue cur, queue max, */
		              "%s,%s,,,"
		              /* sessions: current, max, limit, total */
		              "%d,%d,%d,%lld,"
		              /* bytes: in, out */
		              "%lld,%lld,"
		              /* denied: req, resp */
		              "%lld,%lld,"
		              /* errors: request, connect, response */
		              "%lld,,,"
		              /* warnings: retries, redispatches */
		              ",,"
		              /* server status: reflect listener status */
		              "%s,"
		              /* rest of server: nothing */
		              ",,,,,,,,"
		              /* pid, iid, sid, throttle, lbtot, tracked, type */
		              "%d,%d,%d,,,,%d,"
		              /* rate, rate_lim, rate_max */
		              ",,,"
		              /* check_status, check_code, check_duration */
		              ",,,"
		              /* http response: 1xx, 2xx, 3xx, 4xx, 5xx, other */
		              ",,,,,,"
		              /* failed health analyses */
		              ","
		              /* requests : req_rate, req_rate_max, req_tot, */
		              ",,,"
		              /* errors: cli_aborts, srv_aborts */
		              ",,"
		              /* compression: in, out, bypassed, comp_rsp */
		              ",,,,"
		              "\n",
		              px->id, l->name,
		              l->nbconn, l->counters->conn_max,
		              l->maxconn, l->counters->cum_conn,
		              l->counters->bytes_in, l->counters->bytes_out,
		              l->counters->denied_req, l->counters->denied_resp,
		              l->counters->failed_req,
		              (l->nbconn < l->maxconn) ? "OPEN" : "FULL",
		              relative_pid, px->uuid, l->luid, STATS_TYPE_SO);
	}
	return 1;
}
/* Dumps a line for listener <l> and proxy <px> to the trash and uses the state
 * from stream interface <si>, and stats flags <flags>. The caller is responsible
 * for clearing the trash if needed. Returns non-zero if it emits anything, zero
 * otherwise.
 */
Dumps a line for listener  and proxy  to the trash and uses the state
from stream interface , and stats flags . The caller is responsible
for clearing the trash if needed. Returns non-zero if it emits anything, zero
otherwise.
Dumps a line for listener and proxy to the trash and uses the state from stream interface and stats flags . The caller is responsible for clearing the trash if needed . Returns non - zero if it emits anything zero otherwise .
static int stats_dump_li_stats(struct stream_interface *si, struct proxy *px, struct listener *l, int flags)
{
	if (si->applet.ctx.stats.flags & STAT_FMT_HTML) {
		chunk_appendf(&trash, "<tr class=socket>");
		if (px->cap & PR_CAP_BE && px->srv && (si->applet.ctx.stats.flags & STAT_ADMIN)) {
			chunk_appendf(&trash, "<td></td>");
		}
		chunk_appendf(&trash,
		              "<td class=ac><a name=\"%s/+%s\"></a>%s"
		              "<a class=lfsb href=\"#%s/+%s\">%s</a>"
		              "",
		              px->id, l->name,
		              (flags & ST_SHLGNDS)?"<u>":"",
		              px->id, l->name, l->name);
		if (flags & ST_SHLGNDS) {
			char str[INET6_ADDRSTRLEN];
			int port;
			chunk_appendf(&trash, "<div class=tips>");
			port = get_host_port(&l->addr);
			switch (addr_to_str(&l->addr, str, sizeof(str))) {
			case AF_INET:
				chunk_appendf(&trash, "IPv4: %s:%d, ", str, port);
				break;
			case AF_INET6:
				chunk_appendf(&trash, "IPv6: [%s]:%d, ", str, port);
				break;
			case AF_UNIX:
				chunk_appendf(&trash, "unix, ");
				break;
			case -1:
				chunk_appendf(&trash, "(%s), ", strerror(errno));
				break;
			}
			chunk_appendf(&trash, "id: %d</div>", l->luid);
		}
		chunk_appendf(&trash,
		              "%s</td><td colspan=3></td>"
		              "<td colspan=3>&nbsp;</td>"
		              "<td>%s</td><td>%s</td><td>%s</td>"
		              "<td>%s</td><td>&nbsp;</td>"
		              "<td>%s</td><td>%s</td>"
		              "",
		              (flags & ST_SHLGNDS)?"</u>":"",
		              U2H(l->nbconn), U2H(l->counters->conn_max), U2H(l->maxconn),
		              U2H(l->counters->cum_conn), U2H(l->counters->bytes_in), U2H(l->counters->bytes_out));
		chunk_appendf(&trash,
		              "<td>%s</td><td>%s</td>"
		              "<td>%s</td><td></td><td></td>"
		              "<td></td><td></td>"
		              "<td class=ac>%s</td>"
		              "<td class=ac colspan=8></td></tr>"
		              "",
		              U2H(l->counters->denied_req), U2H(l->counters->denied_resp),
		              U2H(l->counters->failed_req),
		              (l->nbconn < l->maxconn) ? (l->state == LI_LIMITED) ? "WAITING" : "OPEN" : "FULL");
	}
	else { 
		chunk_appendf(&trash,
		              "%s,%s,,,"
		              "%d,%d,%d,%lld,"
		              "%lld,%lld,"
		              "%lld,%lld,"
		              "%lld,,,"
		              ",,"
		              "%s,"
		              ",,,,,,,,"
		              "%d,%d,%d,,,,%d,"
		              ",,,"
		              ",,,"
		              ",,,,,,"
		              ","
		              ",,,"
		              ",,"
		              ",,,,"
		              "\n",
		              px->id, l->name,
		              l->nbconn, l->counters->conn_max,
		              l->maxconn, l->counters->cum_conn,
		              l->counters->bytes_in, l->counters->bytes_out,
		              l->counters->denied_req, l->counters->denied_resp,
		              l->counters->failed_req,
		              (l->nbconn < l->maxconn) ? "OPEN" : "FULL",
		              relative_pid, px->uuid, l->luid, STATS_TYPE_SO);
	}
	return 1;
}
static int stats_dump_li_stats ( struct stream_interface * si , struct proxy * px , struct listener * l , int flags ) { if ( si -> applet . ctx . stats . flags & STAT_FMT_HTML ) { chunk_appendf ( & trash , " " ) ; if ( px -> cap & PR_CAP_BE && px -> srv && ( si -> applet . ctx . stats . flags & STAT_ADMIN ) ) { chunk_appendf ( & trash , " " ) ; } chunk_appendf ( & trash , " \" \" " " \" \" " " " , px -> id , l -> name , ( flags & ST_SHLGNDS ) ? " " : " " , px -> id , l -> name , l -> name ) ; if ( flags & ST_SHLGNDS ) { char str [ INET6_ADDRSTRLEN ] ; int port ; chunk_appendf ( & trash , " " ) ; port = get_host_port ( & l -> addr ) ; switch ( addr_to_str ( & l -> addr , str , sizeof ( str ) ) ) { case AF_INET : chunk_appendf ( & trash , " " , str , port ) ; break ; case AF_INET6 : chunk_appendf ( & trash , " " , str , port ) ; break ; case AF_UNIX : chunk_appendf ( & trash , " " ) ; break ; case -1 : chunk_appendf ( & trash , " " , strerror ( errno ) ) ; break ; } chunk_appendf ( & trash , " " , l -> luid ) ; } chunk_appendf ( & trash , " " " " " " " " " " " " , ( flags & ST_SHLGNDS ) ? " " : " " , U2H ( l -> nbconn ) , U2H ( l -> counters -> conn_max ) , U2H ( l -> maxconn ) , U2H ( l -> counters -> cum_conn ) , U2H ( l -> counters -> bytes_in ) , U2H ( l -> counters -> bytes_out ) ) ; chunk_appendf ( & trash , " " " " " " " " " " " " , U2H ( l -> counters -> denied_req ) , U2H ( l -> counters -> denied_resp ) , U2H ( l -> counters -> failed_req ) , ( l -> nbconn < l -> maxconn ) ? ( l -> state == LI_LIMITED ) ? " " : " " : " " ) ; } else { chunk_appendf ( & trash , " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " \n " , px -> id , l -> name , l -> nbconn , l -> counters -> conn_max , l -> maxconn , l -> counters -> cum_conn , l -> counters -> bytes_in , l -> counters -> bytes_out , l -> counters -> denied_req , l -> counters -> denied_resp , l -> counters -> failed_req , ( l -> nbconn < l -> maxconn ) ? " " : " " , relative_pid , px -> uuid , l -> luid , STATS_TYPE_SO ) ; } return 1 ; }
Dumps a line for listener <l> and proxy <px> to the trash and uses the state
 from stream interface <si>, and stats flags <flags>.
Dumps a line for listener <l > and proxy <px > to the trash and uses the state from stream interface <si > and stats flags <flags > .
/* Column sub-heading for Enable or Disable server */ /* frontend name, listener name */ /* id */ /* queue */ /* sessions rate: current, max, limit */ /* sessions: current, max, limit, total, lbtot */ /* bytes: in, out */ /* denied: req, resp */ /* errors: request, connect, response */ /* warnings: retries, redispatches */ /* server status: reflect listener status */ /* rest of server: nothing */ /* CSV mode */ /* pxid, name, queue cur, queue max, */ /* sessions: current, max, limit, total */ /* bytes: in, out */ /* denied: req, resp */ /* errors: request, connect, response */ /* warnings: retries, redispatches */ /* server status: reflect listener status */ /* rest of server: nothing */ /* pid, iid, sid, throttle, lbtot, tracked, type */ /* rate, rate_lim, rate_max */ /* check_status, check_code, check_duration */ /* http response: 1xx, 2xx, 3xx, 4xx, 5xx, other */ /* failed health analyses */ /* requests : req_rate, req_rate_max, req_tot, */ /* errors: cli_aborts, srv_aborts */ /* compression: in, out, bypassed, comp_rsp */