Announcement

Collapse
No announcement yet.

python script to execute CacheClearServlet?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • python script to execute CacheClearServlet?

    Hello,

    I would like to invoke the CacheClearServlet from a python script to clear out the rate cache following an automated rate load. Does anyone have a snippet of python code to do this. I have been trying to use urllib2.urlopen() but with no success.

    Is this even possible?

    Any assistance is greatly appreciated.

    Thank you!
    --Richard

  • #2
    Re: python script to execute CacheClearServlet?

    Richard,

    Unfortunately, I don't have a snippet of Python code. I know that we're doing something similar with our monitoring infrastructure, though, as we have it log into OTM and run certain functionality. So - I know it's possible, but not sure of the actual code or how to accomplish in Python.

    --Chris

    Comment


    • #3
      Re: python script to execute CacheClearServlet?

      I picked up this procedure on my way:

      How To Invoke the cache clear servlet automatically
      You can schedule any topic with standard parameter types via the Process Control Manager
      The actual topic class is glog.server.workflow.adhoc.ClearCaches. It takes the following arguments:
      • cache = the name of the cache to clear. If unspecified, clears all caches.
      • zone = the zone of the caches to clear. If unspecified, clears all zones.
      • exactMatch = if true, cache is a single cache. Otherwise, it is a cache prefix.
      • clearRating = if true, the action calls PerfTestActionSessionWrapper.clearAllBusinessCache s(), otherwise it just clears the low-level caches.


      There are two ways to schedule this:
      • Add a record to PROCESS_CONTROL_REQUEST where
      • TOPIC_CLASS_NAME = glog.server.workflow.adhoc.ClearCaches
      • TOPIC_PARAMETERS = -clearRating true
      • NEXT_PROCESS_TIME = GMT time to run

    You can also schedule it as a recurring process
    • Use the expanded process control UI via: glog.webserver.processcontrol.ProcessServlet?userL evel=qa. This will show nearly all topics including Clear Caches. Scroll to the bottom of the topic list and you'll see the topic under Utility.


    There's also a topic to reset rating engine caches, Reset Rate Engine Caches. This maps to glog.server.workflow.utility.ClearRECachesTopic. It's not a generic cache clearer, but may be what you want. It calls
    • RatingEngine.clearRateEngineCaches();
    • BaseOrderBundle.refresh();

    Comment


    • #4
      Re: python script to execute CacheClearServlet?

      Here is a example of using Topic XML that I used to clean Order Release cache.
      Attached Files
      --
      Joseph Liang
      MavenWire APAC
      http://www.mavenwire.com/

      Comment


      • #5
        Re: python script to execute CacheClearServlet?

        Just posted another two approaches in blogs.
        http://www.otmfaq.com/forums/blogs/j...utilities.html
        http://www.otmfaq.com/forums/blogs/j...mlservice.html
        --
        Joseph Liang
        MavenWire APAC
        http://www.mavenwire.com/

        Comment

        • Working...
          X