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

Page unresponsive when loading report of many repos with huge date gap #542 #596

Merged
merged 35 commits into from Apr 1, 2019

Conversation

emer7
Copy link
Contributor

@emer7 emer7 commented Mar 11, 2019

Fix #542

RepoSense is unresponsive if we load many repos
with huge date gap, making it nearly unusable.

This is caused by the report generated having a lot of
empty commits per day, in which the frontend needs to
sift through to display the report.

Let's fix this issue by removing all those empty commits,
including only commits that are necessary.

@emer7 emer7 changed the title [WI] Page unresponsive when loading report of many repos with huge date gap #542 [WIP] Page unresponsive when loading report of many repos with huge date gap #542 Mar 11, 2019
@emer7 emer7 changed the title [WIP] Page unresponsive when loading report of many repos with huge date gap #542 Page unresponsive when loading report of many repos with huge date gap #542 Mar 11, 2019
@emer7 emer7 requested a review from a team March 11, 2019 10:15
@emer7
Copy link
Contributor Author

emer7 commented Mar 11, 2019

@reposense/stage1-reviewers Ready for review

Copy link
Member

@fzdy1914 fzdy1914 left a comment

Choose a reason for hiding this comment

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

It seems that you have added many startDate to the functions. Why is this necessary?

@emer7
Copy link
Contributor Author

emer7 commented Mar 11, 2019

It seems that you have added many startDate to the functions. Why is this necessary?

Which one? Is it in the .java file?

If yes, it is because now we don't store empty commits per day but instead we only store meaningful commits. We need start date to count the variance.

@yamidark yamidark requested a review from a team March 12, 2019 13:33
@emer7
Copy link
Contributor Author

emer7 commented Mar 14, 2019

@reposense/stage1-reviewers if no one will review, I will proceed with requesting review from stage2-reviewers. I'll request for review from stage2 by 4pm (end of CS3282 class)

@emer7 emer7 requested a review from a team March 14, 2019 06:14
Copy link
Contributor

@yamidark yamidark left a comment

Choose a reason for hiding this comment

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

Some comments for now

"charlesgoh": 87747.24,
"jeffreygohkw": 72073.97,
"Esilocke": 419051.7,
"wangyiming1019": 64918.33
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the variance changing though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yamidark
I have investigated it.
I think it is float operation

Consider this arguments
--repo https://github.com/reposense/RepoSense.git --since 01/03/2019
The variance for the old implementation will be 2149.7754
The variance for the new implementation will be 2149.7756

I think the change is caused by the different order of evaluation of totalContribution
For the old implementation, the order will be as follow:
0 0 0 0 0 0 0 0 174 0 0 0 0
While for the new implementation, the order will be as follow:
0 174 0 0 0 0 0 0 0 0 0 0 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, I change implementation

Copy link
Member

@eugenepeh eugenepeh left a comment

Choose a reason for hiding this comment

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

image

Is there any particular reason that only selective dates were removed?

frontend/src/static/js/api.js Show resolved Hide resolved
@emer7
Copy link
Contributor Author

emer7 commented Mar 16, 2019

image

Is there any particular reason that only selective dates were removed?

Those empty contributions that is not removed comes from
List<CommitResult> commitResults = CommitInfoAnalyzer.analyzeCommits(commitInfos, config);

commitResults contains empty contributions.

I do not investigate why so. I only uses what I get from commitResults

@eugenepeh
Copy link
Member

eugenepeh commented Mar 16, 2019

Those empty contributions that is not removed comes from
List commitResults = CommitInfoAnalyzer.analyzeCommits(commitInfos, config);

commitResults contains empty contributions.

I do not investigate why so. I only uses what I get from commitResults

From what I perceived, it seems to be that an empty contribution will be added to all authors for every commit. The commit should only be attributed to its author and not all the contributors in the repo. Can you look into it and fix this?

@emer7
Copy link
Contributor Author

emer7 commented Mar 18, 2019

Those empty contributions that is not removed comes from
List commitResults = CommitInfoAnalyzer.analyzeCommits(commitInfos, config);
commitResults contains empty contributions.
I do not investigate why so. I only uses what I get from commitResults

From what I perceived, it seems to be that an empty contribution will be added to all authors for every commit. The commit should only be attributed to its author and not all the contributors in the repo. Can you look into it and fix this?

Okay I think better to fix this at separate PR

@emer7 emer7 requested a review from a team March 21, 2019 04:43
Copy link
Member

@eugenepeh eugenepeh left a comment

Choose a reason for hiding this comment

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

minor nit

@@ -19,6 +19,9 @@
*/
public class CommitResultAggregator {

private static final int DAYS_IN_MS = 24 * 60 * 60 * 1000;
private static Date lastDate = null;
Copy link
Member

Choose a reason for hiding this comment

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

What is the assumption that the lastDate can be a global variable here?
Perhaps make it a returning value in the methods through pointer etc.

@emer7 emer7 requested a review from a team March 24, 2019 03:22
@emer7
Copy link
Contributor Author

emer7 commented Mar 24, 2019

@reposense/stage2-reviewers ready for review

Copy link
Member

@eugenepeh eugenepeh left a comment

Choose a reason for hiding this comment

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

minor nits, good to go from me after the fix

@emer7 emer7 requested a review from a team March 24, 2019 14:37
@emer7
Copy link
Contributor Author

emer7 commented Mar 24, 2019

@reposense/stage2-reviewers fixed last nit spotted by Eugene

@codecov
Copy link

codecov bot commented Mar 26, 2019

Codecov Report

Merging #596 into master will increase coverage by 0.2%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #596     +/-   ##
===========================================
+ Coverage     80.64%   80.84%   +0.2%     
- Complexity      537      541      +4     
===========================================
  Files            68       68             
  Lines          1767     1770      +3     
  Branches        185      189      +4     
===========================================
+ Hits           1425     1431      +6     
+ Misses          247      245      -2     
+ Partials         95       94      -1
Impacted Files Coverage Δ Complexity Δ
...java/reposense/commits/CommitResultAggregator.java 96.87% <100%> (+3.43%) 19 <1> (+3) ⬆️
...posense/commits/model/AuthorDailyContribution.java 60% <0%> (+5%) 4% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ccea6fd...b6b26aa. Read the comment docs.

Copy link
Contributor

@yamidark yamidark left a comment

Choose a reason for hiding this comment

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

Some nits, rest LGTM

frontend/src/static/js/v_summary.js Outdated Show resolved Hide resolved
frontend/src/static/js/v_summary.js Outdated Show resolved Hide resolved
frontend/src/static/js/v_summary.js Outdated Show resolved Hide resolved
frontend/src/static/js/v_summary.js Show resolved Hide resolved
frontend/src/static/js/v_summary.js Show resolved Hide resolved
@eugenepeh eugenepeh merged commit f278e75 into reposense:master Apr 1, 2019
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.

Page unresponsive when loading report of many repos with huge date gap
5 participants