Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions doc/admin-guide/monitoring/statistics/core/network-io.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,29 @@ Network I/O
:type: counter
:units: bytes

Application-layer bytes read from client and origin connections. For TLS
connections this is the decrypted payload, symmetric with ``write_bytes``; it
does not include TLS handshake or record-layer framing.
Comment thread
moonchen marked this conversation as resolved.

.. ts:stat:: global proxy.process.net.read_bytes_count integer
:type: counter

The number of read operations that contributed to ``read_bytes``. For TLS
connections this is one per decrypted-read pass, not per socket read.

.. ts:stat:: global proxy.process.net.write_bytes integer
:type: counter
:units: bytes

Application-layer bytes written to client and origin connections. For TLS
connections this is the plaintext payload; it does not include TLS handshake
or record-layer framing.

.. ts:stat:: global proxy.process.net.write_bytes_count integer
:type: counter

The number of write operations that contributed to ``write_bytes``.

.. ts:stat:: global proxy.process.tcp.total_accepts integer
:type: counter

Expand Down
5 changes: 3 additions & 2 deletions src/iocore/net/SSLNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ SSLNetVConnection::_ssl_read_from_net(int64_t &ret)
Dbg(dbg_ctl_ssl, "bytes_read=%" PRId64, bytes_read);

s->vio.ndone += bytes_read;
// Decrypted application bytes, to match write_bytes (also plaintext for TLS).
Metrics::Counter::increment(net_rsb.read_bytes, bytes_read);
Metrics::Counter::increment(net_rsb.read_bytes_count);
Comment thread
moonchen marked this conversation as resolved.
this->netActivity();

ret = bytes_read;
Expand Down Expand Up @@ -351,8 +354,6 @@ SSLNetVConnection::read_raw_data()
r = total_read - rattempted + r;
}
}
Metrics::Counter::increment(net_rsb.read_bytes, r);
Metrics::Counter::increment(net_rsb.read_bytes_count);

if (!this->haveCheckedProxyProtocol) {
// The PROXY Protocol, by spec, is designed to require only the first TCP packet of bytes
Expand Down