[gold-users] Gold API and operations

Scott Jackson scottmo at adaptivecomputing.com
Wed Oct 20 17:01:16 MDT 2010


Unfortunately there is no direct provision for that. You will have to:

1) Manipulate the data itself before displaying it.
2) Modify the gold source code to permit this type of query syntax
3) Access the database directly via SQL.

As far as the gcharge time division problem, I know I fixed a slough of similar problems just recently. If you send this problem in as to gold-support as a ticket it will help me check up on this later to see if I caught this one in my recent fixes or not.



----- Original Message -----
> From: "Steve Crusan" <scrusan at ur.rochester.edu>
> To: "Gold Users Mailing List" <gold-users at supercluster.org>
> Sent: Wednesday, October 20, 2010 3:54:45 PM
> Subject: [gold-users] Gold API and operations
> Gold API and operations 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/
> _______________________________________________
> gold-users mailing list
> gold-users at supercluster.org
> http://www.supercluster.org/mailman/listinfo/gold-users

More information about the gold-users mailing list