<commit_before>#
sub toSec {
	my ($h,$m,$s) = split /:/,@_[0];
	return $s + 60 * ($m + (60 * $h));
	return ($result < 0) ? $result + 86400 : $result;
}

sub fixDate {
	my $months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec';
	my ($month, $day, $hh, $mm, $ss, $year) = split "[ \:]+",shift;
	return "$year-". sprintf("%02d",1+index($months,$month)/4) . "-$day $hh:$mm:$ss";
}

my %stats;
my %dates;
my %apps;

open APPDATA,'/home/developers/monitor/webappuse.csv';
while (<APPDATA>) {
  chomp;
  s/ *\t */\t/g;
  my ($date,$ip,$app,$action,$end,$sec,$sys,$loc1,$loc2,$parms) = split "\t";
  $date = fixDate($date);
  $app =~ s/check server/check/;
  next if $sys =~ /PROTOTYPE/;
  next if $sys =~ /\*/;
  next if $sys eq '';
  next if $app =~ / /;
  next if $sys =~ /dev2 /;
  $app =~ s/'//g;
  $stats{$sys}{$app}{uses}++;
  $stats{$sys}{$app}{time}+=$sec;
  $date = substr($date,0,10);
  #print $date;
  $dates{$sys}{$date}{$app}++;
  $apps{$app}++;
}<commit_msg>NOJIRA: revised version of legacy webapp monitoring script<commit_after>#
sub toSec {
	my ($h,$m,$s) = split /:/,@_[0];
	return $s + 60 * ($m + (60 * $h));
	return ($result < 0) ? $result + 86400 : $result;
}

sub fixDate {
	my $months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec';
	my ($month, $day, $hh, $mm, $ss, $year) = split "[ \:]+",shift;
	return "$year-". sprintf("%02d",1+index($months,$month)/4) . "-$day $hh:$mm:$ss";
}

my %stats;
my %dates;
my %apps;my $count = 0;

open APPDATA,"<@ARGV[0]";
while (<APPDATA>) {
  chomp;
  $count++;
  s/ *\t */\t/g;
  my ($date,$ip,$app,$action,$end,$sec,$sys,$loc1,$loc2,$parms) = split "\t";
  $date = fixDate($date);
  $app =~ s/check server/check/;
  next if $sys =~ /PROTOTYPE/;
  next if $sys =~ /\*/;
  next if $sys eq '';
  next if $app =~ / /;
  next if $sys =~ /dev2 /;
  $app =~ s/'//g;
  $stats{$sys}{$app}{uses}++;
  $stats{$sys}{$app}{time}+=$sec;
  $date = substr($date,0,10);
  #print $date;
  $dates{$sys}{$date}{$app}++;
  $apps{$app}++;
}
{'fraction_non_alphanumeric': 0.27194752774974773, 'fraction_numerical': 0.022199798183652877, 'mean_word_length': 3.6440281030444965, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4802138', 'n_tokens_mistral': 892, 'n_tokens_neox': 860, 'n_words': 210}