xo::remap_pool (private)

 xo::remap_pool [ -threshold threshold ] [ -except except ] \
    [ -pool pool ] [ -runtime runtime ] method url

Defined in packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl

Function for dynamically managing connection pool mappings. When a connection pool "slow", is defined, and the query took longer than "threshold" seconds, and the URL is not 'except' list, then move this request to the "slow" pool.

Switches:
-threshold (optional, defaults to "3.0")
-except (optional, defaults to "/ /dotlrn/ /dotlrn")
-pool (optional, defaults to "slow")
-runtime (optional)
Parameters:
method (required)
url (required)

Partial Call Graph (max 5 caller/called nodes):
%3 Object ::throttle Object ::throttle (public) xo::remap_pool xo::remap_pool Object ::throttle->xo::remap_pool xo::pool_remap_watchdog xo::pool_remap_watchdog (private) xo::pool_remap_watchdog->xo::remap_pool acs::icanuse acs::icanuse (public) xo::remap_pool->acs::icanuse

Testcases:
No testcase defined.
Source code:
    if {$runtime > $threshold
        && [::acs::icanuse "ns_server unmap"]
        && $pool in [ns_server pools]
        && [ns_server mapped [list $method $url]] eq ""
        && $url ni $except
      } {
      ns_server -pool $pool map -noinherit [list $method $url]
      ns_log notice "slow request: '$url' moved to '$pool' connection pool"

      #
      # In case, we are executing in the throttle monitor thread, call
      # the register unmap function directly, otherwise instruct the
      # monitor thread to do so.
      #
      set prefix [expr {[ns_thread name] eq "::throttle" ? {} : {::throttle do}}]
      {*}$prefix ::throttle_mod::unmap_pool -pool $pool $method $url
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: