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

(Contributor Recognition Infrastructure) Milestone 2.1: Add new frontend endpoints to call the ContributorStatsSummariesHandler #16153

Merged
merged 18 commits into from
Oct 14, 2022

Conversation

chris7716
Copy link
Contributor

Overview

  1. This PR fixes or fixes part of n/a.
  2. This PR does the following:

Essential Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The linter/Karma presubmit checks have passed locally on your machine.
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
    • This lets reviewers restart your CircleCI tests for you.
  • The PR is made from a branch that's not called "develop".

Proof that changes are correct

Proof of changes on desktop with slow/throttled network

Proof of changes on mobile phone

Proof of changes in Arabic language

PR Pointers

  • Make sure to follow the instructions for making a code change.
  • If you need a review or an answer to a question, and don't have permissions to assign people, leave a comment like the following: "{{Question/comment}} @{{reviewer_username}} PTAL". Oppiabot will help assign that person for you.
  • For what code owners will expect, see the Code Owner's wiki page.
  • Make sure your PR follows conventions in the style guide, otherwise this will lead to review delays.
  • Never force push. If you do, your PR will be closed.
  • Some of the e2e tests are flaky, and can fail for reasons unrelated to your PR. We are working on fixing this, but in the meantime, if you need to restart the tests, please check the "If your build fails" wiki page.

@oppiabot
Copy link

oppiabot bot commented Sep 27, 2022

Hi @seanlip, @gp201 -- could one of you please add the appropriate changelog label to this pull request? Thanks!

@oppiabot oppiabot bot assigned gp201 and seanlip Sep 27, 2022
Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

Looked at 2 codeowner files, just one comment for now

return (
this.contributionAndReviewStatsBackendApiService
.fetchContributionAndReviewStatsAsync(
'translation', 'submission', username));
Copy link
Member

Choose a reason for hiding this comment

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

These hardcoded strings ought to be named constants / enums, I think.

Also these are four roundtrip calls. How long does each take? I'm wondering about this strategy vs batching the GET into a single one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These hardcoded strings ought to be named constants / enums, I think.

Done

How long does each take?

Translation Submissions -> 0.0019922256469726562 s
Translation Reviews -> 0.002099275588989258 s
Question Submissions -> 0.0017049312591552734 s
Question Reviews -> 0.0022652149200439453 s
------------------------------------------------------
Total -> 0.00806164741 s

Also I have a separate endpoint fetch all stats at once in case to fetch everything from one request. It takes 0.008791923522949219 s.

Copy link
Member

@seanlip seanlip Oct 13, 2022

Choose a reason for hiding this comment

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

Just to check, these are being measured starting from the frontend? Could you show a screenshot of where the measurement was done from? I'm a bit surprised because I'd have thought the network latency itself would be larger than this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I just checked it in the backend.

This when they are fetched from the frontend. The first record with 126 ms corresponds to fetch everything from one request. The other four correspond for fetching stats for translation submissions, translation reviews, question submissions and question reviews.

image

@seanlip seanlip assigned chris7716 and unassigned seanlip Sep 28, 2022
Copy link
Member

@gp201 gp201 left a comment

Choose a reason for hiding this comment

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

LGTM for codeowner files

@gp201 gp201 removed their assignment Sep 29, 2022
@oppiabot
Copy link

oppiabot bot commented Oct 10, 2022

Hi @chris7716, there is a new change in develop which needs to be in your PR. Please update your branch with the latest changes in develop. For instructions, refer to this link. Thanks!

@chris7716 chris7716 requested review from a team and ashutoshc8101 October 12, 2022 16:45
@oppiabot oppiabot bot removed the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Oct 12, 2022
@chris7716
Copy link
Contributor Author

@seanlip PTAL. Thanks!

@oppiabot oppiabot bot assigned seanlip and unassigned chris7716 Oct 13, 2022
@oppiabot
Copy link

oppiabot bot commented Oct 13, 2022

Unassigning @chris7716 since a re-review was requested. @chris7716, please make sure you have addressed all review comments. Thanks!

@seanlip seanlip assigned chris7716 and ashutoshc8101 and unassigned seanlip Oct 13, 2022
@seanlip
Copy link
Member

seanlip commented Oct 13, 2022

@ashutoshc8101 PTAL for codeowners.

Copy link
Contributor

@ashutoshc8101 ashutoshc8101 left a comment

Choose a reason for hiding this comment

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

LGTM for codeowners.

@oppiabot
Copy link

oppiabot bot commented Oct 13, 2022

Unassigning @ashutoshc8101 since they have already approved the PR.

@chris7716 chris7716 assigned seanlip and unassigned chris7716 Oct 13, 2022
Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

Thanks @chris7716! OK, sounds like there isn't much difference then. I think the rest of the PR looks good.

@seanlip seanlip assigned chris7716 and unassigned seanlip Oct 13, 2022
@oppiabot oppiabot bot added the PR: LGTM label Oct 13, 2022
@oppiabot
Copy link

oppiabot bot commented Oct 13, 2022

Hi @chris7716, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

@chris7716 chris7716 merged commit 2375a02 into oppia:develop Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants