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

[YUNIKORN-2515] Add property event.RESTResponseSize to the batch event handler #886

Closed
wants to merge 3 commits into from

Conversation

pbacsko
Copy link
Contributor

@pbacsko pbacsko commented Jun 5, 2024

What is this PR for?

Update the code with the property event.RESTResponseSize as per the design document.

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-2515

How should this be tested?

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

@pbacsko pbacsko self-assigned this Jun 5, 2024
@pbacsko
Copy link
Contributor Author

pbacsko commented Jun 5, 2024

I think Test_fixedRule_ruleDAO needs to be corrected, the map iteration order sometimes changes.

@pbacsko pbacsko requested review from wilfred-s, chia7712, craigcondit and manirajv06 and removed request for wilfred-s and chia7712 June 6, 2024 11:25
@pbacsko
Copy link
Contributor Author

pbacsko commented Jun 6, 2024

Created #887 to fix the test case. Will rebase this PR as soon as that one gets merged.

@chia7712
Copy link
Contributor

chia7712 commented Jun 6, 2024

I have another idea of implementing this new property.

event.RESTResponseSize can be applied to EventSystemImpl and thus GetEventsFromID can pick up min(count, RESTResponseSize) to generate EventRecord. That is similar to requestCapacity and ringBufferCapacity WDYT?

func (e *eventRingBuffer) getEventsFromID(id uint64, count uint64) ([]*si.EventRecord, uint64, uint64) {

@pbacsko
Copy link
Contributor Author

pbacsko commented Jun 12, 2024

event.RESTResponseSize can be applied to EventSystemImpl and thus GetEventsFromID can pick up min(count, > RESTResponseSize) to generate EventRecord. That is similar to requestCapacity and ringBufferCapacity WDYT?

Hm... I'd rather keep this separate. This property concerns the REST output, I think it's better to handle it separately from the event system.

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@pbacsko thanks for updated PR. overall LGTM. one last comment :)

configs.AddConfigMapCallback("rest-response-size", func() {
newSize := configs.DefaultRESTResponseSize
configMap := configs.GetConfigMap()
if value, ok := configMap[configs.CMRESTResponseSize]; ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about reusing common.GetConfigurationUint?

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.69%. Comparing base (c6aca63) to head (06e769b).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #886      +/-   ##
==========================================
+ Coverage   77.43%   77.69%   +0.25%     
==========================================
  Files          97       97              
  Lines       12132    12119      -13     
==========================================
+ Hits         9395     9416      +21     
+ Misses       2410     2379      -31     
+ Partials      327      324       -3     

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

@pbacsko pbacsko closed this in a786feb Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants