[csw-devel] SF.net SVN: opencsw:[625] buildfarm/bin/rest-interface/getcatalog
dmichelsen at users.sourceforge.net
dmichelsen at users.sourceforge.net
Fri Sep 21 11:50:56 CEST 2012
Revision: 625
http://opencsw.svn.sourceforge.net/opencsw/?rev=625&view=rev
Author: dmichelsen
Date: 2012-09-21 09:50:56 +0000 (Fri, 21 Sep 2012)
Log Message:
-----------
depgraph-catalog generation: Add monitoring
Modified Paths:
--------------
buildfarm/bin/rest-interface/getcatalog
Modified: buildfarm/bin/rest-interface/getcatalog
===================================================================
--- buildfarm/bin/rest-interface/getcatalog 2012-07-24 02:32:36 UTC (rev 624)
+++ buildfarm/bin/rest-interface/getcatalog 2012-09-21 09:50:56 UTC (rev 625)
@@ -10,6 +10,8 @@
use Parallel::ForkManager;
use LWP::UserAgent;
+my $start = time;
+
my $ua = LWP::UserAgent->new;
$ua->timeout(600);
@@ -57,7 +59,7 @@
# };
-my $pm = new Parallel::ForkManager(10, '/home/web/rest-interface/tmp' );
+my $pm = new Parallel::ForkManager(10, '/home/web/bin/rest-interface/tmp' );
# data structure retrieval and handling
$pm -> run_on_finish ( # called BEFORE the first call to start()
@@ -75,6 +77,8 @@
}
);
+my ($having, $retreiving) = (0, 0);
+
# Retreive the missing data
foreach my $pkg (@$catalog_data) {
my $md5 = $pkg->{md5_sum};
@@ -82,8 +86,10 @@
my $url = "http://buildfarm.opencsw.org/pkgdb/rest/srv4/${md5}/pkg-stats/";
if( exists $md5cache{$md5} ) {
+ $having++;
print "Having $md5\n";
} else {
+ $retreiving++;
$pm->start() and next;
print "Retreiving $md5\n";
@@ -116,3 +122,9 @@
unlink( "catalog" );
link( "catalog.new", "catalog" );
unlink( "catalog.new" );
+
+my $runtime = time - $start;
+
+open S, "| /opt/csw/nagios/bin/send_nsca -H 192.168.1.50 -d ';' -c /etc/opt/csw/nagios/send_nsca.cfg";
+print S "buildfarm.opencsw.org;DEPGRAPH-CATALOG;0;Read $having from cache and retreived $retreiving in $runtime seconds\n";
+close S;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list