mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

While we support initializing records via coercion from an expression list, e.g., local x: X = [$x1=1, $x2=2]; this can sometimes obscure the code to readers, e.g., when assigning to value declared and typed elsewhere. The language runtime has a similar overhead since instead of just constructing a known type it needs to check at runtime that the coercion from the expression list is valid; this can be slower than just writing the readible code in the first place, see #4559. With this patch we use explicit construction, e.g., local x = X($x1=1, $x2=2);
29 lines
1.1 KiB
Text
29 lines
1.1 KiB
Text
# Notifications for Broker-reported backpressure overflow.
|
|
# See base/frameworks/broker/backpressure.zeek for context.
|
|
|
|
@load base/frameworks/telemetry
|
|
|
|
module Cluster;
|
|
|
|
global broker_backpressure_disconnects_cf = Telemetry::register_counter_family(Telemetry::MetricOpts(
|
|
$prefix="zeek",
|
|
$name="broker-backpressure-disconnects",
|
|
$unit="",
|
|
$label_names=vector("peer"),
|
|
$help_text="Number of Broker peerings dropped due to a neighbor falling behind in message I/O",
|
|
));
|
|
|
|
event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string)
|
|
{
|
|
if ( ! endpoint?$network || "caf::sec::backpressure_overflow" !in msg )
|
|
return;
|
|
|
|
local nn = nodeid_to_node(endpoint$id);
|
|
|
|
Cluster::log(fmt("removed due to backpressure overflow: %s%s:%s (%s)",
|
|
nn$name != "" ? "" : "non-cluster peer ",
|
|
endpoint$network$address, endpoint$network$bound_port,
|
|
nn$name != "" ? nn$name : endpoint$id));
|
|
Telemetry::counter_family_inc(broker_backpressure_disconnects_cf,
|
|
vector(nn$name != "" ? nn$name : "unknown"));
|
|
}
|