[gold-users] Gold API and operations

Steve Crusan scrusan at ur.rochester.edu
Wed Oct 20 15:54:45 MDT 2010


Greetings,

    I was wondering if it was possible to use the Gold API, particularly the
Gold::Request to do math on results, or at least pass the proper fields to
the Gold::Database.pm and subsequently the Postgres Gold DB.

  I¹d like to write a command to show the ratios of user/group usage (based
off of hours used, not credits). Now, in Postgres, this is pretty easy:
SELECT  Sum((g_charge / 3600)) / $total_hours AS g_ratio FROM g_job WHERE
g_project = 'some_group';

I¹ve been playing with the gold shell, and on: Job Query ShowUsage:=True, it
doesn¹t seem like there is a provision for that. Is there a way to do this
properly, without having to write some perl that directly interacts with the
gold database? 

Basically:

$ gratio ­p some_project
###################
### Total Hours: 10000
###
Project                         Hours                   Ratio
Some_project            1000                     10%

I¹m also having similar cases where I am not getting some of the data
divided correctly when the ­h is specified:
$request->setSelection("Charge",   "Sum", "", "Hours");

I noticed that the gstatement uses the delta column in the transaction
table, which seems to work, but I cannot get the g_job.g_charge column to be
properly divided...




----------------------
Steve Crusan
System Administrator
Center for Research Computing
University of Rochester
https://www.crc.rochester.edu/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.supercluster.org/pipermail/gold-users/attachments/20101020/107d9b3b/attachment.html 


More information about the gold-users mailing list