-
Notifications
You must be signed in to change notification settings - Fork 107
✨ add cost budget, runtime cost estimator and metrics #964
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 cost budget, runtime cost estimator and metrics #964
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #964 +/- ##
==========================================
+ Coverage 64.27% 64.34% +0.06%
==========================================
Files 194 194
Lines 19015 19080 +65
==========================================
+ Hits 12222 12277 +55
- Misses 5784 5793 +9
- Partials 1009 1010 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8f4b794
to
4620ecc
Compare
4620ecc
to
2c4a94d
Compare
/assign @qiujian16 @zhujian7 |
2c4a94d
to
8871df7
Compare
8871df7
to
a13d489
Compare
25c4439
to
7d9f072
Compare
pkg/placement/helpers/clusters.go
Outdated
@@ -63,7 +66,7 @@ func (c *ClusterSelector) Matches(ctx context.Context, cluster *clusterapiv1.Man | |||
|
|||
// match with cel selector if exists | |||
if c.celSelector != nil { | |||
if ok := c.celSelector.Validate(ctx, cluster); !ok { | |||
if ok, _ := c.celSelector.Validate(ctx, cluster, celconfig.RuntimeCELCostBudget); !ok { |
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 we need this as an input?
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.
This is for UT to input a small budget and test "running out of cost budget" case.
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.
but it seems like a global var that we can also set during ut?
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.
Yes! Modified this part to set CostBudget as a global var.
@@ -29,7 +32,7 @@ func NewClusterSelector(selector clusterapiv1beta1.ClusterSelector, env *cel.Env | |||
return nil, err | |||
} | |||
// build cel selector | |||
celSelector := NewCELSelector(env, selector.CelSelector.CelExpressions) | |||
celSelector := NewCELSelector(env, selector.CelSelector.CelExpressions, metricsRecorder) |
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.
Do we have a general metrics for predicate? we should add a TODO if we do not have one.
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.
yes, we have metrics for predicate: https://github.com/open-cluster-management-io/ocm/blob/main/pkg/placement/controllers/scheduling/schedule.go#L200
3caa280
to
f8d82c0
Compare
Signed-off-by: Qing Hao <[email protected]>
/approve |
[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 |
df87f52
into
open-cluster-management-io:main
Summary
Related issue(s)
#843
#955
Per expression cost limit exceeded
Total expression cost budget exceeded
Metrics