Skip to content
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

Update DescribeTaskList to return Isolation Group metrics #6580

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

natemort
Copy link
Member

What changed?

  • Update emaFixedWindowQPSTracker to support tracking several qps metrics and use it to track the AddTask QPS per isolation group.
  • Update DescribeTaskList to return the AddTask QPS and number of pollers per isolation group. Additionally include the global AddTask QPS.

Why?

  • To support assigning isolation groups to individual TaskList partitions in the future

How did you test it?

  • Unit tests

Potential risks

  • This is adding additional data to an RPC currently used only by the UI and CLI. It seems very low risk.

Release notes

Documentation Changes

Update emaFixedWindowQPSTracker to support tracking several qps metrics and use it to track the AddTask QPS per isolation group.

Update DescribeTaskList to return the AddTask QPS and number of pollers per isolation group. Additionally include the global AddTask QPS.
}

func (r *emaFixedWindowQPSTracker) getOrCreate(group string) *emaFixedWindowState {
res, ok := r.groups.Load(group)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: groups are never cleaned up. when an isolation group is gone (decommissioned zone) it will stay in the map. There is no unexpected behavior due to these leftover groups so it's a minor nit. We have other bigger gaps to make "isolation group auto discovery" a true restart-free feature.

isolationGroupMetrics := make(map[string]*types.IsolationGroupMetrics, len(isolationGroups))
for _, group := range isolationGroups {
isolationGroupMetrics[group] = &types.IsolationGroupMetrics{
NewTasksPerSecond: c.qpsTracker.GroupQPS(group),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I wonder if it matters that much but having a c.qpsTracker.Snapshot() would help with accuracy of NewTasksPerSeconds in the response. Atomically gathering qps info of all groups would help us avoid future surprises.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current implementation we can't actually get a snapshot. With AddTask being high QPS and this being just metric collection I wanted to minimize the performance impact. sync.Map is lock-free once the values have been written and unless we introduce a lock to serialize the writes we can't actually collect a consistent state.

I think it's fine if these numbers are a little fuzzy.

@natemort natemort merged commit 2cbf4f3 into cadence-workflow:master Dec 31, 2024
17 checks passed
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.

2 participants