Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How Can I Call The

How can I call the runtime of a experiment running on the clearml agent?

  
  
Posted 2 years ago
Votes Newest

Answers 24


image

  
  
Posted 2 years ago

image

  
  
Posted 2 years ago

image

  
  
Posted 2 years ago

image

  
  
Posted 2 years ago

Are there any errors in the server that might indicate issues with writing the queue stats?

  
  
Posted 2 years ago

` client.queues.get_default()

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/conda/lib/python3.9/site-packages/clearml/backend_api/session/client/client.py", line 378, in new_func
return Response(self.session.send(request_cls(*args, **kwargs)))
File "/opt/conda/lib/python3.9/site-packages/clearml/backend_api/session/client/client.py", line 122, in send
raise APIError(result)
clearml.backend_api.session.client.client.APIError: APIError: code 400/707: No queue is tagged as the default queue for this company `

  
  
Posted 2 years ago

this is the response. We are using the clearml hosted server

  
  
Posted 2 years ago

Going for something like this:
` >>> queue = QueueMetrics(queue='queueid')

queue.avg_waiting_times `

  
  
Posted 2 years ago

please note from_date and to_date need to be epoch floats (casted to in, they should represent milliseconds, not microseconds)

  
  
Posted 2 years ago

RobustRat47 getting the default queue ID should be enough

  
  
Posted 2 years ago

Hi RobustRat47 , I'm not sure I understand the question...?

  
  
Posted 2 years ago

next one I'm looking for is average queue time

  
  
Posted 2 years ago

<queues.GetQueueMetricsResponse: { "queues": [] }>

  
  
Posted 2 years ago

Usually that is shown here... for some reason it's not showing

  
  
Posted 2 years ago

Umm no luck

q = client.queues.get_all(name='default')[0] from_date = math.floor(datetime.timestamp(datetime.now() - relativedelta(months=3))) to_date = math.floor(datetime.timestamp(datetime.now())) res = client.queues.get_queue_metrics(from_date=from_date, to_date=to_date, interval=1, queue_ids=[q.id])

  
  
Posted 2 years ago

you can try something like this - which reproduces the gui behavior

` import math
import datetime
from clearml.backend_api.session.client import APIClient

client = APIClient()
q = client.queues.get_all(name='queue-2')[0]
n = math.floor(datetime.timestamp(datetime.now()))
res = client.queues.get_queue_metrics(from_date=n-1, to_date=n, interval=1, queue_ids=[q.id]) `Be careful though of the null value in the results. It happens when the there are values in the res than intervals between start and stop dates

  
  
Posted 2 years ago

yes exactly

  
  
Posted 2 years ago

I also noticed that my queue stats haven't been updated since 7/1/2022 @ 12:41am

  
  
Posted 2 years ago

hi RobustRat47
the field name is active_duration, and it is expressed in seconds

to access it for the task my_task , do my_task.d ata.active_duration

  
  
Posted 2 years ago

can you please try to replace client.queues.get_all by client.queues.get_default ?
this is a specific function for retrieving the default queue 🙂

  
  
Posted 2 years ago

ahhh okay thank you 🙂

  
  
Posted 2 years ago

I'll like to call Run Time via the task object.... I think I need to calculate manually

i.e.

task = clearml.Task.get_task(id) time = task.data.last_update - task.data.started

  
  
Posted 2 years ago

what do you mean ? the average time that the tasks are waiting before being executed by an agent ? that is to say the average difference between enqueue time and beginning time ?

  
  
Posted 2 years ago

cool thanks - I'll try it out

  
  
Posted 2 years ago
726 Views
24 Answers
2 years ago
3 months ago
Tags
Similar posts