LP#1492793: teach Clark Kent to set the Pg app name
authorGalen Charlton <gmc@esilibrary.com>
Tue, 16 Feb 2016 20:36:26 +0000 (15:36 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 2 Mar 2016 20:58:31 +0000 (15:58 -0500)
commitefb194d70a1560f436e328f35924df0be52e2431
treee2f4d2ea1217fd1d61d94c163a7f345d4c51827e
parentf9421938ec6be6a023fd72b75f052af9c48ae606
LP#1492793: teach Clark Kent to set the Pg app name

Clark Kent can now also use the application_name
setting in the relevant sections of opensrf.xml to
set the Pg application name.

To test:

[1] Apply the patch, restarting opensrf.settings, and
    start Clark.
[2] Run a report that will take at least a minute to
    finish. While it is running, query the pg_stat_activity
    table. There should be at least one row where the
    application_name column is set to 'Clark Kent (reports)'.
[3] Note that since the master Clark process opens a database
    connection, checks whether there are any reports to run,
    then immediately closes the connection, it's unlikely that
    you'll catch a 'Clark Kent (state)' connection when
    querying pg_stat_activity.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/examples/opensrf.xml.example
Open-ILS/src/reporter/clark-kent.pl