Dirk-Lüder Kreie a écrit :
> Rodolphe Quiedeville schrieb:
>> Rodolphe Quiedeville a écrit :
>>> Hi,
>>>
>>> I modified tilesGen.pl to write some statistical data in a text file, I
>>> will use this file to make statistics on our different server runnning
>>> [EMAIL PROTECTED] software.
>>>
>>> Please feel free to include it in SVN Repository.
>>>
>>> Regards,
>>
>> Sorry it was the wrong patch file.
>
> I took the liberty of modifying it a bit before committing...
>
Thanks for include my patch, I have a second (and last one) for today. I
add log for compress and upload times, so we could now know what our
client do.
Regards
--
Rodolphe Quiédeville - Artisan Logiciel Libre
http://rodolphe.quiedeville.org/
Travaillons Libre - http://fr.lolix.org/
Index: tilesGen.pl
===================================================================
--- tilesGen.pl (révision 8196)
+++ tilesGen.pl (copie de travail)
@@ -487,8 +487,13 @@
my ($runNumber) = @_;
+ keepLog("compress","start","$runNumber $progressJobs") if $Config->get("ProcessLog");
+
my $CompressScript = "perl $Bin/compress.pl $runNumber $progressJobs";
my $retval = system($CompressScript);
+
+ keepLog("compress","stop","return=$retval") if $Config->get("ProcessLog");
+
return $retval;
}
@@ -499,8 +504,13 @@
my ($runNumber) = @_;
+ keepLog("upload","start","$runNumber $progressJobs") if $Config->get("ProcessLog");
+
my $UploadScript = "perl $Bin/upload.pl $runNumber $progressJobs";
my $retval = system($UploadScript);
+
+ keepLog("upload","stop","return=$retval") if $Config->get("ProcessLog");
+
return $retval;
}
@@ -693,7 +703,7 @@
{
my ($X, $Y, $Zoom) = @_;
- keepLog("start",$X,$Y,$Zoom,$Layers) if $Config->get("ProcessLog");
+ keepLog("GenerateTileset","start","x=$X,y=$Y,z=$Zoom for layers $Layers") if $Config->get("ProcessLog");
my ($N, $S) = Project($Y, $Zoom);
my ($W, $E) = ProjectL($X, $Zoom);
@@ -1111,7 +1121,7 @@
foreach my $file(@tempfiles) { killafile($file) if (!$Config->get("Debug")); }
- keepLog("stop",$X,$Y,$Zoom,$Layers) if $Config->get("ProcessLog");
+ keepLog("GenerateTileset","stop","x=$X,y=$Y,z=$Zoom for layers $Layers") if $Config->get("ProcessLog");
return 1;
}
Index: tahlib.pm
===================================================================
--- tahlib.pm (révision 8196)
+++ tahlib.pm (copie de travail)
@@ -374,33 +374,15 @@
sub keepLog
{
- my ($Startstop,$X,$Y,$Zoom,$Layers) = @_;
+ my ($Process,$Action,$Message) = @_;
my $Config = $main::Config;
my $logFile = $Config->get("ProcessLogFile");
- if ($Startstop eq "start")
- {
- open(my $fpLog, ">>$logFile");
- if ($fpLog) {
- print $fpLog time()." Begin tile x=$X y=$Y at zoom=$Zoom for layers $Layers\n";
- close $fpLog;
- }
-
+ open(my $fpLog, ">>$logFile");
+ if ($fpLog) {
+ print $fpLog time()." [".$Config->get("ClientVersion")."] $Process $Action $Message\n";
+ close $fpLog;
}
- elsif ($Startstop eq "stop")
- {
- open(my $fpLog, ">>$logFile");
- if ($fpLog)
- {
- print $fpLog time()." End tile x=$X y=$Y at zoom=$Zoom for layers $Layers\n";
- close $fpLog;
- }
- }
- else
- {
- print STDERR "\nstart or end of tile not specified, not logging.\n";
- return 0;
- }
}
#-----------------------------------------------------------------------------
_______________________________________________
Tilesathome mailing list
[email protected]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/tilesathome