mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Move pulling of global state inside 'expensive' check for stats
This commit is contained in:
parent
8acc5ae15e
commit
77c05357b5
1 changed files with 2 additions and 4 deletions
|
@ -213,14 +213,12 @@ void ProfileLogger::Log() {
|
||||||
cs.num_events_outgoing, cs.num_logs_incoming, cs.num_logs_outgoing, cs.num_ids_incoming,
|
cs.num_events_outgoing, cs.num_logs_incoming, cs.num_logs_outgoing, cs.num_ids_incoming,
|
||||||
cs.num_ids_outgoing));
|
cs.num_ids_outgoing));
|
||||||
|
|
||||||
// Script-level state.
|
|
||||||
const auto& globals = global_scope()->Vars();
|
|
||||||
|
|
||||||
if ( expensive ) {
|
if ( expensive ) {
|
||||||
|
// Script-level state.
|
||||||
int total_table_entries = 0;
|
int total_table_entries = 0;
|
||||||
int total_table_rentries = 0;
|
int total_table_rentries = 0;
|
||||||
|
|
||||||
for ( const auto& global : globals ) {
|
for ( const auto& global : global_scope()->Vars() ) {
|
||||||
auto& id = global.second;
|
auto& id = global.second;
|
||||||
|
|
||||||
// We don't show/count internal globals as they are always
|
// We don't show/count internal globals as they are always
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue