File | /data/SimpleDB-Class/author.t/02.Cache.t |
Statements Executed | 34 |
Statement Execution Time | 1.19ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 10.6ms | 105ms | BEGIN@3 | main::
1 | 1 | 1 | 3.27ms | 17.1ms | BEGIN@1 | main::
1 | 1 | 1 | 515µs | 669µs | BEGIN@4 | main::
0 | 0 | 0 | 0s | 0s | RUNTIME | main::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 3 | 233µs | 2 | 18.7ms | # spent 17.1ms (3.27+13.8) within main::BEGIN@1 which was called
# once (3.27ms+13.8ms) by main::RUNTIME at line 1 # spent 17.1ms making 1 call to main::BEGIN@1
# spent 1.65ms making 1 call to Test::Builder::Module::import |
2 | 3 | 120µs | 1 | 2.83ms | use Tie::IxHash; # spent 2.83ms making 1 call to main::BEGIN@2 |
3 | 3 | 104µs | 1 | 105ms | # spent 105ms (10.6+94.2) within main::BEGIN@3 which was called
# once (10.6ms+94.2ms) by main::RUNTIME at line 3 # spent 105ms making 1 call to main::BEGIN@3 |
4 | 3 | 428µs | 2 | 773µs | # spent 669µs (515+155) within main::BEGIN@4 which was called
# once (515µs+155µs) by main::RUNTIME at line 4 # spent 669µs making 1 call to main::BEGIN@4
# spent 104µs making 1 call to lib::import |
5 | |||||
6 | 1 | 2µs | my $a = {foo=>'A'}; | ||
7 | 1 | 700ns | my $b = {foo=>'B'}; | ||
8 | |||||
9 | 1 | 3µs | 1 | 243ms | use_ok('SimpleDB::Class::Cache'); # spent 243ms making 1 call to Test::More::use_ok |
10 | 1 | 7µs | 1 | 17µs | my $cache = SimpleDB::Class::Cache->new(servers=>[{host=>'127.0.0.1',port=>11211}]); # spent 17µs making 1 call to SimpleDB::Class::Cache::new |
11 | 1 | 4µs | 1 | 275µs | isa_ok($cache, 'SimpleDB::Class::Cache'); # spent 275µs making 1 call to Test::More::isa_ok |
12 | 1 | 4µs | 1 | 905µs | $cache->set('foo',"a",$a); # spent 905µs making 1 call to SimpleDB::Class::Cache::set |
13 | 1 | 10µs | 2 | 871µs | is($cache->get('foo',"a")->{foo}, "A", "set/get"); # spent 637µs making 1 call to Test::More::is
# spent 234µs making 1 call to SimpleDB::Class::Cache::get |
14 | 1 | 4µs | 1 | 190µs | $cache->set('foo',"b", $b); # spent 190µs making 1 call to SimpleDB::Class::Cache::set |
15 | 1 | 11µs | 1 | 328µs | my ($a1, $b1) = @{$cache->mget([['foo',"a"],['foo',"b"]])}; # spent 328µs making 1 call to SimpleDB::Class::Cache::mget |
16 | 1 | 3µs | 1 | 390µs | is($a1->{foo}, "A", "mget first value"); # spent 390µs making 1 call to Test::More::is |
17 | 1 | 4µs | 1 | 365µs | is($b1->{foo}, "B", "mget second value"); # spent 365µs making 1 call to Test::More::is |
18 | 1 | 6µs | 1 | 176µs | $cache->delete('foo',"a"); # spent 176µs making 1 call to SimpleDB::Class::Cache::delete |
19 | 2 | 4µs | 3 | 647µs | is(eval{$cache->get('foo',"a")}, undef, 'delete'); # spent 460µs making 1 call to Test::More::is
# spent 185µs making 1 call to SimpleDB::Class::Cache::get
# spent 2µs making 1 call to JSON::XS::DESTROY |
20 | 1 | 4µs | 1 | 111µs | $cache->flush; # spent 111µs making 1 call to SimpleDB::Class::Cache::flush |
21 | 2 | 4µs | 3 | 618µs | is(eval{$cache->get('foo',"b")}, undef, 'flush'); # spent 450µs making 1 call to Test::More::is
# spent 167µs making 1 call to SimpleDB::Class::Cache::get
# spent 1µs making 1 call to JSON::XS::DESTROY |
22 | |||||
23 | #my $foo = {a=>'b', date=>DateTime->new(year=>2000, month=>5, day=>5, hour=>5, minute=>5, second=>5)}; | ||||
24 | 1 | 9µs | my $foo = {a=>'b', date=>{year=>2000, month=>5, day=>5, hour=>5, minute=>5, second=>5}}; | ||
25 | 1 | 3µs | 1 | 1.12ms | $cache->set('foo','foo',$foo); # spent 1.12ms making 1 call to SimpleDB::Class::Cache::set |
26 | 1 | 4µs | 1 | 233µs | my $foo1 = $cache->get('foo','foo'); # spent 233µs making 1 call to SimpleDB::Class::Cache::get |
27 | #cmp_ok($foo->{date}, '==', $foo1->{date}, 'dates in are dates out'); | ||||
28 | 1 | 6µs | 1 | 355µs | cmp_ok($foo->{date}{month}, '==', $foo1->{date}{month}, 'dates in are dates out'); # spent 355µs making 1 call to Test::More::cmp_ok |
29 | 1 | 208µs | 2 | 546µs | is($foo1->{date}->year, 2000, 'year'); # spent 386µs making 1 call to Test::Builder::END
# spent 160µs making 1 call to Memcached::libmemcached::DESTROY |
30 | is($foo1->{date}->month, 5, 'month'); | ||||
31 | is($foo1->{date}->day, 5, 'day'); | ||||
32 | is($foo1->{date}->hour, 5, 'hour'); | ||||
33 | is($foo1->{date}->minute, 5, 'minute'); | ||||
34 | is($foo1->{date}->second, 5, 'second'); |