mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Add timestamp to events.
This commit is contained in:
parent
4d97316a6d
commit
fa84d2896a
6 changed files with 113 additions and 7 deletions
51
testing/btest/Baseline/language.event-ts/out
Normal file
51
testing/btest/Baseline/language.event-ts/out
Normal file
|
@ -0,0 +1,51 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
>> Run 0 (1989-12-12-22:00:00):
|
||||
[1989-12-12-22:00:00] Test 4 was scheduled at 1989-12-12-22:00:00
|
||||
[1989-12-12-22:00:00] Test 3 was scheduled at 1989-12-12-22:00:00
|
||||
[1989-12-12-22:00:00] Test 2 was scheduled at 1989-12-12-22:00:00
|
||||
[1989-12-12-22:00:01] Test 1 was scheduled at 1989-12-12-22:00:00
|
||||
>> Run 1 (1989-12-12-22:00:01):
|
||||
[1989-12-12-22:00:01] Test 4 was scheduled at 1989-12-12-22:00:01
|
||||
[1989-12-12-22:00:01] Test 3 was scheduled at 1989-12-12-22:00:01
|
||||
[1989-12-12-22:00:01] Test 2 was scheduled at 1989-12-12-22:00:01
|
||||
[1989-12-12-22:00:02] Test 1 was scheduled at 1989-12-12-22:00:01
|
||||
>> Run 2 (1989-12-12-22:00:02):
|
||||
[1989-12-12-22:00:02] Test 4 was scheduled at 1989-12-12-22:00:02
|
||||
[1989-12-12-22:00:02] Test 3 was scheduled at 1989-12-12-22:00:02
|
||||
[1989-12-12-22:00:02] Test 2 was scheduled at 1989-12-12-22:00:02
|
||||
[1989-12-12-22:00:03] Test 1 was scheduled at 1989-12-12-22:00:02
|
||||
>> Run 3 (1989-12-12-22:00:03):
|
||||
[1989-12-12-22:00:03] Test 4 was scheduled at 1989-12-12-22:00:03
|
||||
[1989-12-12-22:00:03] Test 3 was scheduled at 1989-12-12-22:00:03
|
||||
[1989-12-12-22:00:03] Test 2 was scheduled at 1989-12-12-22:00:03
|
||||
[1989-12-12-22:00:04] Test 1 was scheduled at 1989-12-12-22:00:03
|
||||
>> Run 4 (1989-12-12-22:00:04):
|
||||
[1989-12-12-22:00:04] Test 4 was scheduled at 1989-12-12-22:00:04
|
||||
[1989-12-12-22:00:04] Test 3 was scheduled at 1989-12-12-22:00:04
|
||||
[1989-12-12-22:00:04] Test 2 was scheduled at 1989-12-12-22:00:04
|
||||
[1989-12-12-22:00:05] Test 1 was scheduled at 1989-12-12-22:00:04
|
||||
>> Run 5 (1989-12-12-22:00:05):
|
||||
[1989-12-12-22:00:05] Test 4 was scheduled at 1989-12-12-22:00:05
|
||||
[1989-12-12-22:00:05] Test 3 was scheduled at 1989-12-12-22:00:05
|
||||
[1989-12-12-22:00:05] Test 2 was scheduled at 1989-12-12-22:00:05
|
||||
[1989-12-12-22:00:06] Test 1 was scheduled at 1989-12-12-22:00:05
|
||||
>> Run 6 (1989-12-12-22:00:06):
|
||||
[1989-12-12-22:00:06] Test 4 was scheduled at 1989-12-12-22:00:06
|
||||
[1989-12-12-22:00:06] Test 3 was scheduled at 1989-12-12-22:00:06
|
||||
[1989-12-12-22:00:06] Test 2 was scheduled at 1989-12-12-22:00:06
|
||||
[1989-12-12-22:00:07] Test 1 was scheduled at 1989-12-12-22:00:06
|
||||
>> Run 7 (1989-12-12-22:00:07):
|
||||
[1989-12-12-22:00:07] Test 4 was scheduled at 1989-12-12-22:00:07
|
||||
[1989-12-12-22:00:07] Test 3 was scheduled at 1989-12-12-22:00:07
|
||||
[1989-12-12-22:00:07] Test 2 was scheduled at 1989-12-12-22:00:07
|
||||
[1989-12-12-22:00:08] Test 1 was scheduled at 1989-12-12-22:00:07
|
||||
>> Run 8 (1989-12-12-22:00:08):
|
||||
[1989-12-12-22:00:08] Test 4 was scheduled at 1989-12-12-22:00:08
|
||||
[1989-12-12-22:00:08] Test 3 was scheduled at 1989-12-12-22:00:08
|
||||
[1989-12-12-22:00:08] Test 2 was scheduled at 1989-12-12-22:00:08
|
||||
[1989-12-12-22:00:09] Test 1 was scheduled at 1989-12-12-22:00:08
|
||||
>> Run 9 (1989-12-12-22:00:09):
|
||||
[1989-12-12-22:00:09] Test 4 was scheduled at 1989-12-12-22:00:09
|
||||
[1989-12-12-22:00:09] Test 3 was scheduled at 1989-12-12-22:00:09
|
||||
[1989-12-12-22:00:09] Test 2 was scheduled at 1989-12-12-22:00:09
|
||||
[1989-12-12-22:00:09] Test 1 was scheduled at 1989-12-12-22:00:09
|
BIN
testing/btest/Traces/ticks-dns.pcap
Normal file
BIN
testing/btest/Traces/ticks-dns.pcap
Normal file
Binary file not shown.
28
testing/btest/language/event-ts.zeek
Normal file
28
testing/btest/language/event-ts.zeek
Normal file
|
@ -0,0 +1,28 @@
|
|||
# @TEST-EXEC: zeek -b -r $TRACES/ticks-dns.pcap %INPUT > out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
# Note: We use a PCAP with DNS queries only so that we have a single packet per
|
||||
# time step. Thus the run loop will be executed only once per time step.
|
||||
|
||||
global runs = -1;
|
||||
|
||||
event test(depth: count)
|
||||
{
|
||||
if ( depth == 0 )
|
||||
return;
|
||||
|
||||
print fmt("[%D] Test %s was scheduled at %D", network_time(), depth, current_event_time());
|
||||
event test(--depth);
|
||||
}
|
||||
|
||||
event new_connection(c: connection)
|
||||
{
|
||||
print fmt(">> Run %s (%D):", ++runs, network_time());
|
||||
# Descend into recursion to enqueue events until we add an event that will
|
||||
# be handled in the next run loop iteration, i.e. at a different timestamp
|
||||
# than it was enqueued. Use four levels of recursion as every drain of the
|
||||
# event queue handles two layers and the event queue is drained two times.
|
||||
# First after processing a packet and second in the run loop. Finally, we
|
||||
# expect an event so that network_time() > current_event_time().
|
||||
event test(4);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue