[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] accurate way to query the number of jobs globally



Just for future reference, here's my solution:

#!/usr/bin/python

import htcondor

collector = htcondor.Collector()

jn = 0
for schedd_ad in collector.locateAll(htcondor.DaemonTypes.Schedd):
    schedd = htcondor.Schedd(schedd_ad)
    ads = schedd.query('JobStatus == 2', ['ClusterId'])
    jn += len(ads)
print jn


2014-02-28 17:03 GMT+01:00 Greg Thain <gthain@xxxxxxxxxxx>:
> On 02/28/2014 09:51 AM, Pek Daniel wrote:
>>
>> Hi Greg,
>>
>> It has the same accuracy than condor_status -schedd, right?
>>
>>
>
> yes.
>
>
> -greg
> _______________________________________________
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
>
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/htcondor-users/