galaxy report page - server error solution?

classic Classic list List threaded Threaded
7 messages Options
| Threaded
Open this post in threaded view
|

galaxy report page - server error solution?

fernandez Edgar

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/
| Threaded
Open this post in threaded view
|

Re: galaxy report page - server error solution?

fernandez Edgar

Actually, here’s what I came up with :

 

diff users.py ARCHIVES/users.py_20150205_9.28.18

23c23

<         q = sa.select( ( sa.func.date( galaxy.model.User.table.c.create_time ).label( 'date' ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.User.table.c.create_time ) ).label( 'date' ),

26c26

<                        group_by = [ sa.func.year ( galaxy.model.User.table.c.create_time ), sa.func.month ( galaxy.model.User.table.c.create_time ) ],

---

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

48c48

<         q = sa.select( ( sa.func.date( galaxy.model.User.table.c.create_time ).label( 'date' ),

---

>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date( galaxy.model.User.table.c.create_time ) ).label( 'date' ),

53c53

<                        group_by = [ sa.func.day( sa.func.date( galaxy.model.User.table.c.create_time ) ) ],

---

>                        group_by = [ sa.func.date_trunc( 'day', sa.func.date( galaxy.model.User.table.c.create_time ) ) ],

79c79

<         q = sa.select( ( sa.func.date( galaxy.model.User.table.c.create_time ).label( 'date' ),

---

>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date( galaxy.model.User.table.c.create_time ) ).label( 'date' ),

 

 

 

diff jobs.py ARCHIVES/jobs.py_20150205_9.28.22

282c282

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

---

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

315c315

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

---

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

320c320

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

---

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

364c364

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

---

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

371c371

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

---

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

420c420

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

---

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

425c425

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

---

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

 

 

Let me know what you think!!!

 

Cordialement / Regards,

Edgar Fernandez

 

De : Fernandez Edgar
Envoyé : February-05-15 9:49 AM
À : '[hidden email]'
Objet : galaxy report page - server error solution?

 

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/
| Threaded
Open this post in threaded view
|

Re: galaxy report page - server error solution?

Hans-Rudolf Hotz
In reply to this post by fernandez Edgar
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/
| Threaded
Open this post in threaded view
|

Re: galaxy report page - server error solution?

Hans-Rudolf Hotz
In reply to this post by fernandez Edgar
Hi again

for "jobs.py" I have modified the same lines as you,
               plus line 285 (group_by....)

for "users.py I have modified the same lines as you


Hans-Rudolf



On 02/05/2015 04:20 PM, Fernandez Edgar wrote:

> Actually, here’s what I came up with :
>
> diff users.py ARCHIVES/users.py_20150205_9.28.18
>
> 23c23
>
> <         q = sa.select( ( sa.func.date(
> galaxy.model.User.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.User.table.c.create_time ) ).label( 'date' ),
>
> 26c26
>
> <                        group_by = [ sa.func.year (
> galaxy.model.User.table.c.create_time ), sa.func.month (
> galaxy.model.User.table.c.create_time ) ],
>
> ---
>
>>                        group_by = [ sa.func.date_trunc( 'month', sa.func.date( galaxy.model.User.table.c.create_time ) ) ],
>
> 48c48
>
> <         q = sa.select( ( sa.func.date(
> galaxy.model.User.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date( galaxy.model.User.table.c.create_time ) ).label( 'date' ),
>
> 53c53
>
> <                        group_by = [ sa.func.day( sa.func.date(
> galaxy.model.User.table.c.create_time ) ) ],
>
> ---
>
>>                        group_by = [ sa.func.date_trunc( 'day', sa.func.date( galaxy.model.User.table.c.create_time ) ) ],
>
> 79c79
>
> <         q = sa.select( ( sa.func.date(
> galaxy.model.User.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date( galaxy.model.User.table.c.create_time ) ).label( 'date' ),
>
> diff jobs.py ARCHIVES/jobs.py_20150205_9.28.22
>
> 282c282
>
> <         jobs_by_month = sa.select( ( sa.func.date(
> model.Job.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         jobs_by_month = sa.select( ( sa.func.date_trunc( 'month', model.Job.table.c.create_time ).label( 'date' ),
>
> 315c315
>
> <         jobs_in_error_by_month = sa.select( ( sa.func.date(
> model.Job.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         jobs_in_error_by_month = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),
>
> 320c320
>
> <                                            group_by=[ sa.func.year (
> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(
> model.Job.table.c.create_time ) ) ],
>
> ---
>
>>                                            group_by=[ sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ) ],
>
> 364c364
>
> <         q = sa.select( ( sa.func.date( model.Job.table.c.create_time
> ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),
>
> 371c371
>
> <                        group_by=[ sa.func.year (
> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(
> model.Job.table.c.create_time ) ) ],
>
> ---
>
>>                        group_by=[ sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ) ],
>
> 420c420
>
> <         q = sa.select( ( sa.func.date( model.Job.table.c.create_time
> ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),
>
> 425c425
>
> <                        group_by=[ sa.func.year (
> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(
> model.Job.table.c.create_time ) ) ],
>
> ---
>
>>                        group_by=[ sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ) ],
>
> Let me know what you think!!!
>
> Cordialement / Regards,
>
> Edgar Fernandez
>
> *De :*Fernandez Edgar
> *Envoyé :* February-05-15 9:49 AM
> *À :* '[hidden email]'
> *Objet :* galaxy report page - server error solution?
>
> 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/
| Threaded
Open this post in threaded view
|

Re: galaxy report page - server error solution?

fernandez Edgar
Good catch on that one!
There wasn't originally the date_trunc function there but that groups the jobs by months together.
Thanks!!!

Cordialement / Regards,
Edgar Fernandez

-----Message d'origine-----
De : Hans-Rudolf Hotz [mailto:[hidden email]]
Envoyé : February-05-15 10:49 AM
À : Fernandez Edgar; [hidden email]
Objet : Re: [galaxy-dev] galaxy report page - server error solution?

Hi again

for "jobs.py" I have modified the same lines as you,
               plus line 285 (group_by....)

for "users.py I have modified the same lines as you


Hans-Rudolf



On 02/05/2015 04:20 PM, Fernandez Edgar wrote:

> Actually, here’s what I came up with :
>
> diff users.py ARCHIVES/users.py_20150205_9.28.18
>
> 23c23
>
> <         q = sa.select( ( sa.func.date(
> galaxy.model.User.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(
>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),
>
> 26c26
>
> <                        group_by = [ sa.func.year (
> galaxy.model.User.table.c.create_time ), sa.func.month (
> galaxy.model.User.table.c.create_time ) ],
>
> ---
>
>>                        group_by = [ sa.func.date_trunc( 'month',
>> sa.func.date( galaxy.model.User.table.c.create_time ) ) ],
>
> 48c48
>
> <         q = sa.select( ( sa.func.date(
> galaxy.model.User.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date(
>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),
>
> 53c53
>
> <                        group_by = [ sa.func.day( sa.func.date(
> galaxy.model.User.table.c.create_time ) ) ],
>
> ---
>
>>                        group_by = [ sa.func.date_trunc( 'day',
>> sa.func.date( galaxy.model.User.table.c.create_time ) ) ],
>
> 79c79
>
> <         q = sa.select( ( sa.func.date(
> galaxy.model.User.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date(
>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),
>
> diff jobs.py ARCHIVES/jobs.py_20150205_9.28.22
>
> 282c282
>
> <         jobs_by_month = sa.select( ( sa.func.date(
> model.Job.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         jobs_by_month = sa.select( ( sa.func.date_trunc( 'month',
>> model.Job.table.c.create_time ).label( 'date' ),
>
> 315c315
>
> <         jobs_in_error_by_month = sa.select( ( sa.func.date(
> model.Job.table.c.create_time ).label( 'date' ),
>
> ---
>
>>         jobs_in_error_by_month = sa.select( ( sa.func.date_trunc(
>> 'month', sa.func.date( model.Job.table.c.create_time ) ).label(
>> 'date' ),
>
> 320c320
>
> <                                            group_by=[ sa.func.year (
> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(
> model.Job.table.c.create_time ) ) ],
>
> ---
>
>>                                            group_by=[
>> sa.func.date_trunc( 'month', sa.func.date(
>> model.Job.table.c.create_time ) ) ],
>
> 364c364
>
> <         q = sa.select( ( sa.func.date( model.Job.table.c.create_time
> ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(
>> model.Job.table.c.create_time ) ).label( 'date' ),
>
> 371c371
>
> <                        group_by=[ sa.func.year (
> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(
> model.Job.table.c.create_time ) ) ],
>
> ---
>
>>                        group_by=[ sa.func.date_trunc( 'month',
>> sa.func.date( model.Job.table.c.create_time ) ) ],
>
> 420c420
>
> <         q = sa.select( ( sa.func.date( model.Job.table.c.create_time
> ).label( 'date' ),
>
> ---
>
>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(
>> model.Job.table.c.create_time ) ).label( 'date' ),
>
> 425c425
>
> <                        group_by=[ sa.func.year (
> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(
> model.Job.table.c.create_time ) ) ],
>
> ---
>
>>                        group_by=[ sa.func.date_trunc( 'month',
>> sa.func.date( model.Job.table.c.create_time ) ) ],
>
> Let me know what you think!!!
>
> Cordialement / Regards,
>
> Edgar Fernandez
>
> *De :*Fernandez Edgar
> *Envoyé :* February-05-15 9:49 AM
> *À :* '[hidden email]'
> *Objet :* galaxy report page - server error solution?
>
> 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/00064
> 1.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/
| Threaded
Open this post in threaded view
|

Re: galaxy report page - server error solution?

fernandez Edgar
In reply to this post by Hans-Rudolf Hotz

Here’s some other modifications I’ve made that should be logged somewhere :

 

diff workflows.py ARCHIVES/workflows.py_20150205_11.37.57

143c143

<         q = sa.select( ( sa.func.date( model.StoredWorkflow.table.c.create_time ).label( 'date' ),sa.func.count( model.StoredWorkflow.table.c.id ).label( 'total_workflows' ) ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.StoredWorkflow.table.c.create_time ) ).label( 'date' ),sa.func.count( model.StoredWorkflow.table.c.id ).label( 'total_workflows' ) ),

145c145

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

---

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

177c177

<         q = sa.select( ( sa.func.date( model.StoredWorkflow.table.c.create_time ).label( 'date' ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.StoredWorkflow.table.c.create_time ) ).label( 'date' ),

181c181

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

---

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

 

 

diff sample_tracking.py ARCHIVES/sample_tracking.py_20150205_11.37.50

136c136

<         q = sa.select( ( sa.func.date( model.Request.table.c.create_time ).label( 'date' ),sa.func.count( model.Request.table.c.id ).label( 'total' ) ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Request.table.c.create_time ) ).label( 'date' ),sa.func.count( model.Request.table.c.id ).label( 'total' ) ),

138c138

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

---

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

169c169

<         q = sa.select( ( sa.func.date( model.Request.table.c.create_time ).label( 'date' ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Request.table.c.create_time ) ).label( 'date' ),

173c173

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

---

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

 

 

 

Cordialement / Regards,

Edgar Fernandez

 

 

-----Message d'origine-----
De : Fernandez Edgar
Envoyé : February-05-15 10:55 AM
À : 'Hans-Rudolf Hotz'; [hidden email]
Objet : RE: [galaxy-dev] galaxy report page - server error solution?

 

Good catch on that one!

There wasn't originally the date_trunc function there but that groups the jobs by months together.

Thanks!!!

 

Cordialement / Regards,

Edgar Fernandez

 

-----Message d'origine-----

De : Hans-Rudolf Hotz [[hidden email]] Envoyé : February-05-15 10:49 AM À : Fernandez Edgar; [hidden email] Objet : Re: [galaxy-dev] galaxy report page - server error solution?

 

Hi again

 

for "jobs.py" I have modified the same lines as you,

               plus line 285 (group_by....)

 

for "users.py I have modified the same lines as you

 

 

Hans-Rudolf

 

 

 

On 02/05/2015 04:20 PM, Fernandez Edgar wrote:

> Actually, here’s what I came up with :

> 

> diff users.py ARCHIVES/users.py_20150205_9.28.18

> 

> 23c23

> 

> <         q = sa.select( ( sa.func.date(

> galaxy.model.User.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(

>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),

> 

> 26c26

> 

> <                        group_by = [ sa.func.year (

> galaxy.model.User.table.c.create_time ), sa.func.month (

> galaxy.model.User.table.c.create_time ) ],

> 

> ---

> 

>>                        group_by = [ sa.func.date_trunc( 'month',

>> sa.func.date( galaxy.model.User.table.c.create_time ) ) ],

> 

> 48c48

> 

> <         q = sa.select( ( sa.func.date(

> galaxy.model.User.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date(

>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),

> 

> 53c53

> 

> <                        group_by = [ sa.func.day( sa.func.date(

> galaxy.model.User.table.c.create_time ) ) ],

> 

> ---

> 

>>                        group_by = [ sa.func.date_trunc( 'day',

>> sa.func.date( galaxy.model.User.table.c.create_time ) ) ],

> 

> 79c79

> 

> <         q = sa.select( ( sa.func.date(

> galaxy.model.User.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date(

>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),

> 

> diff jobs.py ARCHIVES/jobs.py_20150205_9.28.22

> 

> 282c282

> 

> <         jobs_by_month = sa.select( ( sa.func.date(

> model.Job.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         jobs_by_month = sa.select( ( sa.func.date_trunc( 'month',

>> model.Job.table.c.create_time ).label( 'date' ),

> 

> 315c315

> 

> <         jobs_in_error_by_month = sa.select( ( sa.func.date(

> model.Job.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         jobs_in_error_by_month = sa.select( ( sa.func.date_trunc(

>> 'month', sa.func.date( model.Job.table.c.create_time ) ).label(

>> 'date' ),

> 

> 320c320

> 

> <                                            group_by=[ sa.func.year (

> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(

> model.Job.table.c.create_time ) ) ],

> 

> ---

> 

>>                                            group_by=[

>> sa.func.date_trunc( 'month', sa.func.date(

>> model.Job.table.c.create_time ) ) ],

> 

> 364c364

> 

> <         q = sa.select( ( sa.func.date( model.Job.table.c.create_time

> ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(

>> model.Job.table.c.create_time ) ).label( 'date' ),

> 

> 371c371

> 

> <                        group_by=[ sa.func.year (

> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(

> model.Job.table.c.create_time ) ) ],

> 

> ---

> 

>>                        group_by=[ sa.func.date_trunc( 'month',

>> sa.func.date( model.Job.table.c.create_time ) ) ],

> 

> 420c420

> 

> <         q = sa.select( ( sa.func.date( model.Job.table.c.create_time

> ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(

>> model.Job.table.c.create_time ) ).label( 'date' ),

> 

> 425c425

> 

> <                        group_by=[ sa.func.year (

> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(

> model.Job.table.c.create_time ) ) ],

> 

> ---

> 

>>                        group_by=[ sa.func.date_trunc( 'month',

>> sa.func.date( model.Job.table.c.create_time ) ) ],

> 

> Let me know what you think!!!

> 

> Cordialement / Regards,

> 

> Edgar Fernandez

> 

> *De :*Fernandez Edgar

> *Envoyé :* February-05-15 9:49 AM

> *À :* '[hidden email]'

> *Objet :* galaxy report page - server error solution?

> 

> 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/00064

> 1.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/
| Threaded
Open this post in threaded view
|

Re: galaxy report page - server error solution?

John Chilton-4
Hey Guys,

  Thanks for the patches - it looks like Eric Enns came up with similar ones a while back (http://dev.list.galaxyproject.org/Patch-in-reference-to-trello-card-968-td4660438.html). The bad news is I just went through and made a bunch PEP-8 fixes to the reports code so all the patches are potentially invalid now - the good news is I followed up with an alternative fix that should maintain the current behavior for postgres but also work with MySQL based on your patches (https://bitbucket.org/galaxy/galaxy-central/commits/ce2776f88e9db53886b8879a948b19ce2a513835) - so hopefully Galaxy will work without modification with the next release (March I suppose).

Thanks again!

-John

P.S. Like Hans said though - if you can migrate Galaxy off MySQL take the opportunity to do so though.


On Thu, Feb 5, 2015 at 12:00 PM, Fernandez Edgar <[hidden email]> wrote:

Here’s some other modifications I’ve made that should be logged somewhere :

 

diff workflows.py ARCHIVES/workflows.py_20150205_11.37.57

143c143

<         q = sa.select( ( sa.func.date( model.StoredWorkflow.table.c.create_time ).label( 'date' ),sa.func.count( model.StoredWorkflow.table.c.id ).label( 'total_workflows' ) ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.StoredWorkflow.table.c.create_time ) ).label( 'date' ),sa.func.count( model.StoredWorkflow.table.c.id ).label( 'total_workflows' ) ),

145c145

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

---

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

177c177

<         q = sa.select( ( sa.func.date( model.StoredWorkflow.table.c.create_time ).label( 'date' ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.StoredWorkflow.table.c.create_time ) ).label( 'date' ),

181c181

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

---

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

 

 

diff sample_tracking.py ARCHIVES/sample_tracking.py_20150205_11.37.50

136c136

<         q = sa.select( ( sa.func.date( model.Request.table.c.create_time ).label( 'date' ),sa.func.count( model.Request.table.c.id ).label( 'total' ) ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Request.table.c.create_time ) ).label( 'date' ),sa.func.count( model.Request.table.c.id ).label( 'total' ) ),

138c138

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

---

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

169c169

<         q = sa.select( ( sa.func.date( model.Request.table.c.create_time ).label( 'date' ),

---

>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Request.table.c.create_time ) ).label( 'date' ),

173c173

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

---

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

 

 

 

Cordialement / Regards,

Edgar Fernandez

 

 

-----Message d'origine-----
De : Fernandez Edgar
Envoyé : February-05-15 10:55 AM
À : 'Hans-Rudolf Hotz'; [hidden email]
Objet : RE: [galaxy-dev] galaxy report page - server error solution?

 

Good catch on that one!

There wasn't originally the date_trunc function there but that groups the jobs by months together.

Thanks!!!

 

Cordialement / Regards,

Edgar Fernandez

 

-----Message d'origine-----

De : Hans-Rudolf Hotz [[hidden email]] Envoyé : February-05-15 10:49 AM À : Fernandez Edgar; [hidden email] Objet : Re: [galaxy-dev] galaxy report page - server error solution?

 

Hi again

 

for "jobs.py" I have modified the same lines as you,

               plus line 285 (group_by....)

 

for "users.py I have modified the same lines as you

 

 

Hans-Rudolf

 

 

 

On 02/05/2015 04:20 PM, Fernandez Edgar wrote:

> Actually, here’s what I came up with :

> 

> diff users.py ARCHIVES/users.py_20150205_9.28.18

> 

> 23c23

> 

> <         q = sa.select( ( sa.func.date(

> galaxy.model.User.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(

>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),

> 

> 26c26

> 

> <                        group_by = [ sa.func.year (

> galaxy.model.User.table.c.create_time ), sa.func.month (

> galaxy.model.User.table.c.create_time ) ],

> 

> ---

> 

>>                        group_by = [ sa.func.date_trunc( 'month',

>> sa.func.date( galaxy.model.User.table.c.create_time ) ) ],

> 

> 48c48

> 

> <         q = sa.select( ( sa.func.date(

> galaxy.model.User.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date(

>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),

> 

> 53c53

> 

> <                        group_by = [ sa.func.day( sa.func.date(

> galaxy.model.User.table.c.create_time ) ) ],

> 

> ---

> 

>>                        group_by = [ sa.func.date_trunc( 'day',

>> sa.func.date( galaxy.model.User.table.c.create_time ) ) ],

> 

> 79c79

> 

> <         q = sa.select( ( sa.func.date(

> galaxy.model.User.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'day', sa.func.date(

>> galaxy.model.User.table.c.create_time ) ).label( 'date' ),

> 

> diff jobs.py ARCHIVES/jobs.py_20150205_9.28.22

> 

> 282c282

> 

> <         jobs_by_month = sa.select( ( sa.func.date(

> model.Job.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         jobs_by_month = sa.select( ( sa.func.date_trunc( 'month',

>> model.Job.table.c.create_time ).label( 'date' ),

> 

> 315c315

> 

> <         jobs_in_error_by_month = sa.select( ( sa.func.date(

> model.Job.table.c.create_time ).label( 'date' ),

> 

> ---

> 

>>         jobs_in_error_by_month = sa.select( ( sa.func.date_trunc(

>> 'month', sa.func.date( model.Job.table.c.create_time ) ).label(

>> 'date' ),

> 

> 320c320

> 

> <                                            group_by=[ sa.func.year (

> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(

> model.Job.table.c.create_time ) ) ],

> 

> ---

> 

>>                                            group_by=[

>> sa.func.date_trunc( 'month', sa.func.date(

>> model.Job.table.c.create_time ) ) ],

> 

> 364c364

> 

> <         q = sa.select( ( sa.func.date( model.Job.table.c.create_time

> ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(

>> model.Job.table.c.create_time ) ).label( 'date' ),

> 

> 371c371

> 

> <                        group_by=[ sa.func.year (

> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(

> model.Job.table.c.create_time ) ) ],

> 

> ---

> 

>>                        group_by=[ sa.func.date_trunc( 'month',

>> sa.func.date( model.Job.table.c.create_time ) ) ],

> 

> 420c420

> 

> <         q = sa.select( ( sa.func.date( model.Job.table.c.create_time

> ).label( 'date' ),

> 

> ---

> 

>>         q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date(

>> model.Job.table.c.create_time ) ).label( 'date' ),

> 

> 425c425

> 

> <                        group_by=[ sa.func.year (

> model.Job.table.c.create_time ), sa.func.month ( sa.func.date(

> model.Job.table.c.create_time ) ) ],

> 

> ---

> 

>>                        group_by=[ sa.func.date_trunc( 'month',

>> sa.func.date( model.Job.table.c.create_time ) ) ],

> 

> Let me know what you think!!!

> 

> Cordialement / Regards,

> 

> Edgar Fernandez

> 

> *De :*Fernandez Edgar

> *Envoyé :* February-05-15 9:49 AM

> *À :* '[hidden email]'

> *Objet :* galaxy report page - server error solution?

> 

> 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/00064

> 1.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. : *<a href="tel:1-514-343-6111" value="+15143436111" target="_blank">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/


___________________________________________________________
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/