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

ENH Add configuration to cap report counts for large datasets. #139

Merged
merged 1 commit into from
Jan 31, 2022
Merged

ENH Add configuration to cap report counts for large datasets. #139

merged 1 commit into from
Jan 31, 2022

Conversation

GuySartorelli
Copy link
Member

Fixes #105

Opted not to return the result from getCount() directly since the PHPDoc says this returns an int (even though it technically already returns a string if the report isn't set up correctly...)

Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

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

I was a little skeptical at first of adding an optional $limit param to getCount(), though I think the way you have it here is correct

Would you be able to make requested changes + add a unit test for getCountForOverview()?

After that I'm happy to merge

code/Report.php Outdated Show resolved Hide resolved
code/Report.php Outdated Show resolved Hide resolved
code/Report.php Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
code/Report.php Show resolved Hide resolved
code/Report.php Show resolved Hide resolved
@GuySartorelli
Copy link
Member Author

@emteknetnz Will make those changes as time permits - hopefully in the next week.

@sunnysideup
Copy link
Contributor

will this get merged?

@GuySartorelli
Copy link
Member Author

will this get merged?

I haven't had time to make the requested changes yet.

@sunnysideup
Copy link
Contributor

Hopefully it can be added. It is a good one.

@sunnysideup
Copy link
Contributor

sunnysideup commented Jan 30, 2022

I'd set the default limit to 10,000. I think it is good to have default limits on things. People can always increase it and
10,000+ and 1,000,000+ is basically the same thing for a user -> MANY!

@GuySartorelli
Copy link
Member Author

@emteknetnz What do you think about @sunnysideup's suggestion? Happy to make the change if it's approved.

@GuySartorelli
Copy link
Member Author

Requested changes to date have been made, and tests are passing.

@emteknetnz
Copy link
Member

Yup 10,000 default limit makes sense - presumably you'd add just add private static $limit_count_in_overview = 10000; on Report?

@GuySartorelli
Copy link
Member Author

GuySartorelli commented Jan 31, 2022

Yeah and I'll update the test and docs to match. Sounds like a plan.

Opted not to return the result from `getCount()` directly since the PHPDoc says this returns an int (even though it technically already returns a string if the report isn't set up correctly...)
@GuySartorelli
Copy link
Member Author

@emteknetnz I've added the default and updated the readme and test.

@emteknetnz emteknetnz merged commit 375c319 into silverstripe:4 Jan 31, 2022
@GuySartorelli GuySartorelli deleted the enh/limit-count-for-large-datasets branch January 31, 2022 04:30
GuySartorelli added a commit to GuySartorelli/silverstripe-contentreview that referenced this pull request Mar 6, 2022
These parameters are defined in the PHPDocs for `Report` and are technically part of the method signature. They should be respected and in the case of the new default limit in silverstripe/silverstripe-reports#139 this could have performance ramifications for large datasets.
GuySartorelli added a commit to GuySartorelli/silverstripe-contentreview that referenced this pull request Mar 7, 2022
These parameters are defined in the PHPDocs for `Report` and are technically part of the method signature. They should be respected and in the case of the new default limit in silverstripe/silverstripe-reports#139 this could have performance ramifications for large datasets.
GuySartorelli added a commit to GuySartorelli/silverstripe-contentreview that referenced this pull request Mar 7, 2022
These parameters are defined in the PHPDocs for `Report` and are technically part of the method signature. They should be respected and in the case of the new default limit in silverstripe/silverstripe-reports#139 this could have performance ramifications for large datasets.
GuySartorelli added a commit to GuySartorelli/silverstripe-contentreview that referenced this pull request Mar 7, 2022
These parameters are defined in the PHPDocs for `Report` and are technically part of the method signature. They should be respected and in the case of the new default limit in silverstripe/silverstripe-reports#139 this could have performance ramifications for large datasets.
GuySartorelli added a commit to GuySartorelli/silverstripe-contentreview that referenced this pull request Mar 9, 2022
These parameters are defined in the PHPDocs for `Report` and are technically part of the method signature. They should be respected and in the case of the new default limit in silverstripe/silverstripe-reports#139 this could have performance ramifications for large datasets.
GuySartorelli added a commit to GuySartorelli/silverstripe-contentreview that referenced this pull request Mar 9, 2022
These parameters are defined in the PHPDocs for `Report` and are technically part of the method signature. They should be respected and in the case of the new default limit in silverstripe/silverstripe-reports#139 this could have performance ramifications for large datasets.
GuySartorelli added a commit to GuySartorelli/silverstripe-contentreview that referenced this pull request Mar 10, 2022
These parameters are defined in the PHPDocs for `Report` and are technically part of the method signature. They should be respected and in the case of the new default limit in silverstripe/silverstripe-reports#139 this could have performance ramifications for large datasets.
emteknetnz pushed a commit to silverstripe/silverstripe-contentreview that referenced this pull request Mar 10, 2022
These parameters are defined in the PHPDocs for `Report` and are technically part of the method signature. They should be respected and in the case of the new default limit in silverstripe/silverstripe-reports#139 this could have performance ramifications for large datasets.
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.

Cap the count of elements being counted in a content block report so it doesn't time out
3 participants