Dump Scheduler

Discussion in 'Plugin Development' started by xeology, Apr 25, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    xeology

    Is there a way to dump the scheduler? If not is there a way to see what is in the schedulers queue and determine what their ID and owners plugin is?

    I am attempting to make a plugin that locates bulky or clogged scheduled events considering that with my latest plugin I noticed that anything that relies on the scheduler on my server lags, which in turn lags the server, thinking its some little devil plugin with a huge piece of code on a short repeating schedule >.<
     
  2. Offline

    mindless728

    have you tried to pin down which plugin that might be causing this?
     
  3. Offline

    xeology

    Thats the thing. It is very hard to tell, all I know is logblock ends up with an insane queue and my plugin tends to take 4-5 times the expected time so it is definitely something using the scheduler and I cant put my users through constant restarts to identify it via swapping in and out plugins. Was hoping for a way to program up something that pulls all the queues and lists what tasks there are and print it out to the console and then checks to see which are still running after 5 seconds so i can for sure know what it is.
     
  4. Offline

    Raphfrk

    Phew, thought you meant "get rid of scheduler" :).

    The scheduler queue is called schedulerQueue. This contains a list of all non-running tasks, but it is set to private.

    There is an isQueued() method. In theory, you could run thought all ids up to a certain number, but that will probably lag the server itself.

    You can unqueue all tasks from a particular plugin using the cancelTasks(Plugin) method.

    That might help. This won't kill async tasks from other threads though. It interrupts those threads, but unless the plugin supports it, those threads are unlikely to actually stop.
     
  5. Offline

    xeology

    Thanks but i figured it out the old fashioned way. iConomy was lagging me to nether and back. Next project . . . essentials-eco bridge for iConomy.
     
Thread Status:
Not open for further replies.

Share This Page