-
Notifications
You must be signed in to change notification settings - Fork 352
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
feat: Improve TEI Performance [DHIS2-14884] #14039
Conversation
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.
I left a few comments Giuseppe.
It looks good in general, but I'm a bit concerned about the performance when the user hits the "Download" button where we don't have any pagination in place...
Also, please don't forget to add a few good e2e tests so we can have a good coverage on it.
Thanks,
Maikel
|
||
SqlRowSet rowSet = namedParameterJdbcTemplate.queryForRowSet( query.getStatement(), | ||
new MapSqlParameterSource().addValues( query.getParams() ) ); | ||
SqlQuery forSelect = queryCreator.createForSelect(); |
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.
I believe is better to keep the SqlQuery as parameter, as this can be created from outside.
It's sounds strange that "find" or "count" receives a "creator component". Receiving a sql query sounds more natural and more consistent.
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 then I should pass the SqlQueryExecutor 2 different SQLQuery: one for find, one for count
...ervices/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/common/query/Field.java
Outdated
Show resolved
Hide resolved
...va/org/hisp/dhis/analytics/common/query/jsonextractor/AggregatedJsonExtractingSqlRowSet.java
Outdated
Show resolved
Hide resolved
...va/org/hisp/dhis/analytics/common/query/jsonextractor/AggregatedJsonExtractingSqlRowSet.java
Outdated
Show resolved
Hide resolved
...cs/src/main/java/org/hisp/dhis/analytics/common/query/jsonextractor/EnrollmentExtractor.java
Outdated
Show resolved
Hide resolved
...va/org/hisp/dhis/analytics/common/query/jsonextractor/AggregatedJsonExtractingSqlRowSet.java
Outdated
Show resolved
Hide resolved
...va/org/hisp/dhis/analytics/common/query/jsonextractor/AggregatedJsonExtractingSqlRowSet.java
Outdated
Show resolved
Hide resolved
...va/org/hisp/dhis/analytics/common/query/jsonextractor/AggregatedJsonExtractingSqlRowSet.java
Outdated
Show resolved
Hide resolved
...cs/src/main/java/org/hisp/dhis/analytics/common/query/jsonextractor/DelegatingSqlRowSet.java
Outdated
Show resolved
Hide resolved
...cs/src/main/java/org/hisp/dhis/analytics/common/query/jsonextractor/DelegatingSqlRowSet.java
Outdated
Show resolved
Hide resolved
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.
I left a few comments Giuseppe.
It looks good in general, but I'm a bit concerned about the performance when the user hits the "Download" button where we don't have any pagination in place...
Also, please don't forget to add a few good e2e tests so we can have a nice coverage on it.
Thanks,
Maikel
264dded
to
e6046d3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14039 +/- ##
============================================
- Coverage 67.18% 67.11% -0.07%
- Complexity 32155 32159 +4
============================================
Files 3556 3560 +4
Lines 131776 131935 +159
Branches 15329 15340 +11
============================================
+ Hits 88528 88546 +18
- Misses 36063 36196 +133
- Partials 7185 7193 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
…N-EXTRACTOR # Conflicts: # dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/tei/TeiAnalyticsQueryService.java
...ics/src/main/java/org/hisp/dhis/analytics/common/query/jsonextractor/SqlRowSetDelegator.java
Dismissed
Show dismissed
Hide dismissed
…into DHIS2-14884_POC-JSON-EXTRACTOR
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
class JsonExtractorUtilsTest { |
Check notice
Code scanning / CodeQL
Unused classes and interfaces Note test
private static final Pattern TRAILING_ZEROES = Pattern.compile("0*$"); | ||
private static final Pattern ENDING_WITH_DOT = Pattern.compile("\\.$"); | ||
|
||
public static String getFormattedDate(LocalDateTime date) { |
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.
It would be nice to have a Javadoc here as well
Quality Gate passedIssues Measures |
This PR will improve TEI performance by producing a different and optimized query.
It is based on this doc:
https://docs.google.com/document/d/1tcqDoOvKLW5W3t7HNApxbV9cEcMTq6iJIwoG2tZOsD0/edit?usp=sharing