Skip to content

Commit

Permalink
Get rid of thresh_secs, it's dumb.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiemccarthy committed Dec 13, 2002
1 parent 602a517 commit 7648377
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
2 changes: 0 additions & 2 deletions plugins/Admin/Admin.pm
Expand Up @@ -43,7 +43,6 @@ sub getAccesslogAbusersByID {
my($self, $options) = @_;
my $min_id = $options->{min_id} || 0;
my $thresh_count = $options->{thresh_count} || 100;
my $thresh_secs = $options->{thresh_secs} || 5;
my $thresh_hps = $options->{thresh_hps} || 0.1;
my $limit = 500;
my $ar = $self->sqlSelectAllHashrefArray(
Expand All @@ -55,7 +54,6 @@ sub getAccesslogAbusersByID {
"id >= $min_id",
"GROUP BY host_addr,op
HAVING c >= $thresh_count
AND secs >= $thresh_secs
AND hps >= $thresh_hps
ORDER BY maxts DESC, c DESC
LIMIT $limit"
Expand Down
2 changes: 0 additions & 2 deletions plugins/Admin/admin.pl
Expand Up @@ -1710,7 +1710,6 @@ sub displayRecentRequests {

my $options = { min_id => $min_id };
$options->{thresh_count} = defined($form->{thresh_count}) ? $form->{thresh_count} : 100;
$options->{thresh_secs} = defined($form->{thresh_secs} ) ? $form->{thresh_secs} : 5;
$options->{thresh_hps} = defined($form->{thresh_hps} ) ? $form->{thresh_hps} : 0.1;

my $start_time = Time::HiRes::time;
Expand All @@ -1727,7 +1726,6 @@ sub displayRecentRequests {
min_id_ts => $min_id_ts,
max_id => $max_id,
thresh_count => $options->{thresh_count},
thresh_secs => $options->{thresh_secs},
thresh_hps => $options->{thresh_hps},
data => $data,
select_secs => sprintf("%0.3f", $duration),
Expand Down
21 changes: 8 additions & 13 deletions plugins/Admin/templates/recent_requests;admin;default
Expand Up @@ -4,7 +4,7 @@ __description__
* min_id
* min_id_ts
* max_id
* thresh_count, thresh_secs, thresh_hps
* thresh_count, thresh_hps
* data

__title__
Expand All @@ -27,8 +27,6 @@ __template__
<TR><TD>Current&nbsp;Time&nbsp;</TD><TD>[% Slash.db.getTime %]</TD></TR>
<TR><TD>Hits&nbsp;Threshold&nbsp;</TD><TD><INPUT TYPE="text"
NAME="thresh_count" VALUE="[% thresh_count | strip_attribute %]" SIZE="8"></TD></TR>
<TR><TD>Secs&nbsp;Threshold&nbsp;</TD><TD><INPUT TYPE="text"
NAME="thresh_secs" VALUE="[% thresh_secs | strip_attribute %]" SIZE="8"></TD></TR>
<TR><TD>Hits/Sec&nbsp;Threshold&nbsp;</TD><TD><INPUT TYPE="text"
NAME="thresh_hps" VALUE="[% thresh_hps | strip_attribute %]" SIZE="8"></TD></TR>
<TR><TD>&nbsp;</TD><TD><INPUT TYPE="SUBMIT" NAME="none" VALUE="Reload"></TD></TR>
Expand All @@ -41,39 +39,36 @@ __template__
value minus 10,000.
Each of the thresholds must be met for an IPID/Page pair to make
it onto the list below.
E.g., if secs is 30 and the first and last click for an IPID/Page
pair, since the Min ID, occurred within 30 seconds, the pair will
not be listed no matter how many clicks occurred in that time.
(Probably best to keep two of the three thresholds low, and
fiddle with either Hits or Hits/Sec, and pull back Min ID if
it looks like that will help.)</FONT>
E.g., if thresh_count is 100 and the IPID only hit that Page 99
times, then no matter how quickly the clicks occurred, this will
not be listed.</FONT>
[% IF data.size %]
<P><FONT SIZE="-1">This data took [% select_secs %] seconds to retrieve:</FONT>
<BR>
<TABLE>
<TR>
<TH>&nbsp;Count&nbsp;</TH>
<TH>&nbsp;Secs&nbsp;</TH>
<TH>&nbsp;Hits/Sec&nbsp;</TH>
<TH>&nbsp;Page&nbsp;</TH>
<TH>&nbsp;IPID&nbsp;</TH>
<TH>&nbsp;Secs&nbsp;</TH>
<TH>&nbsp;MIN(ts)&nbsp;</TH>
<TH>&nbsp;MAX(ts)&nbsp;</TH>
</TR>
[% FOREACH row = data %]
<TR>
<TD ALIGN="RIGHT">[% row.c %]&nbsp;</TD>
<TD ALIGN="RIGHT">&nbsp;[% row.secs %]&nbsp;</TD>
<TD ALIGN="RIGHT">&nbsp;[% row.hps %]&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;[% row.op %]&nbsp;</TD>
<TD>&nbsp;<A HREF="[% constants.rootdir %]/users.pl?op=userinfo&amp;userfield=[% row.ipid | strip_attribute %]&amp;fieldname=ipid">[% row.ipid_vis %]</A>&nbsp;</TD>
<TD ALIGN="RIGHT">&nbsp;[% row.secs %]&nbsp;</TD>
<TD>&nbsp;[% row.mints.substr(5) %]&nbsp;</TD>
<TD>&nbsp;[% row.maxts.substr(5) %]&nbsp;</TD>
</TR>
[% IF row.bannedts %]
<TR>
<TD COLSPAN="3">&nbsp;</TD>
<TD COLSPAN="4"><FONT SIZE="-1">Banned:&nbsp;[% row.bannedts %]&nbsp;[% row.bannedreason %]</FONT></TD>
<TD COLSPAN="4">&nbsp;</TD>
<TD COLSPAN="3"><FONT SIZE="-1">Banned:&nbsp;[% row.bannedts %]&nbsp;[% row.bannedreason %]</FONT></TD>
</TR>
[% END %]
[% END %]
Expand Down

0 comments on commit 7648377

Please sign in to comment.