line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Starch::Plugin::Trace::Store; |
2
|
1
|
|
|
1
|
|
442
|
use 5.008001; |
|
1
|
|
|
|
|
4
|
|
3
|
1
|
|
|
1
|
|
7
|
use strictures 2; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
34
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
180
|
use Moo::Role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
329
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with qw( |
10
|
|
|
|
|
|
|
Starch::Plugin::ForStore |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
after BUILD => sub{ |
14
|
|
|
|
|
|
|
my ($self) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$self->log->tracef( |
17
|
|
|
|
|
|
|
'starch.store.%s.new', |
18
|
|
|
|
|
|
|
$self->short_store_class_name(), |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
return; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
around set => sub{ |
25
|
|
|
|
|
|
|
my $orig = shift; |
26
|
|
|
|
|
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
my ($id, $namespace) = @_; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $key = $self->stringify_key( $id, $namespace ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$self->log->tracef( |
32
|
|
|
|
|
|
|
'starch.store.%s.set.%s', |
33
|
|
|
|
|
|
|
$self->short_store_class_name(), $key, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
return $self->$orig( @_ ); |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
around get => sub{ |
40
|
|
|
|
|
|
|
my $orig = shift; |
41
|
|
|
|
|
|
|
my $self = shift; |
42
|
|
|
|
|
|
|
my ($id, $namespace) = @_; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $key = $self->stringify_key( $id, $namespace ); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
$self->log->tracef( |
47
|
|
|
|
|
|
|
'starch.store.%s.get.%s', |
48
|
|
|
|
|
|
|
$self->short_store_class_name(), $key, |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $data = $self->$orig( @_ ); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$self->log->tracef( |
54
|
|
|
|
|
|
|
'starch.store.%s.get.%s.missing', |
55
|
|
|
|
|
|
|
$self->short_store_class_name(), $key, |
56
|
|
|
|
|
|
|
) if !$data; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
return $data; |
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
around remove => sub{ |
62
|
|
|
|
|
|
|
my $orig = shift; |
63
|
|
|
|
|
|
|
my $self = shift; |
64
|
|
|
|
|
|
|
my ($id, $namespace) = @_; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my $key = $self->stringify_key( $id, $namespace ); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
$self->log->tracef( |
69
|
|
|
|
|
|
|
'starch.store.%s.remove.%s', |
70
|
|
|
|
|
|
|
$self->short_store_class_name(), $key, |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
return $self->$orig( @_ ); |
74
|
|
|
|
|
|
|
}; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |