mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
PktSrc/RunState: Scale on first_wallclock and move pseudo realtime logic to RunState
check_pseudo_time() used zeek_start_time which skews things sufficiently around being in the past when ZAM compilation takes multiple seconds. Switch to using first_wallclock instead. Further, move setting of first_timestamp and first_wallclock from PktSrc into RunState's dispatch_packet(), so it's more centralized now. The only pseudo_realtime piece left in PktSrc() is in GetNextTimeout() to determine how long the PktSrc is idle until the next packet is ready.
This commit is contained in:
parent
54d28a2179
commit
d9a7f9f36f
3 changed files with 24 additions and 14 deletions
|
@ -136,9 +136,6 @@ bool PktSrc::ExtractNextPacketInternal() {
|
|||
if ( run_state::is_processing_suspended() && run_state::detail::first_timestamp )
|
||||
return false;
|
||||
|
||||
if ( run_state::pseudo_realtime )
|
||||
run_state::detail::current_wallclock = util::current_time(true);
|
||||
|
||||
if ( ExtractNextPacket(¤t_packet) ) {
|
||||
had_packet = true;
|
||||
|
||||
|
@ -147,9 +144,6 @@ bool PktSrc::ExtractNextPacketInternal() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( ! run_state::detail::first_timestamp )
|
||||
run_state::detail::first_timestamp = current_packet.time;
|
||||
|
||||
have_packet = true;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue