Gitlab Community Edition Instance

Commit 3120ba8c authored by Bjørn Nachtwey's avatar Bjørn Nachtwey
Browse files

0.6.10.2 create copy of profile file with Date for timeline anaylsis

parent 3dbfd68b
......@@ -68,6 +68,7 @@
# 2021-07-15 0.6.9 identify and remove duplicate entries with "SUN" and "SUY" keeping "SUN" if both are given
# 2021-11-29 0.6.10 move evaluation for profiling to child tread, collect more detailed data
# 2021-11-29 0.6.10.1 changed "Bytes inspected" and "Bytes transferred" in prof file to "GBytes"
# 2022-01-24 0.6.10.2 create copy of profile file with Date for timeline anaylsis
#
# important notes
#
......@@ -86,6 +87,7 @@ use strict;
use warnings;
use File::Spec::Functions;
use File::Find::Rule;
use File::Copy;
use Time::Piece;
use Fcntl qw(:flock);
......@@ -154,6 +156,7 @@ my $logfile; # name of single logfile
my $childlogapx = ".child.log"; # Appendix of child files
my $statfilename; # Path and Name of statistics file
my $proffilename; # Path and Name of profiling file
my $todproffilename; # Path and Name of profiling file with date
my $profapx = ".prof"; # Appendix of profiling file
my @proftimes; # an Array holding all subfolders and processing times
my @profdirs; # an Array holding all subfolders with profiling times available
......@@ -313,6 +316,11 @@ foreach $actpath (@startpaths)
# some preparation
#
###############################################################################
# get from localtime()
(undef, $min, $hour, $mday, $mon, $year, undef, undef, undef) = localtime();
# sec min hour mday mon year wday yday isdst
$date = sprintf "%d-%2.2d-%2.2d", $year+1900, $mon+1, $mday;
$starttimestring = sprintf "%d-%2.2d-%2.2d %2.2d:%2.2d", $year+1900, $mon+1, $mday, $hour, $min;
# set name of PID file
$pidfile = "dsmci.pid"; # set path and name of timestampfile
......@@ -321,6 +329,9 @@ $log_filename = $$ . "log";
$err_filename = $$ . "err";
$globallog_filename = $$ . ".all.log";
$proffilename = File::Spec->canonpath("dsmci".$profapx);
$todproffilename = File::Spec->canonpath($date.".dsmci".$profapx);
if ( $pidcheck == TRUE )
{
## check for running processes like this
......@@ -338,11 +349,7 @@ if ( $pidcheck == TRUE )
}
}
# get from localtime()
(undef, $min, $hour, $mday, $mon, $year, undef, undef, undef) = localtime();
# sec min hour mday mon year wday yday isdst
$date = sprintf "%d-%2.2d-%2.2d", $year+1900, $mon+1, $mday;
$starttimestring = sprintf "%d-%2.2d-%2.2d %2.2d:%2.2d", $year+1900, $mon+1, $mday, $hour, $min;
###############################################################################
###############################################################################
......@@ -363,7 +370,7 @@ foreach $actpath (@startpaths)
$rule->maxdepth($maxdepth);
$rule->mindepth($maxdepth);
$rule->not($rule->new->symlink);
my @tsuyd =$rule->in($actpath);
my @tsuyd = $rule->in($actpath);
# add su=y information to each path entry
foreach $item (@tsuyd)
......@@ -415,18 +422,15 @@ foreach $item (@sortlist)
}
}
###############################################################################
#
# read profiling
# read last profiling
#
###############################################################################
$proffilename = File::Spec->canonpath("dsmci".$profapx);
## code snipped off to "profiling_v2.pl"
#else take the dirs as they are listed
###############################################################################
###############################################################################
# main loop
......@@ -518,7 +522,7 @@ while (my $line = <$GLOBALLOGFILE>)
my $of ; # objects failed
my $bi ; # bytes inspected
my $bt ; # bytes transfered
my $dtt; # transfer time
my $dtt ; # transfer time
my $rc = -1; # return code of child process
(undef, $et, $dir, $rc, $oi, $ob, $ou, $od, $oe, $of, $bi, $bt, $dtt) = split ';', $line;
......@@ -566,6 +570,8 @@ foreach $line (@sproflines)
{ printf $PROFFILE "%s\n", $line; }
close $PROFFILE;
# create copy of profline file with actual date in name
copy($proffilename, $todproffilename) or warn "Cannot copy profiling file";
###############################################################################
# write error info log
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment