mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Update the scripts.base.frameworks.telemetry.internal-metrics test
This now uses different record fields, and for now we no longer have CAF telemetry. We indicate we're running under test to get reliable ordering in the baselined output.
This commit is contained in:
parent
b387da3489
commit
77816f9a6b
2 changed files with 37 additions and 50 deletions
|
@ -1,40 +1,27 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
### broker |12|
|
||||
Telemetry::INT_GAUGE, broker, connections, [type], [native], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, connections, [type], [web-socket], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [data], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [command], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [routing-update], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [ping], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, broker, processed-messages, [type], [pong], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [data], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [command], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [routing-update], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [ping], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, broker, buffered-messages, [type], [pong], 0.0
|
||||
count_value, 0
|
||||
### caf |5|
|
||||
Telemetry::INT_COUNTER, caf.system, rejected-messages, [], [], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_COUNTER, caf.system, processed-messages, [], [], 7.0
|
||||
count_value, 7
|
||||
Telemetry::INT_GAUGE, caf.system, running-actors, [], [], 2.0
|
||||
count_value, 2
|
||||
Telemetry::INT_GAUGE, caf.system, queued-messages, [], [], 0.0
|
||||
count_value, 0
|
||||
Telemetry::INT_GAUGE, caf.actor, mailbox-size, [name], [broker.core], 0.0
|
||||
count_value, 0
|
||||
### caf |2|
|
||||
Telemetry::DOUBLE_HISTOGRAM, caf.actor, processing-time, [0.00001, 0.0001, 0.0005, 0.001, 0.01, 0.1, 0.5, 1.0, 5.0, inf], [name], [broker.core]
|
||||
Telemetry::DOUBLE_HISTOGRAM, caf.actor, mailbox-time, [0.00001, 0.0001, 0.0005, 0.001, 0.01, 0.1, 0.5, 1.0, 5.0, inf], [name], [broker.core]
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [command], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [command], 0.0
|
||||
value, 0.0
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [data], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [data], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_connections, [type], [native], 0.0
|
||||
value, 0.0
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [ping], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [ping], 0.0
|
||||
value, 0.0
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [pong], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [pong], 0.0
|
||||
value, 0.0
|
||||
Telemetry::COUNTER, broker, broker_processed_messages_total, [type], [routing-update], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_buffered_messages, [type], [routing-update], 0.0
|
||||
value, 0.0
|
||||
Telemetry::GAUGE, broker, broker_connections, [type], [web-socket], 0.0
|
||||
value, 0.0
|
||||
### broker |0|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# @TEST-DOC: Query some internal broker/caf related metrics as they use the int64_t versions, too.
|
||||
# @TEST-DOC: Query Broker's telemetry to verify it ends up in Zeek's registry.
|
||||
# Note compilable to C++ due to globals being initialized to a record that
|
||||
# has an opaque type as a field.
|
||||
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
|
||||
|
@ -8,17 +8,19 @@
|
|||
|
||||
@load base/frameworks/telemetry
|
||||
|
||||
redef running_under_test = T;
|
||||
|
||||
function print_histogram_metrics(what: string, metrics: vector of Telemetry::HistogramMetric)
|
||||
{
|
||||
print fmt("### %s |%s|", what, |metrics|);
|
||||
for (i in metrics)
|
||||
{
|
||||
local m = metrics[i];
|
||||
print m$opts$metric_type, m$opts$prefix, m$opts$name, m$opts$bounds, m$opts$labels, m$labels;
|
||||
print m$opts$metric_type, m$opts$prefix, m$opts$name, m$opts$bounds, m$label_names, m?$label_values ? m$label_values : vector();
|
||||
# Don't output actual values as they are runtime dependent.
|
||||
# print m$values, m$sum, m$observations;
|
||||
if ( m$opts?$count_bounds )
|
||||
print m$opts$count_bounds;
|
||||
if ( m$opts?$bounds )
|
||||
print m$opts$bounds;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,19 +30,17 @@ function print_metrics(what: string, metrics: vector of Telemetry::Metric)
|
|||
for (i in metrics)
|
||||
{
|
||||
local m = metrics[i];
|
||||
print m$opts$metric_type, m$opts$prefix, m$opts$name, m$opts$labels, m$labels, m$value;
|
||||
print m$opts$metric_type, m$opts$prefix, m$opts$name, m$label_names, m?$label_values ? m$label_values : vector(), m$value;
|
||||
|
||||
if (m?$count_value)
|
||||
print "count_value", m$count_value;
|
||||
if (m?$value)
|
||||
print "value", m$value;
|
||||
}
|
||||
}
|
||||
|
||||
event zeek_done() &priority=-100
|
||||
{
|
||||
local broker_metrics = Telemetry::collect_metrics("broker", "*");
|
||||
local broker_metrics = Telemetry::collect_metrics("broker*", "*");
|
||||
print_metrics("broker", broker_metrics);
|
||||
local caf_metrics = Telemetry::collect_metrics("caf*", "*");
|
||||
print_metrics("caf", caf_metrics);
|
||||
local caf_histogram_metrics = Telemetry::collect_histogram_metrics("caf*", "*");
|
||||
print_histogram_metrics("caf", caf_histogram_metrics);
|
||||
local broker_histogram_metrics = Telemetry::collect_histogram_metrics("broker*", "*");
|
||||
print_histogram_metrics("broker", broker_histogram_metrics);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue