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

Re: [HTCondor-users] Time elapsed since last completed job



Thank you

This approach might work for me, this is the query I ended up with:

condor_history -completedsince $(($(date +%s)-1800)) -af 'splitSlotName(LastRemoteHost)[1]' | sort -u

Regards

On Fri, Apr 28, 2023 at 09:30 Jason Patton via HTCondor-users <htcondor-users@xxxxxxxxxxx> wrote:
It sounds like you probably already have condor_status queries in mind to figure out the current state of a machine. Similarly, you can use condor_history with the "-startd" flag toÂget historical data from a machine. (A history binding also exists for the Startd object in the Python bindings.) For example, to get the CompletionDate of the last job that finished on a machine namedÂe1000.wisc.edu:

$ condor_history -startd -nameÂe1000.wisc.eduÂ-limit 1 -af CompletionDate
1682630773

The most recent job to finish is returned first, which is why I limitedÂthis query to one result. Note that this would include jobs that exited for any reason (completion, hold, removal).

Jason

On Fri, Apr 28, 2023 at 6:21âAM Miguel Garrido <miguel@xxxxxxxxx> wrote:
Hi,

I am using partitionable slots and the dynamic slots disappear. I could look at ChildActivity but that will be empty for any dynamic slot that has finished and disappears.

I wonder if those hibernation recipes worked with Âpartitionable slots. Iâll do a search for them, but hopefully whoever wrote them or knows about them chimes in.Â

ThanksÂ

On Fri, Apr 28, 2023 at 03:29 Steffen Grunewald <steffen.grunewald@xxxxxxxxxx> wrote:
Hi,

On Thu, 2023-04-27 at 16:30:55 -0400, Miguel Garrido wrote:
> Hello
>
> Iâd like to determine how much time has elapsed since a startd completed
> its last job. Ideally I would like to know wether the system was busy
> running any job within the last X minutes.
>
> I would prefer to do this within Condor with class ads if possible. Is it
> possible?
>
> The other idea Iâve had is to periodically query the startd for Busy slots
> and save the query results in some external file to o query against; but
> that means I would then need to manage that file.

Well, basically you could use the "EnteredCurrentState" classAd provided
for every slot, together with the corresponding "State" and "Activity",
these are seconds since the epoch (iow, standard unix timestamps).

Are you using dynamic slots or static ones? This would make a difference
which "slot" prefixes to scan the 'condor_status -l" output for... also,
for dynamic slots you may check whether "ChildActivity" is an empty list
(otherwise there's still a job running, that is, the startd isn't fully
idle).

OTOH, there had been recipes for hibernating nodes - using the same info
that you're trying to retrieve (node having been fully idle for some time),
perhaps they still exist?


HTH,
ÂSteffen


--
Steffen Grunewald, Cluster Administrator
Max Planck Institute for Gravitational Physics (Albert Einstein Institute)
Am MÃhlenberg 1 * D-14476 Potsdam-Golm * Germany
~~~
Fon: +49-331-567 7274
Mail: steffen.grunewald(at)aei.mpg.de
~~~
_______________________________________________
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/
--
MG
_______________________________________________
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/
_______________________________________________
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/
--
MG