Scheduler: new plugin cs_plugin_monitor

162 views
Skip to first unread message

Niphlod

unread,
Feb 23, 2013, 1:11:19 PM2/23/13
to web...@googlegroups.com
Hi all,
   here there's the first implementation of a monitoring plugin for the embedded scheduler.
Shouldn't break anything but at least for the moment do not use in production, it's in alpha stage.

Please test it and report back bugs or new ideas.

Massimo Di Pierro

unread,
Feb 23, 2013, 3:51:36 PM2/23/13
to web...@googlegroups.com
no screenshots? ;-)

niphlod

unread,
Feb 23, 2013, 4:17:22 PM2/23/13
to web...@googlegroups.com

Not until beta at least...
Graphs need a better look :-P

Niphlod

unread,
Feb 24, 2013, 8:28:11 AM2/24/13
to web...@googlegroups.com

Massimo Di Pierro

unread,
Feb 24, 2013, 9:34:03 AM2/24/13
to web...@googlegroups.com
I think this plugin should ship with web2py. ;-)

Paolo valleri

unread,
Feb 25, 2013, 11:33:07 AM2/25/13
to web...@googlegroups.com
Really nice job, +1 for shipping this with web2py.
paolo

Niphlod

unread,
Feb 28, 2013, 4:57:40 PM2/28/13
to web...@googlegroups.com
plugin just got beta status.
I'd gladly take patches for:
- a nicer layout ?
- removing all the javascript in template views and consolidate it in a separate js file

As always, testers are more than welcome.

Paolo valleri

unread,
Mar 15, 2013, 6:14:46 AM3/15/13
to web...@googlegroups.com
Hi, 
I have in plan to use it in a future project, today a started a very easy app but I ended up in the error: 'database is locked'.
The tests were done by using sqlite. What is wrong in my app? Please find attached the example test
The ticket:
Traceback (most recent call last):
 
File "/home/pvalleri/src/web2py/gluon/restricted.py", line 212, in restricted
   
exec ccode in environment
 
File "/home/pvalleri/src/web2py/applications/scapp/models/scheduler.py", line 31, in <module>
   
scheduler.queue_task(test_rest, period=10, repeats=0)
 
File "/home/pvalleri/src/web2py/gluon/scheduler.py", line 959, in queue_task
   
**kwargs)
 
File "/home/pvalleri/src/web2py/gluon/dal.py", line 8460, in validate_and_insert
   
response.id = self.insert(**new_fields)
 
File "/home/pvalleri/src/web2py/gluon/dal.py", line 8443, in insert
    ret
=  self._db._adapter.insert(self, self._listify(fields))
 
File "/home/pvalleri/src/web2py/gluon/dal.py", line 1201, in insert
   
raise e
OperationalError: database is locked


Paolo
scheduler.py

Niphlod

unread,
Mar 15, 2013, 6:29:26 AM3/15/13
to web...@googlegroups.com
maybe the fact that you're using sqlite :D
If you have a recent sqlite distribution activate the WAL, it can zero out the issues for normal loads (usually also for low loads SQLite ends up locked)
Jokes aside, that's why I implemented multiple queries as regroupings in python, to alleviate db pressure on "normal" db and to see if sqlite can cope with it.
Where are you seeing this error?
If you were on the main page, did you try turning the autorefresh off ?
Did you try increasing the cache time ?
and setting GROUPING_MODE to python instead of database ?

PS: you did not used this as a model, right ? it queues a new task at every request in that case....

Paolo valleri

unread,
Mar 16, 2013, 3:16:38 AM3/16/13
to web...@googlegroups.com
Hi Niphlod, 
I am thinking that I do misunderstood the book because I put  this line
scheduler.queue_task(test_rest, period=10, repeats=0)
in a model file, this means that I have re-scheduled my task times and times! 
Btw, which should be the best place to add a new task (beside using your plugin!)?

Paolo

Niphlod

unread,
Mar 16, 2013, 4:06:13 AM3/16/13
to web...@googlegroups.com
you should insert a new task if it's "connected" to an event in a controller. If you need to queue a recurring task one-time-only and is not controlled by some logic in your app, you should insert it using the appadmin ....

dlypka

unread,
Mar 16, 2013, 11:13:48 AM3/16/13
to web...@googlegroups.com
Is there a way to stretch (resize) each column? I also suggest using jqgrid, from plugin_wiki I suppose.
jqgrid also can do tree-style parent-child expandable subrows which would be very nice to have.
A row with a tree style plus sign would indicate the task finished (a child task_run row is available).

I rolled my own status view recently using SolidTable, but I plan to change to jqgrid.  

I'll post something when I can.

Niphlod

unread,
Mar 16, 2013, 11:39:33 AM3/16/13
to web...@googlegroups.com
nope.... Used jqgrid in the past and it's kind of a beast, but .....to be totally fair, resizing columns on a table doesn't play very well with touch devices .
Which column would you like to be resizable ?


PS: a task can be completed and have no scheduler_run rows available cause the function didn't return any value (or because the scheduler was set to discard return values)

PS2: When you can, share your code, if it's more usable I'll adopt it in the plugin happily.

David Lypka

unread,
Mar 16, 2013, 11:47:03 AM3/16/13
to web...@googlegroups.com
In my case, the result / return value columns need to be resizeable.


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/FF2g_6qhxDs/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

David Lypka

unread,
Mar 16, 2013, 11:48:52 AM3/16/13
to web...@googlegroups.com
actually, scrollable at a minimum requirement.

On Sat, Mar 16, 2013 at 10:39 AM, Niphlod <nip...@gmail.com> wrote:
--

Niphlod

unread,
Mar 16, 2013, 11:53:04 AM3/16/13
to web...@googlegroups.com
uhm. can you send me a screenshot to identify the problem "in a visual way" ?
if row_result is large I surely can't help (nor would any kind of "inline representation") but maybe with a tooltip we can circumvent the issue.

David Lypka

unread,
Mar 16, 2013, 12:00:21 PM3/16/13
to web...@googlegroups.com
I could use an outer join or some custom code to handle the no child row case.

In my SolidTable view I simply display 2 tables. The first one is just the first task table
and the second is just the inner join.  It is adequate for the time being...

My scheduled task executes a unix shell script and returns roughly a 2K character message.

By the way, I cannot get it to breakpoint in the task function under WING IDE.

Which debuggers if any are known to be able to do it?

Niphlod

unread,
Mar 16, 2013, 12:06:38 PM3/16/13
to web...@googlegroups.com
and you need to read on the screen a row with 2k characters (supposedly a lot of rows on the same page) ?
cs_monitor is more meant to monitor the workers "administratively", not to show their results, the plugin can be "eased" for sure but it can't be a solution for all kinds of requirements. 

David Lypka

unread,
Mar 16, 2013, 12:11:06 PM3/16/13
to web...@googlegroups.com
How to breakpoint in the task?

Niphlod

unread,
Mar 16, 2013, 12:25:14 PM3/16/13
to web...@googlegroups.com

Andrey K

unread,
Mar 4, 2014, 2:11:15 AM3/4/14
to web...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages