Skip to content

Conversation

@maxdml
Copy link
Contributor

@maxdml maxdml commented May 28, 2025

No description provided.

dbos/_sys_db.py Outdated
Comment on lines 239 to 249
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
Copy link
Contributor Author

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,
Copy link
Contributor Author

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.

Copy link
Member

@kraftp kraftp left a 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?

@maxdml
Copy link
Contributor Author

maxdml commented May 29, 2025

  • Why do the queue methods need to be separate instead of being parameters on the other methods?

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 queue_name is not null.

  • What graphs to we intend to build with these metrics?
  • Display current status counts
  • Display current queue length / running tasks on a queue
  • Display completion rate for queues or for a specific queue.

@maxdml
Copy link
Contributor Author

maxdml commented May 29, 2025

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.

@maxdml maxdml marked this pull request as ready for review May 29, 2025 17:43
@maxdml maxdml marked this pull request as draft May 29, 2025 17:44
@maxdml maxdml marked this pull request as ready for review May 29, 2025 18:29
@maxdml maxdml marked this pull request as draft July 24, 2025 21:18
@kraftp kraftp closed this Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants