aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-07-26 13:45:17 +0000
committerRob Austein <sra@hactrn.net>2012-07-26 13:45:17 +0000
commit06bedea032594f3eae92f3502dfe76195108d19a (patch)
tree5ef3db90d8c93a627400bfb56f116cff1938c319 /rpkid/rpki
parent232f670a7a8109f4a29356ed98aaa7e23a082bb8 (diff)
Add profiling support to yamltest; fix profiling support in daemons.
Tweak yamltest to force one ROA request per prefix regardless of how the user expressed it; we may want to revisit this eventually, but it's more useful this way for now. svn path=/trunk/; revision=4609
Diffstat (limited to 'rpkid/rpki')
-rw-r--r--rpkid/rpki/irdbd.py7
-rw-r--r--rpkid/rpki/left_right.py2
-rw-r--r--rpkid/rpki/pubd.py7
-rw-r--r--rpkid/rpki/rpkid.py7
4 files changed, 19 insertions, 4 deletions
diff --git a/rpkid/rpki/irdbd.py b/rpkid/rpki/irdbd.py
index 60f6a549..a0fc0ec1 100644
--- a/rpkid/rpki/irdbd.py
+++ b/rpkid/rpki/irdbd.py
@@ -174,7 +174,12 @@ class main(object):
if profile:
import cProfile
- cProfile.run("self.main()", profile)
+ prof = cProfile.Profile()
+ try:
+ prof.runcall(self.main)
+ finally:
+ prof.dump_stats(profile)
+ rpki.log.info("Dumped profile data to %s" % profile)
else:
self.main()
diff --git a/rpkid/rpki/left_right.py b/rpkid/rpki/left_right.py
index 04940ca1..122da9d3 100644
--- a/rpkid/rpki/left_right.py
+++ b/rpkid/rpki/left_right.py
@@ -699,7 +699,7 @@ class self_elt(data_elt):
roa = rpki.rpkid.roa_obj(self.gctx, self.self_id, roa_request.asn, roa_request.ipv4, roa_request.ipv6)
rpki.log.debug("Couldn't find existing ROA, created %r" % roa)
if max_new_roas_at_once is not None and publisher.size > max_new_roas_at_once:
- rpki.log.warn("Too many new ROAs (%d) in a single batch, returning early from update_roas() to avoid timeouts" % publisher.size)
+ rpki.log.warn("Too many new ROAs in a single batch, deferring processing some of them")
stopped_early = True
break
else:
diff --git a/rpkid/rpki/pubd.py b/rpkid/rpki/pubd.py
index 0bf811db..7a00c172 100644
--- a/rpkid/rpki/pubd.py
+++ b/rpkid/rpki/pubd.py
@@ -98,7 +98,12 @@ class main(object):
if self.profile:
import cProfile
- cProfile.run("self.main()", self.profile)
+ prof = cProfile.Profile()
+ try:
+ prof.runcall(self.main)
+ finally:
+ prof.dump_stats(self.profile)
+ rpki.log.info("Dumped profile data to %s" % self.profile)
else:
self.main()
diff --git a/rpkid/rpki/rpkid.py b/rpkid/rpki/rpkid.py
index 8c275688..b923b1a3 100644
--- a/rpkid/rpki/rpkid.py
+++ b/rpkid/rpki/rpkid.py
@@ -102,7 +102,12 @@ class main(object):
if self.profile:
import cProfile
- cProfile.run("self.main()", self.profile)
+ prof = cProfile.Profile()
+ try:
+ prof.runcall(self.main)
+ finally:
+ prof.dump_stats(self.profile)
+ rpki.log.info("Dumped profile data to %s" % self.profile)
else:
self.main()