Hi Edgar

Well, if it works, and you get the right numbers, then it is probably correct....

It is difficult to identify your changes, but I can show you what I have done in order to get all the options to work with our MySQL database. I hope I refer to the same lines in 'jobs.py', don't I?


I replaced this line:

jobs_in_error_by_month = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),

with:

jobs_in_error_by_month = sa.select( ( sa.func.date( sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),

and:

group_by=[ sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ) ],

with:

group_by = [ sa.func.year( model.Job.table.c.create_time), sa.func.month(sa.func.date( model.Job.table.c.create_time ) ) ],



Hope this helps, Hans-Rudolf

PS: Is it already too late (i.e too much data in your MySQL databadse)
    to switch to PostgreSQL?



On 02/05/2015 03:49 PM, Fernandez Edgar wrote:
Hello guys,

So I’ve been working on the Galaxy report page.

It works fine however I’m using MySQL and I’m getting some server errors
on some webpages.

I found the solution:
https://lists.galaxyproject.org/pipermail/galaxy-dev/2009-August/000641.html

But can some please confirm the following:

1.The location of the files users.py and jobs.py is
/home/galaxy/galaxy-prod/lib/galaxy/webapps/reports/controllers

2.There is three (3) "select closes" using five (5) "date_trunc"
functions in users.py.

3.There is eight (8) "select closes" using fourteen (4) "date_trunc"
functions in jobs.py.

4.Here is an example of what I can come up with. Is it correct?

·WRONG:

jobs_in_error_by_month = sa.select( ( sa.func.date_trunc( 'month',
sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.count( model.Job.table.c.id ).label('total_jobs' ) ),

whereclause=sa.and_ ( model.Job.table.c.state == 'error',

model.Job.table.c.user_id != monitor_user_id ),

from_obj=[ model.Job.table ],

group_by=[ sa.func.date_trunc( 'month', sa.func.date(
model.Job.table.c.create_time ) ) ],

order_by=[ sa.desc( 'date' ) ] )

·RIGHT:

jobs_in_error_by_month = sa.select( ( sa.func.count(
model.Job.table.c.id ).label('total_jobs' ) ),

whereclause=sa.and_ ( model.Job.table.c.state == 'error',

model.Job.table.c.user_id != monitor_user_id ),

from_obj=[ model.Job.table ],

group_by=[ day(model.Job.table.c.create_time),
month(model.Job.table.c.create_time), year(model.Job.table.c.create_time) ],

order_by=[ sa.desc( 'date' ) ] )

Cordialement / Regards,

**

*Edgar Fernandez*

System Administrator (Linux)

Direction Générale des Technologies de l'Information et de la Communication

(  Bur. : *1-514-343-6111 poste 16568**//*

*//*

*/Université de Montréal/**//*

PAVILLON ROGER-GAUDRY, bureau X-218



___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
   https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
   http://galaxyproject.org/search/mailinglists/

___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
 https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
 http://galaxyproject.org/search/mailinglists/

Reply via email to