[GE users] dbwriter derived value

Jana Olivova Jana.Olivova at Sun.COM
Tue Nov 6 10:51:05 GMT 2007


    [ The following text is in the "GB2312" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some characters may be displayed incorrectly. ]

Hi,

For this kind of derived values you cannot use a simple aggregate
function. The derived values need to look similar like the derived
values for "number of jobs finished per user". The final derived values
will actual go to the sge_user_values table. By creating an inner join
query between the sge_user and sge_user_values on uv_parent = u_id you
can then retrieve the values for particular user name. You should
probably calculate hourly values and then from those calculate (now with
a simple aggregate function) the daily values, refer to examples from
the dbwriter.xml.

The derived value rule should look similar to this (please note I did
not test it):

<derive object="user" interval="hour" variable="h_sum_cpu">
<sql>
SELECT date_trunc('hour', ju_end_time)::date AS time_start,
date_trunc('hour', ju_end_time) + INTERVAL '1 hour' AS time_end,
SUM(ju_cpu) AS value
FROM sge_job, sge_job_usage
WHERE j_owner = __key_0__ AND
j_id = ju_parent AND
ju_end_time <= '__time_end__' AND
ju_end_time > '__time_start__'
GROUP BY time_start
</sql>
</derive>

So when querying the sge_user_values you will be looking fro records
where uv_value="h_sum_cpu".

The daily you then create like this:

<derive object="user" interval="day" variable="d_sum_cpu">
<auto function="SUM" variable="h_sum_cpu" />
</derive>

Also please note the following bugs that will be fixed in the next releases:
Issuezila: 2414, 2416, 2415

Regards,

Jana Olivova

??? wrote:
> Dear all,
>
>    I installed dbwriter based on the installation guide. And I want to calculate the dayly sum of cpu per user.
>
>    I added the following script into $SGE_ROOT/dbwriter/database/postgres/dbwriter.xml.
>
>    <derive object="user" interval="hour" variable="h_sum_cpu">
>       <auto function="SUM" variable="np_load_avg" />
>    </derive>
>
>    I restart the sgedbwriter , however, I cannot find the derived values in the table sge_user_values. I also change  
>
>    <auto function="SUM" variable="np_load_avg" /> to <auto function="SUM" variable="cpu" /> or <auto function="SUM" variable="h_cpu" /> , but don't work too.
>
>    Does anyone have ideas?
>
>
> 	
>
> ??Thanks and best regards!
>  				
>
> ???????????
> ????????blueriver at eastday.com
> ??????????2007-11-06
>   




    [ Part 2: "Attached Text" ]

    [ The following text is in the "iso-8859-1" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net



More information about the gridengine-users mailing list