LP#1824184: Change potentially slow log statements to subroutines The OpenSRF code was searched for potentially slow logging statements at log level info or above. We then changed those logging statements to be delayed execution subroutines. This is in reaction to LP1823338 where a slow debug logging statement was slowing down SIP checkins even though debug logging was not turned on. Here is some pseudocode that shows what is being done here: $log->debug("Some text " . $some->slow_method); would be changed to: $log->debug(sub{return "Some text " . $some->slow_method }); With this change, an unnamed sub is passed to the OpenSRF logger module and it will not be executed unless the global logging level is set to debug or higher (the slow_method will not be called unless it is needed for that logging level). ******** If/when this is committed, please use delayed execution subroutines for any logging statements that could be slow in the future. It is recommend that any logging statements that do not consist entirely of quoted text and/or already available scalar variables use delayed execution subroutines. ******** Testing notes ------------- [1] This patch reduced the duration of open-ils.storage.actor.user.total_owed calls on a test system from an average of 0.13 seconds to an overage of 0.009 seconds. [2] It didn't materially affect the duration of calls to open-ils.actor.user.opac.vital_stats. [3] This make sense: open-ils.storage has far more generated methods than open-ils.actor. [4] There are enough instances in Evergreen of using method_lookup to find routines in open-ils.storage that the speed improvement may well be perceptible to humans, not just SIP sorters. Signed-off-by: John Merriam <jmerriam@biblio.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP#1762815 Empty client TZ defaults to server TZ (Perl) Fixes an issue in the Perl client time zone handling that resulted in the server defaulting to UTC time instead of the server time zone when no time zone value was received from the client. Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com>
LP#1485371: Use client-supplied TZ Currently, there is no protocol-level mechanism for passing the client's desired timezone to the server. In much the same way we pass the locale, we can let the server know what timezone it should use when interpreting time stamps. To do this we: * Teach perl server code to live in the client TZ, if supplied * Teach perl client code to send the current $ENV{TZ} * Teach javascript library to include client TZ in gateway/translator/websocket communication * Teach C code to pull the incoming TZ and apply it to outgoing messages * Teach srfsh to pull TZ from the environment and pass it with requests Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Perl libs for OpenSRF ingress tracking Ingress is a free-form text value which represents the entry point for the client into the opensrf network. The value is passed within opensrf messages, similar to "locale". Clients should specify the ingress before any opensrf communication occurs. OpenSRF::AppSession->ingress($ingress); Stock values include the following: opensrf (default) srfsh translator-v1 gateway-v1 Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
method prettyJSON doesnt exist anymore git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1751 9efc2488-bf62-4759-914b-345cdb29e865
flush_socket now flushes data through the xml stream parser to prevent the destorying the validity of the stream. now discarding RESULT messages passed to server sessions. git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1712 9efc2488-bf62-4759-914b-345cdb29e865
merging perl CPANification/normalization branch work git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1418 9efc2488-bf62-4759-914b-345cdb29e865