[LON-CAPA-cvs] cvs: loncom /debugging_tools login_count.pl user_login_count.pl
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 07 Apr 2005 01:50:49 -0000
albertel Wed Apr 6 21:50:49 2005 EDT
Modified files:
/loncom/debugging_tools login_count.pl user_login_count.pl
Log:
- add ability to ignore a regexp of users
Index: loncom/debugging_tools/login_count.pl
diff -u loncom/debugging_tools/login_count.pl:1.7 loncom/debugging_tools/login_count.pl:1.8
--- loncom/debugging_tools/login_count.pl:1.7 Wed Mar 30 13:04:53 2005
+++ loncom/debugging_tools/login_count.pl Wed Apr 6 21:50:49 2005
@@ -5,9 +5,9 @@
use LONCAPA::Configuration;
use Date::Manip;
-my $start_time=&UnixDate("Mar 30th 00:00:00 2004","%s");
+my $start_time=&UnixDate("Aug 30th 00:00:00 2004","%s");
my @counts=('1','10','100','1000','10000','100000','250000','1000000');
-
+my @ignored_users=('^itds\d+$');
sub only_user_activitylog_files {
print (join("\n",@_));
@@ -23,6 +23,9 @@
open(FILE,"<$File::Find::name");
$numusers++;
my $user=(split('/',$File::Find::dir))[-1];
+ foreach my $expr (@ignored_users) {
+ if ($user=~/$expr/) { print("\nignoring $user\n"); return; }
+ }
while (my $line=<FILE>) {
if ($line !~ /Login/) { next; }
my ($date,$machine)=split(':',$line,3);
Index: loncom/debugging_tools/user_login_count.pl
diff -u loncom/debugging_tools/user_login_count.pl:1.1 loncom/debugging_tools/user_login_count.pl:1.2
--- loncom/debugging_tools/user_login_count.pl:1.1 Wed Sep 8 15:42:09 2004
+++ loncom/debugging_tools/user_login_count.pl Wed Apr 6 21:50:49 2005
@@ -7,6 +7,7 @@
my $start_time=&UnixDate("Aug 30th 00:00:00 2004","%s");
my @counts=('1','10','100','1000','10000','100000','250000');
+my @ignored_users=('^itds\d+$');
sub only_user_activitylog_files {
@@ -22,6 +23,9 @@
open(FILE,"<$File::Find::name");
$numusers++;
my $user=(split('/',$File::Find::dir))[-1];
+ foreach my $expr (@ignored_users) {
+ if ($user=~/$expr/) { print("\nignoring $user\n"); return; }
+ }
while (my $line=<FILE>) {
if ($line !~ /Login/) { next; }
my ($date)=split(':',$line,2);