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
I Have Another Small Technical Question, I Am Trying To See The Workers Status Programatically Using The Folowing:

I have another small technical question, I am trying to see the workers status programatically using the folowing:
from clearml.backend_api.session.client import APIClient client = APIClient() workers = client.workers.get_all() for worker in workers: print(client.workers.status_report(worker.id, **timestamp**))I couldn't figure out what is the meaning of the timestamp, and for all the values I tried I am getting an empty response. what am I doing wrong?
thanks!

  
  
Posted 2 years ago
Votes Newest

Answers 17


thanks AgitatedDove14 ! this is what I was looking for

  
  
Posted 2 years ago

So basically the APIClient is a pythonic interface to the RestAPI, so you can do the following
See if this one works
# stats from he last 60 seconds for worker in workers: print(client.workers.get_stats(worker_ids=[worker.id], from_date=int(time()-60),to_date=int(time()), interval=60, ))

  
  
Posted 2 years ago

AgitatedDove14 , this was my starting point, however this is only a list of workers ids and names for example:
{'id': 'ip-777-77-7-77.us-east-7.compute.internal:0', 'name': <function Entity.__getattr__.<locals>.new_func at 0x782477c68ca0>}

  
  
Posted 2 years ago

When you say status, what do you mean? Is it active? Running a task?

  
  
Posted 2 years ago

Ohh so even easier:
print(client.workers.get_all())

  
  
Posted 2 years ago

Hmm yes we should probably provide metrics:
client.workers.get_stats(..., items=[dict(key='cpu_usage'), dict(key='gpu_usage')])

  
  
Posted 2 years ago

Thanks for the discussion 🙂
It helped me too.

  
  
Posted one year ago

it is missing the status that I'm looking for, namely is this worker is running a task or not

  
  
Posted 2 years ago

AgitatedDove14 I believe that worker status doesn't is not considered a metric?

  
  
Posted 2 years ago

It's just the print (_ repr _) not showing the data
for w in client.workers.get_all(): print(w.data)

  
  
Posted 2 years ago

it works.. but I am actually trying to access the status not the stats, is that an option?

  
  
Posted 2 years ago

from the docs:
:param items: List of metric keys and requested statistics

  
  
Posted 2 years ago

and which one if it does

  
  
Posted 2 years ago

Hi DepressedChimpanzee34
This is not a query call, this is a reporting call. see docs below
https://clear.ml/docs/latest/docs/references/api/workers#post-workersstatus_report
It is used by the worker to report its own status.
I think this is what you are looking for:
https://clear.ml/docs/latest/docs/references/api/workers#post-workersget_stats

  
  
Posted 2 years ago

is there an available reference for how I can use the API calls with the python API? it is not clear to me from what you shared

  
  
Posted 2 years ago

is it running a task

  
  
Posted 2 years ago

I am getting the following error when I try the above:
` /opt/conda/envs/torch_38/lib/python3.8/site-packages/clearml/backend_api/session/client/client.py in new_func(self, *args, **kwargs)
374 @wrap
375 def new_func(self, *args, **kwargs):
--> 376 return Response(self.session.send(request_cls(*args, **kwargs)))
377
378 new_func.name = new_func.qualname = action

TypeError: init() missing 1 required positional argument: 'items' `

  
  
Posted 2 years ago
481 Views
17 Answers
2 years ago
one year ago
Tags