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

support scheduler_plugin_execution_duration_seconds in scheduler_perf #124578

Conversation

sanposhiho
Copy link
Member

@sanposhiho sanposhiho commented Apr 27, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

support scheduler_plugin_execution_duration_seconds in scheduler_perf, which visualizes which plugin is how much slower.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

I confirmed that it's working expectedly at local machine. The output would be like following.

....
    {
      "data": {
        "Average": 0.00032820000000000006,
        "Perc50": 0.005,
        "Perc90": 0.009000000000000001,
        "Perc95": 0.0095,
        "Perc99": 0.0099
      },
      "unit": "ms",
      "labels": {
        "Metric": "scheduler_plugin_execution_duration_seconds",
        "Name": "SchedulingBasic/500Nodes/namespace-2",
        "extension_point": "Score",
        "plugin": "ImageLocality",
        "result": "not applicable"
      }
    },
    {
      "data": {
        "Average": 0.0047445000000000005,
        "Perc50": 0.005,
        "Perc90": 0.009000000000000001,
        "Perc95": 0.0095,
        "Perc99": 0.0099
      },
      "unit": "ms",
      "labels": {
        "Metric": "scheduler_plugin_execution_duration_seconds",
        "Name": "SchedulingBasic/500Nodes/namespace-2",
        "extension_point": "PreFilter",
        "plugin": "InterPodAffinity",
        "result": "not applicable"
      }
    },
.....

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 27, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 27, 2024
@k8s-ci-robot k8s-ci-robot added area/test sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 27, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sanposhiho

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2024
@sanposhiho sanposhiho force-pushed the scheduler_perf_scheduler_plugin_execution_duration_seconds branch from e8952a6 to c72b688 Compare April 27, 2024 08:23
@AxeZhan
Copy link
Member

AxeZhan commented Apr 28, 2024

uniqueLVCombos looks a bit complex, I'm not sure if it's worth to maintain this function,
Considering that we now only have one metric("scheduler_plugin_execution_duration_seconds") that needs to be combined, and we can simply use two for loops to generate combinations for it.

But it is true that uniqueLVCombos can provide better abstraction, and I can't come up a better way if there will be more metrics with more labels added in the future :)

The rest part looks good to me and should be ok.

@sanposhiho
Copy link
Member Author

I believe we should keep a general solution like uniqueLVCombos, as we likely add more metric supports in the future.
(I admit maybe uniqueLVCombos could be simplified though. I'm really bad at such leetcode-ish programming.)

@sanposhiho
Copy link
Member Author

/cc @utam0k

@k8s-ci-robot k8s-ci-robot requested a review from utam0k May 1, 2024 01:33
)

var (
defaultMetricsCollectorConfig = metricsCollectorConfig{
Metrics: map[string]*labelValues{
Metrics: map[string][]*labelValues{
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if the metrics in scheduler-perf are under control like other metrics. It means we should list stable metrics.
https://kubernetes.io/docs/reference/instrumentation/metrics/#list-of-stable-kubernetes-metrics

WDYT? @logicalhan

Copy link
Member

@utam0k utam0k May 2, 2024

Choose a reason for hiding this comment

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

This is a bit out of responsibility in this PR, but let me ask you a question for our future.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we're going to be able to parse this file..

Copy link
Member

Choose a reason for hiding this comment

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

It looks... challenging from a static analysis perspective.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably I don't understand what @utam0k means. Why should we in the first place actually?
All metrics used in scheduler_perf are existing metrics that are exposed from scheduler, not something like scheduler_perf's original metrics.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry you are right.

Copy link
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 5, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 88247f8c3a1eca07d952be03a2694f23070584f4

@k8s-ci-robot k8s-ci-robot merged commit ade0d21 into kubernetes:master May 5, 2024
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.31 milestone May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants