Merge remote-tracking branch 'origin/topic/seth/metrics-merge' into topic/bernhard/hyperloglog-with-measurement

This commit is contained in:
Bernhard Amann 2013-04-08 10:56:18 +02:00
commit 07d44f3aa0
37 changed files with 262 additions and 354 deletions

View file

@ -7,29 +7,27 @@
event bro_init()
{
local q = Queue::init([$max_len=2]);
Queue::push(q, 1);
Queue::push(q, 2);
Queue::push(q, 3);
Queue::push(q, 4);
local test1 = Queue::get_cnt_vector(q);
Queue::put(q, 1);
Queue::put(q, 2);
Queue::put(q, 3);
Queue::put(q, 4);
local test1: vector of count = vector();
Queue::get_vector(q, test1);
for ( i in test1 )
print fmt("This is a get_cnt_vector test: %d", test1[i]);
print fmt("This is a get_vector test: %d", test1[i]);
local test2 = Queue::get_str_vector(q);
for ( i in test2 )
print fmt("This is a get_str_vector test: %s", test2[i]);
local test_val = Queue::pop(q);
print fmt("Testing pop: %s", test_val);
print fmt("Length after pop: %d", Queue::len(q));
local test_val = Queue::get(q);
print fmt("Testing get: %s", test_val);
print fmt("Length after get: %d", Queue::len(q));
local q2 = Queue::init([]);
Queue::push(q2, "test 1");
Queue::push(q2, "test 2");
Queue::push(q2, "test 2");
Queue::push(q2, "test 1");
Queue::put(q2, "test 1");
Queue::put(q2, "test 2");
Queue::put(q2, "test 2");
Queue::put(q2, "test 1");
print fmt("Size of q2: %d", Queue::len(q2));
local test3: vector of string = Queue::get_str_vector(q2);
local test3: vector of string = vector();
Queue::get_vector(q2, test3);
for ( i in test3 )
print fmt("String queue value: %s", test3[i]);
}