← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:15 2021

Filename/usr/local/libexec/sympa/Sympa/Task.pm
StatementsExecuted 219829 statements in 316ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
575011102ms1.08sSympa::Task::::_chk_lineSympa::Task::_chk_line
11501194.2ms2.05sSympa::Task::::_parseSympa::Task::_parse
23001152.4ms477msSympa::Task::::_chk_cmdSympa::Task::_chk_cmd
25272247.4ms2.38sSympa::Task::::newSympa::Task::new
348428128.3ms28.3msSympa::Task::::CORE:matchSympa::Task::CORE:match (opcode)
47152111.8ms11.8msSympa::Task::::CORE:regcompSympa::Task::CORE:regcomp (opcode)
1150113.81ms3.81msSympa::Task::::get_idSympa::Task::get_id
2415113.13ms3.13msSympa::Task::::CORE:substSympa::Task::CORE:subst (opcode)
0000s0sSympa::Task::::BEGIN@30Sympa::Task::BEGIN@30
0000s0sSympa::Task::::BEGIN@31Sympa::Task::BEGIN@31
0000s0sSympa::Task::::BEGIN@32Sympa::Task::BEGIN@32
0000s0sSympa::Task::::BEGIN@33Sympa::Task::BEGIN@33
0000s0sSympa::Task::::BEGIN@35Sympa::Task::BEGIN@35
0000s0sSympa::Task::::BEGIN@36Sympa::Task::BEGIN@36
0000s0sSympa::Task::::BEGIN@37Sympa::Task::BEGIN@37
0000s0sSympa::Task::::BEGIN@38Sympa::Task::BEGIN@38
0000s0sSympa::Task::::BEGIN@39Sympa::Task::BEGIN@39
0000s0sSympa::Task::::BEGIN@45Sympa::Task::BEGIN@45
0000s0sSympa::Task::::BEGIN@52Sympa::Task::BEGIN@52
0000s0sSympa::Task::::__ANON__Sympa::Task::__ANON__ (xsub)
0000s0sSympa::Task::::dupSympa::Task::dup
0000s0sSympa::Task::::get_tasksSympa::Task::get_tasks
0000s0sSympa::Task::::linesSympa::Task::lines
0000s0sSympa::Task::::to_stringSympa::Task::to_string
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# -*- indent-tabs-mode: nil; -*-
2# vim:ft=perl:et:sw=4
3# $Id$
4
5# Sympa - SYsteme de Multi-Postage Automatique
6#
7# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
8# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
9# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
10# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
11# Copyright 2018 The Sympa Community. See the AUTHORS.md file at the
12# top-level directory of this distribution and at
13# <https://github.com/sympa-community/sympa.git>.
14#
15# This program is free software; you can redistribute it and/or modify
16# it under the terms of the GNU General Public License as published by
17# the Free Software Foundation; either version 2 of the License, or
18# (at your option) any later version.
19#
20# This program is distributed in the hope that it will be useful,
21# but WITHOUT ANY WARRANTY; without even the implied warranty of
22# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23# GNU General Public License for more details.
24#
25# You should have received a copy of the GNU General Public License
26# along with this program. If not, see <http://www.gnu.org/licenses/>.
27
28package Sympa::Task;
29
30use strict;
31use warnings;
32use Scalar::Util;
33use Template;
34
35use Sympa;
36use Conf;
37use Sympa::Language;
38use Sympa::Log;
39use Sympa::Tools::Data;
40
41my $language = Sympa::Language->instance;
42my $log = Sympa::Log->instance;
43
44# List of list task models. FIXME:Refer Sympa::ListDef.
45use constant list_models => {
46 #expire => 'expire_task', # Not yet implemented.
47 remind => 'remind_task',
48 sync_include => '',
49};
50
51# List of global task models. FIXME:Refer Sympa::ConfDef.
52use constant site_models => {
53 expire_bounce => 'expire_bounce_task',
54 purge_user_table => 'purge_user_table_task',
55 purge_logs_table => 'purge_logs_table_task',
56 purge_session_table => 'purge_session_table_task',
57 purge_spools => 'purge_spools_task',
58 purge_tables => 'purge_tables_task',
59 purge_one_time_ticket_table => 'purge_one_time_ticket_table_task',
60 purge_orphan_bounces => 'purge_orphan_bounces_task',
61 eval_bouncers => 'eval_bouncers_task',
62 process_bouncers => 'process_bouncers_task',
63};
64
65# Creates a new Sympa::Task object.
66# Old name: create() in task_manager.pl, entirely rewritten.
67
# spent 2.38s (47.4ms+2.34) within Sympa::Task::new which was called 2527 times, avg 943µs/call: # 1377 times (25.3ms+286ms) by Sympa::Spool::Task::_create_all_tasks at line 107 of /usr/local/libexec/sympa/Sympa/Spool/Task.pm, avg 226µs/call # 1150 times (22.0ms+2.05s) by Sympa::Spool::next at line 162 of /usr/local/libexec/sympa/Sympa/Spool.pm, avg 1.80ms/call
sub new {
682527704µs my $class = shift;
69 # Optional serialized content.
702527530µs my $serialized;
7125278.22ms25272.19ms if (@_ and ($_[0] eq '' or $_[0] =~ /\n/)) {
# spent 2.19ms making 2527 calls to Sympa::Task::CORE:match, avg 868ns/call
72 $serialized = shift;
73 }
7425274.82ms my %options = @_;
75
76 die 'bug in logic. Ask developer'
7725271.70ms unless defined $options{model} and length $options{model};
78 $options{context} = '*'
7925271.67ms unless ref $options{context} eq 'Sympa::List'; #FIXME
80 $options{date} = time
812527663µs unless defined $options{date};
82 $options{label} = ($options{model} eq 'sync_include') ? 'INIT' : ''
8325271.50ms unless defined $options{label};
84
8525277.20ms my $self = bless {%options} => $class;
86
872527561µs unless (defined $serialized) {
881377522µs my $that = $self->{context};
891377465µs my $model = $self->{model};
901377298µs my $name;
91 my $pname;
92
9313773.13ms if (defined $self->{name} and length $self->{name}) {
94 die 'bug in logic. Ask developer'
95 unless $self->{name} =~ /\A\w+\z/;
96 $name = $self->{name};
97 } elsif (ref $that eq 'Sympa::List' and $model eq 'sync_include') {
98 $name = 'ttl';
99 } elsif (ref $that eq 'Sympa::List'
100 and $pname = ${list_models()}{$model}) {
101 $name = $that->{'admin'}{$pname}->{'name'};
102 } elsif ($that eq '*' and $pname = ${site_models()}{$model}) {
103 $name = Conf::get_robot_conf($that, $pname);
104 } else {
105 $log->syslog('err', 'Unknown task %s for %s', $model, $that);
106 return undef;
107 }
1081377330µs unless ($name) {
10913771.79ms1377285ms $log->syslog('debug3', 'Inactive task %s for %s', $model, $that);
# spent 285ms making 1377 calls to Sympa::Log::syslog, avg 207µs/call
110137710.1ms return undef;
111 }
112
113 my $model_name = sprintf '%s.%s.task', $model, $name;
114 my $model_file =
115 Sympa::search_fullpath($that, $model_name, subdir => 'tasks');
116 unless ($model_file) {
117 $log->syslog('err', 'Unable to find task file %s for %s',
118 $model_name, $that);
119 return undef;
120 }
121
122 # creation
123 my $data = {
124 creation_date => $self->{date}, # Compat., has never used
125 execution_date => 'execution_date', # Compat.
126 };
127 if (ref $that eq 'Sympa::List') {
128 $data->{domain} = $that->{'domain'}; # New on 6.2.37b
129 $data->{list} = {
130 name => $that->{'name'},
131 robot => $that->{'domain'}, # Compat., has never used
132 ttl => $that->{'admin'}{'ttl'},
133 };
134 }
135 my $tt2 = Template->new(
136 { 'START_TAG' => quotemeta('['),
137 'END_TAG' => quotemeta(']'),
138 'ABSOLUTE' => 1
139 }
140 );
141 unless ($tt2 and $tt2->process($model_file, $data, \$serialized)) {
142 $log->syslog('err', 'Failed to parse task template "%s": %s',
143 $model_file, $tt2->error);
144 return undef;
145 }
146 }
147
14811501.71ms11502.05s unless ($self->_parse($serialized)) {
# spent 2.05s making 1150 calls to Sympa::Task::_parse, avg 1.78ms/call
149 $log->syslog('err', 'Syntax error in task file. You should check %s',
150 $self);
151 return undef;
152 }
15311503.68ms $self;
154}
155
156### DEFINITION OF AVAILABLE COMMANDS FOR TASKS ###
157
158my $date_arg_regexp1 = '\d+|execution_date';
159my $date_arg_regexp2 = '(\d\d\d\dy)(\d+m)?(\d+d)?(\d+h)?(\d+min)?(\d+sec)?';
160my $date_arg_regexp3 =
161 '(\d+|execution_date)(\+|\-)(\d+y)?(\d+m)?(\d+w)?(\d+d)?(\d+h)?(\d+min)?(\d+sec)?';
162my $delay_regexp = '(\d+y)?(\d+m)?(\d+w)?(\d+d)?(\d+h)?(\d+min)?(\d+sec)?';
163my $var_regexp = '@\w+';
164my $subarg_regexp = '(\w+)(|\((.*)\))';
165
166# commands which use a variable. If you add such a command, the first
167# parameter must be the variable
168my %var_commands = (
169 'delete_subs' => ['var'],
170 # variable
171 'send_msg' => ['var', '\w+'],
172 #variable template
173 'rm_file' => ['var'],
174 # variable
175);
176
177# commands which are used for assignments
178my %asgn_commands = (
179 'select_subs' => ['subarg'],
180 # condition
181 'delete_subs' => ['var'],
182 # variable
183);
184
185# regular commands
186my %commands = (
187 'next' => ['date', '\w*'],
188 # date label
189 'stop' => [],
190 'create' => ['subarg', '\w+', '\w+'],
191 #object model model choice
192 'exec' => ['.+'],
193 #file #delay
194 'expire_bounce' => ['\d+'],
195 #template date
196 'sync_include' => [],
197 'purge_user_table' => [],
198 'purge_logs_table' => [],
199 'purge_session_table' => [],
200 'purge_spools' => [],
201 'purge_tables' => [],
202 'purge_one_time_ticket_table' => [],
203 'purge_orphan_bounces' => [],
204 'eval_bouncers' => [],
205 'process_bouncers' => [],
206 %var_commands,
207 %asgn_commands,
208);
209
210### SYNTAX CHECKING SUBROUTINES ###
211
212# Check the syntax of a task.
213# Old name: check() in task_manager.pl.
214
# spent 2.05s (94.2ms+1.95) within Sympa::Task::_parse which was called 1150 times, avg 1.78ms/call: # 1150 times (94.2ms+1.95s) by Sympa::Task::new at line 148, avg 1.78ms/call
sub _parse {
21511501.30ms1150210ms $log->syslog('debug2', '(%s, ...)', @_);
# spent 210ms making 1150 calls to Sympa::Log::syslog, avg 183µs/call
2161150344µs my $self = shift;
2171150261µs my $serialized = shift;
218
2191150296µs my $lnb = 0; # line number
2201150215µs my %used_labels; # list of labels used as parameter in commands
221 my %labels; # list of declared labels
222 my %used_vars; # list of vars used as parameter in commands
223 my %vars; # list of declared vars
224
2251150298µs return undef unless defined $serialized;
2261150728µs $self->{_source} = $serialized;
2271150854µs $self->{_title} = {};
22811501.52ms $self->{_parsed} = [];
229
23011506.98ms foreach my $line (split /\r\n|\r|\n/, $serialized) {
2315750762µs $lnb++;
232575032.7ms57502.03ms next if $line =~ /^\s*\#/;
# spent 2.03ms making 5750 calls to Sympa::Task::CORE:match, avg 354ns/call
233
2345750978µs my %result;
235
23657505.90ms57501.08s unless (_chk_line($line, \%result)) {
# spent 1.08s making 5750 calls to Sympa::Task::_chk_line, avg 188µs/call
237 $log->syslog('err', 'Error at line %s: %s', $lnb, $line);
238 $log->syslog('err', '%s', $result{'error'});
239 return undef;
240 }
241
24257507.84ms2300477ms if ($result{'nature'} eq 'assignment') {
# spent 477ms making 2300 calls to Sympa::Task::_chk_cmd, avg 207µs/call
243 if (_chk_cmd(
244 $result{'command'}, $lnb,
245 $result{'Rarguments'}, \%used_labels,
246 \%used_vars
247 )
248 ) {
249 $vars{$result{'var'}} = 1;
250 } else {
251 return undef;
252 }
253 } elsif ($result{'nature'} eq 'command') {
254 return undef
255 unless _chk_cmd($result{'command'}, $lnb,
256 $result{'Rarguments'}, \%used_labels, \%used_vars);
257 } elsif ($result{'nature'} eq 'label') {
258 $labels{$result{'label'}} = 1;
259 } elsif ($result{'nature'} eq 'title') {
26011501.09ms $self->{_title}->{$result{'lang'}} = $result{'title'};
26111501.21ms next;
262 } else {
2631150821µs next;
264 }
265
266345011.2ms push @{$self->{_parsed}}, {%result, line => $lnb};
267 }
268
269 # are all labels used ?
27011501.05ms foreach my $label (keys %labels) {
271 $log->syslog('debug3', 'Warning: Label %s exists but is not used',
272 $label)
2731150529µs unless $used_labels{$label};
274 }
275
276 # do all used labels exist ?
2771150625µs foreach my $label (keys %used_labels) {
2781150365µs unless ($labels{$label}) {
279 $log->syslog('err', 'Label %s is used but does not exist',
280 $label);
281 return undef;
282 }
283 }
284
285 # are all variables used ?
2861150531µs foreach my $var (keys %vars) {
287 $log->syslog('notice', 'Warning: Var %s exists but is not used', $var)
288 unless $used_vars{$var};
289 }
290
291 # do all used variables exist ?
2921150469µs foreach my $var (keys %used_vars) {
293 unless ($vars{$var}) {
294 $log->syslog('err', 'Var %s is used but does not exist', $var);
295 return undef;
296 }
297 }
298
299 # Set the title in the current language.
3001150600µs my $titles = $self->{_title} || {};
30111503.44ms230040.3ms foreach my $lang (Sympa::Language::implicated_langs($language->get_lang))
# spent 38.5ms making 1150 calls to Sympa::Language::implicated_langs, avg 34µs/call # spent 1.78ms making 1150 calls to Sympa::Language::get_lang, avg 2µs/call
302 {
3031150623µs if (exists $titles->{$lang}) {
304 $self->{title} = $titles->{$lang};
305 last;
306 }
307 }
30811502.92ms1150144ms if ($self->{title}) {
# spent 144ms making 1150 calls to Sympa::Language::gettext, avg 125µs/call
309 ;
310 } elsif (exists $titles->{gettext}) {
311 $self->{title} = $language->gettext($titles->{gettext});
312 } elsif (exists $titles->{default}) {
313 $self->{title} = $titles->{default};
314 } else {
315 $self->{title} = $self->{name} || $self->{model};
316 }
317
31811507.30ms return 1;
319}
320
321# Check a task line.
322# Old name: chk_line() in task_manager.pl.
323
# spent 1.08s (102ms+978ms) within Sympa::Task::_chk_line which was called 5750 times, avg 188µs/call: # 5750 times (102ms+978ms) by Sympa::Task::_parse at line 236, avg 188µs/call
sub _chk_line {
32457501.58ms my $line = shift;
3255750846µs my $Rhash = shift;
326
327 ## just in case...
32857501.68ms chomp $line;
329
33057509.31ms5750961ms $log->syslog('debug2', '(%s, %s)', $line, $Rhash->{'nature'});
# spent 961ms making 5750 calls to Sympa::Log::syslog, avg 167µs/call
331
33257502.52ms $Rhash->{'nature'} = undef;
333
334 # empty line
33557501.38ms unless (length $line) {
3361150481µs $Rhash->{'nature'} = 'empty line';
33711501.50ms return 1;
338 }
339
340 # comment
341460012.6ms46002.02ms if ($line =~ /^\s*\#.*/) {
# spent 2.02ms making 4600 calls to Sympa::Task::CORE:match, avg 439ns/call
342 $Rhash->{'nature'} = 'comment';
343 return 1;
344 }
345
346 # title
347 #FIXME:Currently not used.
348460016.4ms115006.40ms if ($line =~ /^\s*title\.gettext\s+(.*)\s*$/i) {
# spent 6.40ms making 11500 calls to Sympa::Task::CORE:match, avg 556ns/call
34911502.58ms @{$Rhash}{qw(nature title lang)} = ('title', $1, 'gettext');
35011502.01ms return 1;
351 } elsif ($line =~ /^\s*title\.(\S+)\s+(.*)\s*$/i) {
352 my ($lang, $title) = ($1, $2);
353 # canonicalize lang if possible.
354 $lang = Sympa::Language::canonic_lang($lang) || $lang;
355 @{$Rhash}{qw(nature title lang)} = ('title', $title, $lang);
356 return 1;
357 } elsif ($line =~ /^\s*title\s+(.*)\s*$/i) {
358 @{$Rhash}{qw(nature title lang)} = ('title', $1, 'default');
359 return 1;
360 }
361
362 # label
36334505.96ms34502.28ms if ($line =~ /^\s*\/\s*(.*)/) {
# spent 2.28ms making 3450 calls to Sympa::Task::CORE:match, avg 660ns/call
3641150529µs $Rhash->{'nature'} = 'label';
3651150950µs $Rhash->{'label'} = $1;
36611501.63ms return 1;
367 }
368
369 # command
37023006.12ms23003.63ms if ($line =~ /^\s*(\w+)\s*\((.*)\)\s*/i) {
# spent 3.63ms making 2300 calls to Sympa::Task::CORE:match, avg 2µs/call
371
37223002.19ms my $command = lc($1);
37323002.60ms my @args = split(/,/, $2);
374471513.5ms24153.13ms foreach (@args) { s/\s//g; }
# spent 3.13ms making 2415 calls to Sympa::Task::CORE:subst, avg 1µs/call
375
37623001.13ms unless ($commands{$command}) {
377 $Rhash->{'nature'} = 'error';
378 $Rhash->{'error'} = "unknown command $command";
379 return 0;
380 }
381
3822300795µs $Rhash->{'nature'} = 'command';
3832300934µs $Rhash->{'command'} = $command;
384
385 # arguments recovery. no checking of their syntax !!!
38623001.13ms $Rhash->{'Rarguments'} = \@args;
38723003.89ms return 1;
388 }
389
390 # assignment
391 if ($line =~ /^\s*(@\w+)\s*=\s*(.+)/) {
392 my %hash2;
393 _chk_line($2, \%hash2);
394 unless ($asgn_commands{$hash2{'command'}}) {
395 $Rhash->{'nature'} = 'error';
396 $Rhash->{'error'} = "non valid assignment $2";
397 return 0;
398 }
399 $Rhash->{'nature'} = 'assignment';
400 $Rhash->{'var'} = $1;
401 $Rhash->{'command'} = $hash2{'command'};
402 $Rhash->{'Rarguments'} = $hash2{'Rarguments'};
403 return 1;
404 }
405
406 $Rhash->{'nature'} = 'error';
407 $Rhash->{'error'} = 'syntax error';
408 return 0;
409}
410
411# Check the arguments of a command.
412# Old name: chk_cmd() in task_manager.pl.
413
# spent 477ms (52.4+424) within Sympa::Task::_chk_cmd which was called 2300 times, avg 207µs/call: # 2300 times (52.4ms+424ms) by Sympa::Task::_parse at line 242, avg 207µs/call
sub _chk_cmd {
41423002.55ms2300403ms $log->syslog('debug2', '(%s, %d, %s)', @_);
# spent 403ms making 2300 calls to Sympa::Log::syslog, avg 175µs/call
4152300824µs my $cmd = shift; # command name
4162300371µs my $lnb = shift; # line number
4172300373µs my $Rargs = shift; # argument list
4182300351µs my $Rused_labels = shift;
4192300354µs my $Rused_vars = shift;
420
42123001.16ms if (defined $commands{$cmd}) {
42223001.67ms my @expected_args = @{$commands{$cmd}};
423
4242300857µs unless (scalar(@expected_args) == scalar(@$Rargs)) {
425 $log->syslog('err',
426 'Error at line %s: wrong number of arguments for %s',
427 $lnb, $cmd);
428 $log->syslog(
429 'err',
430 'Args = %s; expected_args = %s',
431 join(',', @$Rargs),
432 join(',', @expected_args)
433 );
434 return undef;
435 }
436
43723001.45ms foreach my $arg (@$Rargs) {
4382415324µs my $error;
4392415733µs my $regexp = shift @expected_args;
440
44124151.63ms if ($regexp eq 'date') {
442115030.2ms690012.0ms $error = 1
# spent 8.55ms making 3450 calls to Sympa::Task::CORE:match, avg 2µs/call # spent 3.43ms making 3450 calls to Sympa::Task::CORE:regcomp, avg 993ns/call
443 unless $arg =~ /^$date_arg_regexp1$/i
444 or $arg =~ /^$date_arg_regexp2$/i
445 or $arg =~ /^$date_arg_regexp3$/i;
446 } elsif ($regexp eq 'delay') {
447 $error = 1 unless $arg =~ /^$delay_regexp$/i;
448 } elsif ($regexp eq 'var') {
449 $error = 1 unless $arg =~ /^$var_regexp$/i;
450 } elsif ($regexp eq 'subarg') {
451 $error = 1 unless $arg =~ /^$subarg_regexp$/i;
452 } else {
453126523.1ms25309.53ms $error = 1 unless $arg =~ /^$regexp$/i;
# spent 8.37ms making 1265 calls to Sympa::Task::CORE:regcomp, avg 7µs/call # spent 1.16ms making 1265 calls to Sympa::Task::CORE:match, avg 916ns/call
454 }
455
4562415427µs if ($error) {
457 $log->syslog('err',
458 'Error at line %s: argument %s is not valid',
459 $lnb, $arg);
460 return undef;
461 }
462
46324152.18ms $Rused_labels->{$Rargs->[1]} = 1
464 if $cmd eq 'next' and $Rargs->[1];
465 $Rused_vars->{$Rargs->[0]} = 1
46624151.32ms if $var_commands{$cmd};
467 }
468 }
46923003.76ms return 1;
470}
471
472sub dup {
473 my $self = shift;
474
475 my $clone = {};
476 foreach my $key (sort keys %$self) {
477 my $val = $self->{$key};
478 next unless defined $val;
479
480 unless (Scalar::Util::blessed($val)) {
481 $clone->{$key} = Sympa::Tools::Data::dup_var($val);
482 } elsif ($val->can('dup') and !$val->isa('Sympa::List')) {
483 $clone->{$key} = $val->dup;
484 } else {
485 $clone->{$key} = $val;
486 }
487 }
488
489 return bless $clone => ref($self);
490}
491
492sub to_string {
493 shift->{_source};
494}
495
496sub lines {
497 @{shift->{_parsed} || []};
498}
499
500# Old name: Sympa::List::load_task_list() which returned hashref.
501sub get_tasks {
502 $log->syslog('debug2', '(%s, %s)', @_);
503 my $that = shift;
504 my $model = shift;
505
506 my %tasks;
507
508 foreach my $dir (@{Sympa::get_search_path($that, subdir => 'tasks')}) {
509 my $dh;
510 opendir $dh, $dir or next;
511 foreach my $file (readdir $dh) {
512 next unless $file =~ /\A$model[.](\w+)[.]task\z/;
513 my $name = $1;
514 next if $tasks{$name};
515
516 my $task = Sympa::Task->new(
517 context => $that,
518 model => $model,
519 name => $name
520 );
521 next unless $task;
522
523 $tasks{$name} = $task;
524 }
525 closedir $dh;
526 }
527
528 return [map { $tasks{$_} } sort keys %tasks];
529}
530
531## Build all Sympa::Task objects
532# No longer used. Use Sympa::Spool::Task::next().
533#sub list_tasks;
534
535## Return a list tasks for the given list
536# No longer used. Use Sympa::Spool::Task::next().
537#sub get_tasks_by_list;
538
539# No longer used.
540#sub get_used_models;
541
542# No longer used. Use Sympa::Spool::Task::next().
543#sub get_task_list;
544
545## sort task name by their epoch date
546# No longer used.
547#sub epoch_sort;
548
549
# spent 3.81ms within Sympa::Task::get_id which was called 1150 times, avg 3µs/call: # 1150 times (3.81ms+0s) by Sympa::Log::syslog at line 112 of /usr/local/libexec/sympa/Sympa/Log.pm, avg 3µs/call
sub get_id {
5501150335µs my $self = shift;
551 sprintf 'date=%s;label=%s;model=%s;context=%s',
552 @{$self}{qw(date label model)},
55311504.18ms (ref $self->{context} ? $self->{context}->get_id : '*');
554}
555
5561;
557__END__
 
# spent 28.3ms within Sympa::Task::CORE:match which was called 34842 times, avg 811ns/call: # 11500 times (6.40ms+0s) by Sympa::Task::_chk_line at line 348, avg 556ns/call # 5750 times (2.03ms+0s) by Sympa::Task::_parse at line 232, avg 354ns/call # 4600 times (2.02ms+0s) by Sympa::Task::_chk_line at line 341, avg 439ns/call # 3450 times (8.55ms+0s) by Sympa::Task::_chk_cmd at line 442, avg 2µs/call # 3450 times (2.28ms+0s) by Sympa::Task::_chk_line at line 363, avg 660ns/call # 2527 times (2.19ms+0s) by Sympa::Task::new at line 71, avg 868ns/call # 2300 times (3.63ms+0s) by Sympa::Task::_chk_line at line 370, avg 2µs/call # 1265 times (1.16ms+0s) by Sympa::Task::_chk_cmd at line 453, avg 916ns/call
sub Sympa::Task::CORE:match; # opcode
# spent 11.8ms within Sympa::Task::CORE:regcomp which was called 4715 times, avg 3µs/call: # 3450 times (3.43ms+0s) by Sympa::Task::_chk_cmd at line 442, avg 993ns/call # 1265 times (8.37ms+0s) by Sympa::Task::_chk_cmd at line 453, avg 7µs/call
sub Sympa::Task::CORE:regcomp; # opcode
# spent 3.13ms within Sympa::Task::CORE:subst which was called 2415 times, avg 1µs/call: # 2415 times (3.13ms+0s) by Sympa::Task::_chk_line at line 374, avg 1µs/call
sub Sympa::Task::CORE:subst; # opcode