-
Notifications
You must be signed in to change notification settings - Fork 48
Metrics #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dbos/_sys_db.py
Outdated
| class WorkflowStatusCountOutput: | ||
| def __init__(self, *, status: str, workflow_count: int) -> None: | ||
| self.status = status | ||
| self.workflow_count = workflow_count | ||
|
|
||
|
|
||
| class QueueStatusCountOutput: | ||
| def __init__(self, *, queue_name: str, tasks_count: int, status: str) -> None: | ||
| self.queue_name = queue_name | ||
| self.tasks_count = tasks_count | ||
| self.status = status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be consolidated 🤷
dbos/_sys_db.py
Outdated
| query = sa.text( | ||
| f""" | ||
| SELECT | ||
| to_timestamp(FLOOR(updated_at / 1000 / {time_bucket_seconds}) * {time_bucket_seconds}) AT TIME ZONE 'UTC' AS bucket, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also decide to use created_at for everything, which would work for "completion" statuses as well.
Arrival/Enqueue/Dequeue rates are a different query anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why are the queue methods separate instead of parameters on the other methods?
- What graphs to we intend to build with these metrics?
Consolidating would make the query building significantly more complicated. Specifically around the group by logic. Also, consider the common case where we want the number of enqueued and running tasks, across all queues, it means that we'd not pass a specific queue name but we'd want
|
|
I am removing rates because they are too complicated. One thing tho is that to compute rate on the observability backend, we'd need to export/expose monotonically increasing counters (what we export are gauges). We don't have the infrastructure to compute them from the database only right now. |
No description provided.