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

🌱 add metrics for placement #297

Merged

Conversation

haoqing0110
Copy link
Member

@haoqing0110 haoqing0110 commented Oct 23, 2023

Summary

Related issue(s)

Ref: open-cluster-management-io/placement#107

output

# HELP scheduling_bind_duration_seconds [ALPHA] How long in seconds it takes to bind a placement to placementDecisions.
# TYPE scheduling_bind_duration_seconds histogram
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="1e-06"} 0
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="9.999999999999999e-06"} 0
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="9.999999999999999e-05"} 0
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="0.001"} 0
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="0.01"} 99
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="0.1"} 100
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="1"} 100
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="10"} 100
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="100"} 100
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="1000"} 100
scheduling_bind_duration_seconds_bucket{name="placement_scheduling",le="+Inf"} 100
scheduling_bind_duration_seconds_sum{name="placement_scheduling"} 0.5276589120000001
scheduling_bind_duration_seconds_count{name="placement_scheduling"} 100
# HELP scheduling_plugin_duration_seconds [ALPHA] How long in seconds a plugin runs for a placement.
# TYPE scheduling_plugin_duration_seconds histogram
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="1e-06"} 0
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="9.999999999999999e-06"} 94
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="9.999999999999999e-05"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="0.001"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="0.01"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="0.1"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="1"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="10"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="100"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="1000"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter",le="+Inf"} 100
scheduling_plugin_duration_seconds_sum{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter"} 0.0006524939999999999
scheduling_plugin_duration_seconds_count{name="placement_scheduling",plugin_name="Predicate",plugin_type="filter"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="1e-06"} 0
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="9.999999999999999e-06"} 94
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="9.999999999999999e-05"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="0.001"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="0.01"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="0.1"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="1"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="10"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="100"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="1000"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer",le="+Inf"} 100
scheduling_plugin_duration_seconds_sum{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer"} 0.000540145
scheduling_plugin_duration_seconds_count{name="placement_scheduling",plugin_name="ResourceAllocatableMemory",plugin_type="prioritizer"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="1e-06"} 0
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="9.999999999999999e-06"} 0
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="9.999999999999999e-05"} 93
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="0.001"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="0.01"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="0.1"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="1"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="10"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="100"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="1000"} 100
scheduling_plugin_duration_seconds_bucket{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter",le="+Inf"} 100
scheduling_plugin_duration_seconds_sum{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter"} 0.006523761
scheduling_plugin_duration_seconds_count{name="placement_scheduling",plugin_name="TaintToleration",plugin_type="filter"} 100
# HELP scheduling_scheduling_duration_seconds [ALPHA] How long in seconds it takes to schedule a placement.
# TYPE scheduling_scheduling_duration_seconds histogram
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="1e-06"} 0
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="9.999999999999999e-06"} 0
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="9.999999999999999e-05"} 13
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="0.001"} 100
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="0.01"} 100
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="0.1"} 100
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="1"} 100
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="10"} 100
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="100"} 100
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="1000"} 100
scheduling_scheduling_duration_seconds_bucket{name="placement_scheduling",le="+Inf"} 100
scheduling_scheduling_duration_seconds_sum{name="placement_scheduling"} 0.013472362999999998
scheduling_scheduling_duration_seconds_count{name="placement_scheduling"} 100

@haoqing0110 haoqing0110 changed the title [wip] add metrics for placement [wip] 🌱 add metrics for placement Oct 23, 2023
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (f003ed3) 61.39% compared to head (ed9ed5e) 61.47%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #297      +/-   ##
==========================================
+ Coverage   61.39%   61.47%   +0.07%     
==========================================
  Files         131      132       +1     
  Lines       13782    13844      +62     
==========================================
+ Hits         8461     8510      +49     
- Misses       4560     4570      +10     
- Partials      761      764       +3     
Flag Coverage Δ
unit 61.47% <75.34%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...nt/controllers/scheduling/scheduling_controller.go 67.46% <75.00%> (+0.05%) ⬆️
pkg/placement/controllers/scheduling/schedule.go 70.08% <72.72%> (+1.24%) ⬆️
pkg/placement/controllers/metrics/metrics.go 76.92% <76.92%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@haoqing0110
Copy link
Member Author

/assign @qiujian16 @elgnay

plz help review the sample metrics and code, will add more testing code.

@haoqing0110 haoqing0110 force-pushed the br_placement-metrics branch 3 times, most recently from 7571c9f to 0315ab3 Compare October 25, 2023 02:46
@haoqing0110 haoqing0110 changed the title [wip] 🌱 add metrics for placement 🌱 add metrics for placement Oct 25, 2023
@openshift-ci openshift-ci bot removed the approved label Oct 25, 2023
Signed-off-by: haoqing0110 <qhao@redhat.com>
@@ -46,6 +49,13 @@ func (s *Steady) Description() string {

func (s *Steady) Score(
ctx context.Context, placement *clusterapiv1beta1.Placement, clusters []*clusterapiv1.ManagedCluster) (plugins.PluginScoreResult, *framework.Status) {
startTime := time.Now()
Copy link
Member

Choose a reason for hiding this comment

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

if this is the common thing, could we move this to the scheduler?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, moved to scheduler.

Signed-off-by: haoqing0110 <qhao@redhat.com>
@haoqing0110 haoqing0110 force-pushed the br_placement-metrics branch 3 times, most recently from 17fe6c8 to 64bfc2b Compare October 26, 2023 04:20
Signed-off-by: haoqing0110 <qhao@redhat.com>
@qiujian16
Copy link
Member

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 26, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haoqing0110, qiujian16

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

@openshift-ci openshift-ci bot merged commit 2f4ff9f into open-cluster-management-io:main Oct 26, 2023
13 checks passed
@haoqing0110 haoqing0110 deleted the br_placement-metrics branch October 26, 2023 06:45
mprahl pushed a commit to mprahl/OCM that referenced this pull request Mar 14, 2024
)

* use crd manager to update clean crds

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Update tests

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Rebase crd manager

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* build client builder to make code clearer

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Add ut for crdmanager

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Compare crd spec when update

Signed-off-by: Jian Qiu <jqiu@redhat.com>

Signed-off-by: Jian Qiu <jqiu@redhat.com>
mprahl pushed a commit to mprahl/OCM that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants