How-To: Monitor Worker Performance
Monitoring worker performance helps ensure optimal query processing and identifies when additional workers may be needed to maintain performance. This guide explains how to monitor worker performance for a specific model using the web console.
Log in to the web console to access the Main Page, where modules for each of your models are displayed, and identify the module corresponding to the model for which you want to monitor a worker's performance.

The model's performance metrics are displayed below its name:
Current Load: Shows the average query processing time in the last 5 minutes.
Average Load: Indicates the model's average query processing time over the past month.
Active Workers: Lists the number of workers currently running for the model.
import lattica_common.auth_local_state as auth
import lattica_common.app_api as agent_app
# Notice your account token expires every 30 days and it's up to you to renew it
auth.set_session_token("your_account_token_you_got_in_your_email")
# Retrieve all active workers for a specific model
active_workers = agent_app.worker.get_active_workers("model_id")
# Iterate through each active worker and get detailed worker information
for active_worker in active_workers:
# Retrieve worker information using the workerSessionId
worker_session_id = active_worker.workerSessionId
# In case of failur this function throws
worker_info = agent_app.worker.get_worker_info(worker_session_id)
# Print or process the worker information as needed
print(f"Worker Session ID: {worker_session_id}")
print(f"Worker Info: {worker_info}\n")
Compare Current Load and Average Load
If the Current Load is significantly higher than the Average Load, it indicates increased query traffic or reduced performance. In this case, consider starting additional workers to distribute the load.
Last updated
Was this helpful?