29#include <flow/util/stat/histo.hpp>
30#include <flow/util/stat/stat_set.hpp>
236 static inline const std::vector<flow::util::stat::Histogram_counter::value_t>
238 {0, 10, 20, 50, 100, 200, 500, 1'000, 2'000, 5'000, 10'000, 20'000, 50'000,
239 100'000, 200'000, 500'000, 1'000'000, 2'000'000, 5'000'000, 10'000'000};
410template<
typename Visitor>
416 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_internal_msgs, ACCUMULATOR);
417 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_user_msgs, ACCUMULATOR);
418 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_notifications, ACCUMULATOR);
419 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_notification_responses, ACCUMULATOR);
420 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_requests, ACCUMULATOR);
421 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_requests_one_off, ACCUMULATOR);
422 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_request_responses, ACCUMULATOR);
423 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_single_segment_msgs, ACCUMULATOR);
424 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_multi_segment_msgs, ACCUMULATOR);
425 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_total_segments, ACCUMULATOR);
426 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_msgs_with_split_segments, ACCUMULATOR);
427 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_total_low_lvl_blobs, ACCUMULATOR);
428 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_handle_bearing_msgs, ACCUMULATOR);
429 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_histo_split_blobs_per_seg, ACCUMULATOR);
430 FLOW_UTIL_STAT_DECLARE(m_snd.m_msg.m_histo_msg_sz, ACCUMULATOR);
433 FLOW_UTIL_STAT_DECLARE(m_snd.m_internal_msgs_unserializable, ACCUMULATOR);
436 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_internal_msgs, ACCUMULATOR);
437 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_user_msgs, ACCUMULATOR);
438 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_notifications, ACCUMULATOR);
439 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_notification_responses, ACCUMULATOR);
440 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_requests, ACCUMULATOR);
441 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_requests_one_off, ACCUMULATOR);
442 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_request_responses, ACCUMULATOR);
443 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_single_segment_msgs, ACCUMULATOR);
444 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_multi_segment_msgs, ACCUMULATOR);
445 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_total_segments, ACCUMULATOR);
446 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_msgs_with_split_segments, ACCUMULATOR);
447 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_total_low_lvl_blobs, ACCUMULATOR);
448 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_handle_bearing_msgs, ACCUMULATOR);
449 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_histo_split_blobs_per_seg, ACCUMULATOR);
450 FLOW_UTIL_STAT_DECLARE(m_rcv.m_msg.m_histo_msg_sz, ACCUMULATOR);
453 FLOW_UTIL_STAT_DECLARE(m_rcv.m_unexpected_responses, ACCUMULATOR);
454 FLOW_UTIL_STAT_DECLARE(m_rcv.m_reassembly_q_insertions, ACCUMULATOR);
455 FLOW_UTIL_STAT_DECLARE(m_rcv.m_reassembly_q_depth, GAUGE);
456 FLOW_UTIL_STAT_DECLARE_HI_WMARK(m_rcv.m_reassembly_q_hi_wmark, m_rcv.m_reassembly_q_depth);
457 FLOW_UTIL_STAT_DECLARE(m_rcv.m_unsolicited_msgs_routed, ACCUMULATOR);
458 FLOW_UTIL_STAT_DECLARE(m_rcv.m_unsolicited_msgs_cached, ACCUMULATOR);
459 FLOW_UTIL_STAT_DECLARE(m_rcv.m_pending_msgs_depth, GAUGE);
460 FLOW_UTIL_STAT_DECLARE_HI_WMARK(m_rcv.m_pending_msgs_hi_wmark, m_rcv.m_pending_msgs_depth);
461 FLOW_UTIL_STAT_DECLARE(m_rcv.m_expect_msg_count, ACCUMULATOR);
462 FLOW_UTIL_STAT_DECLARE(m_rcv.m_expect_msg_active, GAUGE);
463 FLOW_UTIL_STAT_DECLARE(m_rcv.m_expect_msgs_count, ACCUMULATOR);
464 FLOW_UTIL_STAT_DECLARE(m_rcv.m_expect_msgs_active, GAUGE);
465 FLOW_UTIL_STAT_DECLARE(m_rcv.m_expect_q_immediate_pops, ACCUMULATOR);
466 FLOW_UTIL_STAT_DECLARE(m_rcv.m_expect_response_one_off_active, GAUGE);
467 FLOW_UTIL_STAT_DECLARE(m_rcv.m_expect_response_sticky_active, GAUGE);
468 FLOW_UTIL_STAT_DECLARE(m_rcv.m_liveness_checks, ACCUMULATOR);
469 FLOW_UTIL_STAT_DECLARE(m_rcv.m_histo_one_off_request_rtt_usec, ACCUMULATOR);
Stats-related sub-namespace, for ADL segregation and general organization.
void declare_stats(const flow::util::stat::Stat_name &name_prefix, const Channel_stats *src_stats, Channel_stats *target_stats, Visitor &&visitor)
Declares the stats for Channel_stats.
static constexpr size_t BUILDER_CONFIG_FRAME_PREFIX_SZ_VIA_STRUC_CHANNEL
struc::Channel (and struc::sync_io::Channel) requires, for internal purposes, that any Msg_out transm...
Per-message stats shared between send and receive directions.
uint64_t m_handle_bearing_msgs
Sub-count of m_user_msgs: user messages such that each included a native handle.
uint64_t m_total_segments
Sum of pre-split/post-reassembly segment counts across all messages.
uint64_t m_msgs_with_split_segments
Messages for which at least 1 segment had to be split across 2+ low-level blobs.
uint64_t m_multi_segment_msgs
Messages whose serializations each comprised 2+ segments.
uint64_t m_requests
Sub-count of m_user_msgs: user requests (Channel::async_request(), Channel::send() no).
static constexpr size_t S_HISTO_SPLIT_BLOBS_N_BUCKETS
Number of histogram buckets for m_histo_split_blobs_per_seg. Covers 2, 3, 4, 5+ blobs per split segme...
uint64_t m_notification_responses
Sub-count of m_notifications: notification that is itself a response (when sending: originating_msg_o...
uint64_t m_total_low_lvl_blobs
Total low-level blobs (each segment of m_total_segments maps to 1 blob unless split; in which case to...
static constexpr size_t S_HISTO_MSG_SZ_BUCKET_SZ
Regular bucket width for m_histo_msg_sz (bytes).
flow::util::stat::Histogram_counter m_histo_msg_sz
Total serialization bytes per message (all segments summed, metadata-bearing header included).
static constexpr size_t S_HISTO_MSG_SZ_BUCKET0_SZ
Bucket-0 width for m_histo_msg_sz: matches the internal mdt header frame-prefix size.
uint64_t m_requests_one_off
Sub-count of m_requests: user requests each made with one-off response expectation (auto-cancel on fi...
uint64_t m_single_segment_msgs
Messages whose serializations each comprised exactly 1 segment (typical case; if SHM-backed then univ...
uint64_t m_notifications
Sub-count of m_user_msgs: user notifications (Channel::send() yes, Channel::async_request() no).
uint64_t m_internal_msgs
Internal (out-of-band) messages.
flow::util::stat::Histogram_counter m_histo_split_blobs_per_seg
Per-segment histogram: when a segment needed pre-send splitting/post-receive reassembly,...
uint64_t m_request_responses
Sub-count of m_requests: requests each of which is also a response (ping-pong pattern).
static constexpr size_t S_HISTO_MSG_SZ_N_BUCKETS
Number of histogram buckets for m_histo_msg_sz.
uint64_t m_user_msgs
All user structured messages.
static const size_t S_HISTO_RTT_N_BUCKETS
Number of histogram buckets for m_histo_one_off_request_rtt_usec (default config).
size_t m_expect_msg_active
Current count (gauge) of active one-shot (Channel::expect_msg() or equivalent) expectations.
uint64_t m_unexpected_responses
Sub-count of m_msg.m_notification_responses: response arrived but no matching expectation registered ...
static constexpr flow::util::stat::Histogram_counter::value_t S_HISTO_RTT_BUCKET_N_SZ_USEC
Last-bucket width for m_histo_one_off_request_rtt_usec (default config); values past it land in that ...
static const std::vector< flow::util::stat::Histogram_counter::value_t > S_HISTO_RTT_BUCKET_VAL0S_USEC
Bucket min-values for m_histo_one_off_request_rtt_usec (default config): a log-scale-ish 1-2-5 ladder...
uint64_t m_expect_msgs_count
Cf m_expect_msg_count: tracks sticky (Channel::expect_msgs() or equivalent: not one-off) registration...
uint64_t m_reassembly_q_insertions
Number of times and out-of-order arrival enqueued into the reassembly queue (possible only if Channel...
flow::util::stat::Histogram_counter m_histo_one_off_request_rtt_usec
One-off async_request() round-trip time histogram (real time passed from said call to response receip...
size_t m_reassembly_q_hi_wmark
Max of m_reassembly_q_depth observed so far.
uint64_t m_expect_q_immediate_pops
Times already-queued messages were popped on expect_*() registration (once per pop event,...
Msg m_msg
Various stats for the receive direction, generally mirroring the opposing peer's Snd::m_msg.
size_t m_reassembly_q_depth
Reassembly queue depth; typically zero. See m_reassembly_q_insertions for some background.
uint64_t m_unsolicited_msgs_cached
Non-response (unsolicited) user messages cached (no handler registered yet at receipt).
uint64_t m_expect_msg_count
Total valid one-shot (Channel::expect_msg() or equivalent) registrations so far.
size_t m_expect_response_one_off_active
Current count (gauge) of active one-off response expectations (one-off pending requests).
size_t m_pending_msgs_hi_wmark
Max of m_pending_msgs_depth observed so far.
size_t m_pending_msgs_depth
Current count (gauge) of non-response (unsolicited) user messages received but not yet expect_*()-reg...
size_t m_expect_msgs_active
Cf m_expect_msg_active: tracks sticky (Channel::expect_msgs() or equivalent: not one-off) registratio...
uint64_t m_liveness_checks
Total valid Channel::remote_peer_process_liveness_check() invocations.
uint64_t m_unsolicited_msgs_routed
Non-response (unsolicited) user in-messages delivered to a handler immediately (at receipt handler wa...
size_t m_expect_response_sticky_active
Current count (gauge) of active sticky response expectations (indefinitely pending requests).
uint64_t m_internal_msgs_unserializable
Internal (out-of-band) messages that could not be sent, because they would not fit the fixed-size buf...
Msg m_msg
Message-level stats for the send direction.
Cumulative stats from a struc::sync_io::Channel, covering both send and receive directions as well as...
Snd m_snd
Send-direction stats.
Rcv m_rcv
Receive-direction stats.