Filename | /usr/local/lib/perl5/site_perl/Mail/SpamAssassin/Locker.pm |
Statements | Executed 39 statements in 8.80s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
8 | 2 | 1 | 387µs | 8.80s | jittery_one_second_sleep | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 49µs | 63µs | BEGIN@20 | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 39µs | 131µs | BEGIN@23 | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 31µs | 2.43ms | BEGIN@24 | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 26µs | 31µs | BEGIN@22 | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 26µs | 100µs | BEGIN@29 | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 23µs | 23µs | new | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 21µs | 44µs | BEGIN@21 | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 15µs | 15µs | BEGIN@25 | Mail::SpamAssassin::Locker::
1 | 1 | 1 | 12µs | 12µs | BEGIN@27 | Mail::SpamAssassin::Locker::
0 | 0 | 0 | 0s | 0s | refresh_lock | Mail::SpamAssassin::Locker::
0 | 0 | 0 | 0s | 0s | safe_lock | Mail::SpamAssassin::Locker::
0 | 0 | 0 | 0s | 0s | safe_unlock | Mail::SpamAssassin::Locker::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # <@LICENSE> | ||||
2 | # Licensed to the Apache Software Foundation (ASF) under one or more | ||||
3 | # contributor license agreements. See the NOTICE file distributed with | ||||
4 | # this work for additional information regarding copyright ownership. | ||||
5 | # The ASF licenses this file to you under the Apache License, Version 2.0 | ||||
6 | # (the "License"); you may not use this file except in compliance with | ||||
7 | # the License. You may obtain a copy of the License at: | ||||
8 | # | ||||
9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||||
10 | # | ||||
11 | # Unless required by applicable law or agreed to in writing, software | ||||
12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||||
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
14 | # See the License for the specific language governing permissions and | ||||
15 | # limitations under the License. | ||||
16 | # </@LICENSE> | ||||
17 | |||||
18 | package Mail::SpamAssassin::Locker; | ||||
19 | |||||
20 | 2 | 64µs | 2 | 76µs | # spent 63µs (49+13) within Mail::SpamAssassin::Locker::BEGIN@20 which was called:
# once (49µs+13µs) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 at line 20 # spent 63µs making 1 call to Mail::SpamAssassin::Locker::BEGIN@20
# spent 13µs making 1 call to strict::import |
21 | 2 | 68µs | 2 | 68µs | # spent 44µs (21+23) within Mail::SpamAssassin::Locker::BEGIN@21 which was called:
# once (21µs+23µs) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 at line 21 # spent 44µs making 1 call to Mail::SpamAssassin::Locker::BEGIN@21
# spent 23µs making 1 call to warnings::import |
22 | 2 | 70µs | 2 | 36µs | # spent 31µs (26+5) within Mail::SpamAssassin::Locker::BEGIN@22 which was called:
# once (26µs+5µs) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 at line 22 # spent 31µs making 1 call to Mail::SpamAssassin::Locker::BEGIN@22
# spent 5µs making 1 call to bytes::import |
23 | 2 | 59µs | 2 | 223µs | # spent 131µs (39+92) within Mail::SpamAssassin::Locker::BEGIN@23 which was called:
# once (39µs+92µs) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 at line 23 # spent 131µs making 1 call to Mail::SpamAssassin::Locker::BEGIN@23
# spent 92µs making 1 call to re::import |
24 | 2 | 71µs | 2 | 4.83ms | # spent 2.43ms (31µs+2.40) within Mail::SpamAssassin::Locker::BEGIN@24 which was called:
# once (31µs+2.40ms) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 at line 24 # spent 2.43ms making 1 call to Mail::SpamAssassin::Locker::BEGIN@24
# spent 2.40ms making 1 call to Exporter::import |
25 | 2 | 53µs | 1 | 15µs | # spent 15µs within Mail::SpamAssassin::Locker::BEGIN@25 which was called:
# once (15µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 at line 25 # spent 15µs making 1 call to Mail::SpamAssassin::Locker::BEGIN@25 |
26 | |||||
27 | 2 | 84µs | 1 | 12µs | # spent 12µs within Mail::SpamAssassin::Locker::BEGIN@27 which was called:
# once (12µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 at line 27 # spent 12µs making 1 call to Mail::SpamAssassin::Locker::BEGIN@27 |
28 | |||||
29 | 1 | 2µs | # spent 100µs (26+74) within Mail::SpamAssassin::Locker::BEGIN@29 which was called:
# once (26µs+74µs) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 at line 31 | ||
30 | @ISA | ||||
31 | 1 | 442µs | 2 | 174µs | }; # spent 100µs making 1 call to Mail::SpamAssassin::Locker::BEGIN@29
# spent 74µs making 1 call to vars::import |
32 | |||||
33 | 1 | 12µs | @ISA = qw(); | ||
34 | |||||
35 | ########################################################################### | ||||
36 | |||||
37 | # spent 23µs within Mail::SpamAssassin::Locker::new which was called:
# once (23µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::new at line 43 of Mail/SpamAssassin/Locker/UnixNFSSafe.pm | ||||
38 | 1 | 2µs | my $class = shift; | ||
39 | 1 | 2µs | $class = ref($class) || $class; | ||
40 | 1 | 2µs | my $self = { }; | ||
41 | 1 | 12µs | bless ($self, $class); | ||
42 | 1 | 11µs | $self; | ||
43 | } | ||||
44 | |||||
45 | ########################################################################### | ||||
46 | |||||
47 | sub safe_lock { | ||||
48 | my ($self, $path, $max_retries, $mode) = @_; | ||||
49 | # max_retries is optional, should default to about 30 | ||||
50 | # mode is UNIX-style and optional, should default to 0700, | ||||
51 | # callers must specify --x bits | ||||
52 | die "locker: safe_lock not implemented by Locker subclass"; | ||||
53 | } | ||||
54 | |||||
55 | ########################################################################### | ||||
56 | |||||
57 | sub safe_unlock { | ||||
58 | my ($self, $path) = @_; | ||||
59 | die "locker: safe_unlock not implemented by Locker subclass"; | ||||
60 | } | ||||
61 | |||||
62 | ########################################################################### | ||||
63 | |||||
64 | sub refresh_lock { | ||||
65 | my ($self, $path) = @_; | ||||
66 | die "locker: refresh_lock not implemented by Locker subclass"; | ||||
67 | } | ||||
68 | |||||
69 | ########################################################################### | ||||
70 | |||||
71 | # spent 8.80s (387µs+8.80) within Mail::SpamAssassin::Locker::jittery_one_second_sleep which was called 8 times, avg 1.10s/call:
# 5 times (162µs+5.47s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock at line 206 of Mail/SpamAssassin/Locker/UnixNFSSafe.pm, avg 1.09s/call
# 3 times (224µs+3.33s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 87 of Mail/SpamAssassin/Locker/UnixNFSSafe.pm, avg 1.11s/call | ||||
72 | 8 | 26µs | my ($self) = @_; | ||
73 | 8 | 8.80s | 8 | 8.80s | Time::HiRes::sleep(rand(1.0) + 0.5); # spent 8.80s making 8 calls to Time::HiRes::sleep, avg 1.10s/call |
74 | } | ||||
75 | |||||
76 | ########################################################################### | ||||
77 | |||||
78 | 1 | 8µs | 1; |