Re: [galaxy-dev] User list and disk space?

2011-06-16 Thread Peter Cock
On Thu, Jun 9, 2011 at 4:20 PM, Nate Coraor n...@bx.psu.edu wrote:
 Peter Cock wrote:
 Hi Nate,

 Since you're looking at this kind of thing, would the Saved Histories
 page be worth updating to show the size on disk of each history? As
 a Galaxy user that seems moderately useful - although perhaps more
 of interest to Galaxy admins?

 This is already done in development, I was going to finish up the code
 and commit it within the next couple of weeks.


This has now been committed to galaxy-central, and looks very useful.

I notice the Saved Histories page now has buttons Rename, Delete,
Delete and remove datasets from disk (new) and Undelete. That
distinction between hide it away and really delete should make sense
to users from the Recycle Bin/Trash idea for files on Windows/MacOSX.

Thanks,

Peter

___
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:

  http://lists.bx.psu.edu/

Re: [galaxy-dev] User list and disk space?

2011-06-09 Thread Peter Cock
On Tue, May 17, 2011 at 2:21 PM, Nate Coraor n...@bx.psu.edu wrote:
 Peter Cock wrote:

 That sounds really useful - it is something that you plan on adding
 to Galaxy officially?

 Yes, I'm working on adding a lot of user- and admin- side access to
 various numbers about disk usage (used by histories, used by deleted
 data, etc. and disk quotas.  I hope to have this done shortly after the
 GCC.

 Thanks,
 --nate

Hi Nate,

Since you're looking at this kind of thing, would the Saved Histories
page be worth updating to show the size on disk of each history? As
a Galaxy user that seems moderately useful - although perhaps more
of interest to Galaxy admins?

Peter

___
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:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] User list and disk space?

2011-05-17 Thread Louise-Amelie Schmitt

Thank you so much!!!

It works really fine! I suspected something akin to that but I couldn't 
find the right attributes.


But I still have a question: It comprises the datasets stored in 
libraries right? Is there a way to ignore them?


Thanks again,
L-A


Greg Von Kuster wrote:

Hello Louise,

I've pasted a diff below for the file 
~/lib/galaxy/web/controller/admin.py that will provide what you want, 
I believe.  I didn't have time to fully test, but it gives you the 
idea.  You can make things prettier by wrapping the returned value 
in galaxy.datatypes.data.nice_size


diff -r 56be3f4871cd lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Fri May 13 21:24:03 2011 -0400
+++ b/lib/galaxy/web/controllers/admin.py Mon May 16 14:15:23 2011 -0400
@@ -41,6 +41,13 @@
 if user.galaxy_sessions:
 return self.format( user.galaxy_sessions[ 0 
].update_time )

 return 'never'
+class DiskUseageColumn( grids.GridColumn ):
+def get_value( self, trans, grid, user ):
+disk_used = 0
+for history in user.active_histories:
+for hda in history.active_datasets:
+disk_used += hda.get_size()
+return disk_used
 
 # Grid definition

 webapp = galaxy
@@ -65,6 +72,7 @@
 ExternalColumn( External, attach_popup=False ),
 LastLoginColumn( Last Login, format=time_ago ),
 StatusColumn( Status, attach_popup=False ),
+DiskUseageColumn( Disk Used, attach_popup=False ),
 # Columns that are valid for filtering but are not visible.
 grids.DeletedColumn( Deleted, key=deleted, visible=False, 
filterable=advanced )

 ]


On May 16, 2011, at 10:18 AM, Louise-Amelie Schmitt wrote:


Hello

I would like to add a column in the admin panel's user list with the 
sum of the file size of every dataset in each user's histories that 
don't belong to any ibrary.


Is there a way to do that?

I had a look at lib/galaxy/web/controller/admin.py and 
templates/grid_base.mako but I fail to see where the query variable 
(containing the items, therefore the users) come from in the mako 
template, so I didn't figure out what each column class in admin.py 
actually manipulates in the get_value() methods.


Regards,
L-A
___
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:

http://lists.bx.psu.edu/


Greg Von Kuster
Galaxy Development Team
g...@bx.psu.edu mailto:g...@bx.psu.edu





___
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:

 http://lists.bx.psu.edu/


Re: [galaxy-dev] User list and disk space?

2011-05-17 Thread Greg Von Kuster
Louise,

The original code would not eliminate a dataset file that was pointed to by a 
LibraryDatasetDatasetAssociation, and then imported from the data library into 
the user's history, creating a HistoryDatasetAssociation that points to the 
same file.  I've added a bit of code below that should eliminate datasets 
falling into this category - not tested at all though...

On May 17, 2011, at 8:42 AM, Louise-Amelie Schmitt wrote:

 
 
 But I still have a question: It comprises the datasets stored in libraries 
 right? Is there a way to ignore them?
 
 
 Greg Von Kuster wrote:
 Hello Louise,
 
 I've pasted a diff below for the file ~/lib/galaxy/web/controller/admin.py 
 that will provide what you want, I believe.  I didn't have time to fully 
 test, but it gives you the idea.  You can make things prettier by wrapping 
 the returned value in galaxy.datatypes.data.nice_size
 
 diff -r 56be3f4871cd lib/galaxy/web/controllers/admin.py
 --- a/lib/galaxy/web/controllers/admin.py Fri May 13 21:24:03 2011 -0400
 +++ b/lib/galaxy/web/controllers/admin.py Mon May 16 14:15:23 2011 -0400
 @@ -41,6 +41,13 @@
 if user.galaxy_sessions:
 return self.format( user.galaxy_sessions[ 0 ].update_time )
 return 'never'
 +class DiskUseageColumn( grids.GridColumn ):
 +def get_value( self, trans, grid, user ):
 +disk_used = 0
 +for history in user.active_histories:
 +for hda in history.active_datasets:

 dataset = hda.dataset
 if not dataset.active_library_associations:
  +disk_used += hda.get_size()


 +return disk_used
  # Grid definition
 webapp = galaxy
 @@ -65,6 +72,7 @@
 ExternalColumn( External, attach_popup=False ),
 LastLoginColumn( Last Login, format=time_ago ),
 StatusColumn( Status, attach_popup=False ),
 +DiskUseageColumn( Disk Used, attach_popup=False ),
 # Columns that are valid for filtering but are not visible.
 grids.DeletedColumn( Deleted, key=deleted, visible=False, 
 filterable=advanced )
 ]
 
 
 On May 16, 2011, at 10:18 AM, Louise-Amelie Schmitt wrote:
 
 Hello
 
 I would like to add a column in the admin panel's user list with the sum of 
 the file size of every dataset in each user's histories that don't belong 
 to any ibrary.
 
 Is there a way to do that?
 
 I had a look at lib/galaxy/web/controller/admin.py and 
 templates/grid_base.mako but I fail to see where the query variable 
 (containing the items, therefore the users) come from in the mako template, 
 so I didn't figure out what each column class in admin.py actually 
 manipulates in the get_value() methods.
 
 Regards,
 L-A
 ___
 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:
 
 http://lists.bx.psu.edu/
 
 Greg Von Kuster
 Galaxy Development Team
 g...@bx.psu.edu mailto:g...@bx.psu.edu
 
 
 
 

Greg Von Kuster
Galaxy Development Team
g...@bx.psu.edu




___
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:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] User list and disk space?

2011-05-17 Thread Greg Von Kuster
Possibly, but it would require an enable flag in the config since instances 
with hundreds of users could pose problems with rendering delays.  If someone 
will proved the precise specs for what yo9u want, I'll add it to my list, but 
it will be awhile before I get to ti.   For example, should dataset files that 
have both LibraryDatasetDatasetAssociations and HistoryDatasetAssociations be 
eliminated from the total?


On May 17, 2011, at 9:10 AM, Peter Cock wrote:

 On May 16, 2011, at 10:18 AM, Louise-Amelie Schmitt wrote:
 
 Hello
 
 I would like to add a column in the admin panel's user list with the sum of
 the file size of every dataset in each user's histories that don't belong to
 any ibrary.
 
 Is there a way to do that?
 
 On Mon, May 16, 2011 at 7:18 PM, Greg Von Kuster g...@bx.psu.edu wrote:
 Hello Louise,
 I've pasted a diff below for the file ~/lib/galaxy/web/controller/admin.py
 that will provide what you want, I believe.  I didn't have time to fully
 test, but it gives you the idea.  You can make things prettier by wrapping
 the returned value in galaxy.datatypes.data.nice_size
 
 That sounds really useful - it is something that you plan on adding
 to Galaxy officially?
 
 Thanks,
 
 Peter
 

Greg Von Kuster
Galaxy Development Team
g...@bx.psu.edu




___
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:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] User list and disk space?

2011-05-17 Thread Nate Coraor
Peter Cock wrote:
 
 That sounds really useful - it is something that you plan on adding
 to Galaxy officially?

Yes, I'm working on adding a lot of user- and admin- side access to
various numbers about disk usage (used by histories, used by deleted
data, etc. and disk quotas.  I hope to have this done shortly after the
GCC.

Thanks,
--nate

 
 Thanks,
 
 Peter
 
 ___
 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:
 
   http://lists.bx.psu.edu/
 
___
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:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] User list and disk space?

2011-05-17 Thread Louise-Amelie Schmitt

Looks like it's working,  a couple of values were reduced :)

Thank you so much!!!
L-A


Greg Von Kuster wrote:

Louise,

The original code would not eliminate a dataset file that was pointed to by a 
LibraryDatasetDatasetAssociation, and then imported from the data library into 
the user's history, creating a HistoryDatasetAssociation that points to the 
same file.  I've added a bit of code below that should eliminate datasets 
falling into this category - not tested at all though...

On May 17, 2011, at 8:42 AM, Louise-Amelie Schmitt wrote:

  

But I still have a question: It comprises the datasets stored in libraries 
right? Is there a way to ignore them?


Greg Von Kuster wrote:


Hello Louise,

I've pasted a diff below for the file ~/lib/galaxy/web/controller/admin.py that 
will provide what you want, I believe.  I didn't have time to fully test, but 
it gives you the idea.  You can make things prettier by wrapping the returned 
value in galaxy.datatypes.data.nice_size

diff -r 56be3f4871cd lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Fri May 13 21:24:03 2011 -0400
+++ b/lib/galaxy/web/controllers/admin.py Mon May 16 14:15:23 2011 -0400
@@ -41,6 +41,13 @@
if user.galaxy_sessions:
return self.format( user.galaxy_sessions[ 0 ].update_time )
return 'never'
+class DiskUseageColumn( grids.GridColumn ):
+def get_value( self, trans, grid, user ):
+disk_used = 0
+for history in user.active_histories:
+for hda in history.active_datasets:
  


 dataset = hda.dataset
 if not dataset.active_library_associations:
  

+disk_used += hda.get_size()
  



  

+return disk_used
 # Grid definition
webapp = galaxy
@@ -65,6 +72,7 @@
ExternalColumn( External, attach_popup=False ),
LastLoginColumn( Last Login, format=time_ago ),
StatusColumn( Status, attach_popup=False ),
+DiskUseageColumn( Disk Used, attach_popup=False ),
# Columns that are valid for filtering but are not visible.
grids.DeletedColumn( Deleted, key=deleted, visible=False, 
filterable=advanced )
]


On May 16, 2011, at 10:18 AM, Louise-Amelie Schmitt wrote:

  

Hello

I would like to add a column in the admin panel's user list with the sum of the 
file size of every dataset in each user's histories that don't belong to any 
ibrary.

Is there a way to do that?

I had a look at lib/galaxy/web/controller/admin.py and templates/grid_base.mako but I 
fail to see where the query variable (containing the items, therefore the 
users) come from in the mako template, so I didn't figure out what each column class in 
admin.py actually manipulates in the get_value() methods.

Regards,
L-A
___
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:

http://lists.bx.psu.edu/


Greg Von Kuster
Galaxy Development Team
g...@bx.psu.edu mailto:g...@bx.psu.edu



  


Greg Von Kuster
Galaxy Development Team
g...@bx.psu.edu



  


___
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:

 http://lists.bx.psu.edu/


[galaxy-dev] User list and disk space?

2011-05-16 Thread Louise-Amelie Schmitt

Hello

I would like to add a column in the admin panel's user list with the sum 
of the file size of every dataset in each user's histories that don't 
belong to any ibrary.


Is there a way to do that?

I had a look at lib/galaxy/web/controller/admin.py and 
templates/grid_base.mako but I fail to see where the query variable 
(containing the items, therefore the users) come from in the mako 
template, so I didn't figure out what each column class in admin.py 
actually manipulates in the get_value() methods.


Regards,
L-A
___
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:

 http://lists.bx.psu.edu/