The get_routers method in the l3 RPC code has a log.debug
statement that formats all of the router data as indented
JSON. This method can be expensive if there are hundreds
of routers being synced and it happens even if debugging
is disabled since the function call result is the parameter
to the debug statement.
This patch adds and leverages a small helper class that takes a
callable and its args and defers calling it until the __str__ method
is called on it when it's actually trying to be rendered to a string.
Reviewed: https:/ /review. openstack. org/174812 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=649599457e2 9b58ad0aec9ace9 90e0a2b59b05d0
Committed: https:/
Submitter: Jenkins
Branch: master
commit 649599457e29b58 ad0aec9ace990e0 a2b59b05d0
Author: Kevin Benton <email address hidden>
Date: Fri Apr 17 03:53:45 2015 -0700
Defer creation of router JSON in get_routers RPC
The get_routers method in the l3 RPC code has a log.debug
statement that formats all of the router data as indented
JSON. This method can be expensive if there are hundreds
of routers being synced and it happens even if debugging
is disabled since the function call result is the parameter
to the debug statement.
This patch adds and leverages a small helper class that takes a
callable and its args and defers calling it until the __str__ method
is called on it when it's actually trying to be rendered to a string.
Change-Id: I2bfceb286ce30f 2a3595381b62bdc 6dd71ed8483
Partial-Bug: #1445412