You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2018/10/09 13:53:21 UTC
svn commit: r1843283 -
/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm
Author: hege
Date: Tue Oct 9 13:53:21 2018
New Revision: 1843283
URL: http://svn.apache.org/viewvc?rev=1843283&view=rev
Log:
Add some timings
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm?rev=1843283&r1=1843282&r2=1843283&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Razor2.pm Tue Oct 9 13:53:21 2018
@@ -365,6 +365,8 @@ sub plugin_report {
return unless $self->{main}->{conf}->{use_razor2};
return if $options->{report}->{options}->{dont_report_to_razor};
+ my $timer = $self->{main}->time_method("razor2_report");
+
if ($self->razor2_access($options->{text}, 'report', undef)) {
$options->{report}->{report_available} = 1;
info('reporter: spam reported to Razor');
@@ -378,6 +380,8 @@ sub plugin_report {
sub plugin_revoke {
my ($self, $options) = @_;
+ my $timer = $self->{main}->time_method("razor2_revoke");
+
return unless $self->{razor2_available};
return if $self->{main}->{local_tests_only};
return unless $self->{main}->{conf}->{use_razor2};
@@ -425,10 +429,11 @@ sub check_razor2 {
return 0 if $pms->{razor2_running};
$pms->{razor2_running} = 1;
+ my $timer = $self->{main}->time_method("check_razor2");
+
## non-forking method
if (!$self->{main}->{conf}->{razor_fork}) {
- my $timer = $self->{main}->time_method("check_razor2");
# TODO: check for cache header, set results appropriately
# do it this way to make it easier to get out the results later from the
# netcache plugin ... what netcache plugin?
@@ -499,6 +504,8 @@ sub _check_forked_result {
return 0 if !$pms->{razor2_backchannel};
+ my $timer = $self->{main}->time_method("check_razor2");
+
my $kid_pid = (keys %{$pms->{razor2_backchannel}->{kids}})[0];
# if $finish, force waiting for the child
my $pid = waitpid($kid_pid, $finish ? 0 : WNOHANG);