Giter VIP home page Giter VIP logo

cs_monitor_plugin's Introduction

ComfortScheduler Monitor

Since Web2py had its own scheduler, too many peoples asked for an embedded monitoring solution. ComfortScheduler it's just my way of defining it. It bakes a lot of features and relies on a RDBMS, which most of web apps have anyway in their stack.
Right now the plugin scans the scheduler's tables, and it's a first step towards a more "precise" analyzing solution. Please try it and report back your findings.

INSTRUCTIONS:

  • download it and merge with your app's code

  • no cache is used ATM, but I'm planning to use that to avoid db pressure. Change in controllers/plugin_cs_monitor.py the lines

    sc_cache = cache.ram
    GROUPING_MODE = 'database' # or 'python'
    ANALYZE_CACHE_TIME = 60
    TASKS_SUMMARY_CACHE_TIME = 10

    to match your preferences

    sc_cache = cache.ram #your cache backend
    GROUPING_MODE = 'database' # or 'python', to save the db from some heavy queries
    ANALYZE_CACHE_TIME = 60 #how many seconds cache the queries done to analyze the task
    TASKS_SUMMARY_CACHE_TIME = 10 #how many seconds cache the queries for the task summary on the index page
  • the index() function is just a placeholder, every URL is generated with user_signature, so change the permission according to your requirements only in the index() function.

    @auth.requires_login()
    def index():
        return dict()

    e.g to

    @auth.requires_membership('superadministrators')
    def index():
        return dict()

TODO:

  • Groupings can be done in python too, to avoid db pressure
  • analyze_task works scanning scheduler_run results. It should detect automatically if no runs are there and switch groupings.
  • add REST interface ?

cs_monitor_plugin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cs_monitor_plugin's Issues

Elapsed time in tast_details

In the table 'run_details' I would add the elapsed time a task have spent to be executed.
If you agree I will make a PR

local variable 'status' referenced before assignment

Hi, I think you have to replace status with 'status' in line plugin_cs_monitor.py:382

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/controllers/plugin_cs_monitor.py", line 604, in <module>
  File "/home/pvalleri/src/web2py/gluon/globals.py", line 194, in <lambda>
    self._caller = lambda f: f()
  File "/home/pvalleri/src/web2py/gluon/tools.py", line 2971, in f
    return action(*a, **b)
  File "/home/pvalleri/src/web2py/applications/scapp/controllers/plugin_cs_monitor.py", line 557, in analyze_task
    gb_when_rows, jgb_when_series = bydate(q, mode)
  File "/home/pvalleri/src/web2py/applications/scapp/controllers/plugin_cs_monitor.py", line 382, in bydate
    if status not in gb_when_series:
UnboundLocalError: local variable 'status' referenced before assignment

name 'prettydate' is not defined

I've just got this ticket:

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 220, in restricted
    exec ccode in environment
  File "/home/www-data/web2py.git/applications/vtraffic/views/plugin_cs_monitor/analyze_task.html", line 125, in <module>
    series: series
NameError: name 'prettydate' is not defined

Create task from homepage

Hi, I would like to have the possibility to create a task from the first page too.
Right now, visiting application/plugin_cs_monitor/index I haven't found a way to create a task from the web-interface. The user has to write the code to schedule the task programmatically.

Fix Readme to show how to use it

Hi! I'm interested on trying this plugin but, i hardly understand how plugins work on web2py and I have not been able to use it (only install it for which instructions are quite clear imho).

License

I couldn't find out the license for this plugin.
I would plan to use it in a project

Calendar view

It would be nice to see repetitive tasks shown in a calendar. I don't know how that can be difficult (right now I am thinking about full calendar).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.