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

ui: Redundant query request fix #3331

Merged
merged 5 commits into from
Jun 21, 2023
Merged

ui: Redundant query request fix #3331

merged 5 commits into from
Jun 21, 2023

Conversation

manojVivek
Copy link
Contributor

@manojVivek manojVivek commented Jun 21, 2023

Contains the following:

  • Fix for the redundant query request from the UI due to the updated nodeThreshold.
  • Enables node trimming by default.
  • Fix the @parca/hooks package version drift from the the consumed version.
  • Fix the bug with the bigint linearScale scale function.

Resolves #2823

@brancz
Copy link
Member

brancz commented Jun 21, 2023

Works perfectly now! Thanks for taking care of this!

Looks like some lint is failing otherwise lgtm

@@ -15,7 +15,7 @@
* Divides two bigints and returns a number with two decimal places
*/
export const divide = (a: bigint, b: bigint): number => {
return Number((a * 10000n) / b) / 10000;
return Number((a * 1000000n) / b) / 1000000;
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity, why did the value being multiplied by change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since bigint divisions don't give any decimals, we premultiply it by 1M and then divide the result again by 1M to get the result with decimals.

I increased the number from 10K to 1M to get more precision to the decimal part, which was needed for the linearScale function.

Hope it answers the question.

Copy link
Contributor

@yomete yomete left a comment

Choose a reason for hiding this comment

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

lgtm! just a question about a change in value below.

@manojVivek manojVivek enabled auto-merge (squash) June 21, 2023 12:29
@manojVivek manojVivek merged commit 6a6381a into main Jun 21, 2023
37 checks passed
@brancz brancz deleted the redundant-query-fix branch June 21, 2023 14:29
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.

Multiple Query requests are made when node trimming is enabled.
3 participants