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

chore: removed unwanted metrics #37052

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

NilanshBansal
Copy link
Contributor

@NilanshBansal NilanshBansal commented Oct 24, 2024

Description

This PR removes the extra metrics that were added which clouded up the newrelic.
Old PR #37010 is to be closed because extra indentation was added due to the IDE configuration.

Fixes #37051

Automation

/ok-to-test tags="@tag.Sanity"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11493693400
Commit: 51ecb28
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Thu, 24 Oct 2024 06:48:22 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Copy link
Contributor

coderabbitai bot commented Oct 24, 2024

Walkthrough

The changes involve the removal of two static final string constants from the OnLoadSpanCE class and modifications to the OnLoadExecutablesUtilCEImpl class. The updates in OnLoadExecutablesUtilCEImpl focus on simplifying method signatures and eliminating observation tracking in various methods, enhancing the handling of executable references and dynamic bindings.

Changes

File Change Summary
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/OnLoadSpanCE.java Removed constants: GET_POSSIBLE_ENTITY_REFERENCES and GET_POSSIBLE_ENTITY_PARENTS_MAP.
app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java Updated method getPossibleEntityReferences to include an additional parameter and removed observation tracking from multiple methods, including addDirectlyReferencedExecutablesToGraph and addWidgetRelationshipToGraph.

Possibly related PRs

  • chore: added instrumentation for js object update #36999: This PR adds instrumentation for JavaScript object update calls, which includes methods that are directly related to the changes made in the main PR, specifically the removal of constants related to entity references and parents.

Suggested labels

skip-changelog, ok-to-test, Task

Suggested reviewers

  • ApekshaBhosale
  • sharat87
  • rishabhrathod01

Poem

In code we weave, with constants gone,
Simplified paths, we carry on.
Methods refined, tracking laid bare,
A cleaner flow, with room to spare.
So here's to the changes, bright and clear,
In the world of Java, we hold dear! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Oct 24, 2024
Copy link
Contributor

@rishabhrathod01 rishabhrathod01 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@rishabhrathod01 rishabhrathod01 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (2)

Line range hint 529-580: Consider adding debug logging for bindingsInDsl population.

Adding debug logging when bindingsInDsl is populated would improve troubleshooting capabilities without impacting performance.

 if (!bindingsWithExecutableReference.isEmpty() && bindingsInDsl != null) {
+    log.debug("Adding {} bindings to DSL references", bindingsWithExecutableReference.size());
     bindingsInDsl.addAll(bindingsWithExecutableReference);
 }

Line range hint 529-580: Consider optimizing collection operations for better performance.

The current implementation performs multiple iterations over collections. Consider using a more efficient approach:

-Set<EntityDependencyNode> bindingsWithExecutableReference = new HashSet<>();
-entry.getValue().stream().forEach(binding -> {
+Set<EntityDependencyNode> bindingsWithExecutableReference = entry.getValue().stream()
+    .filter(binding -> {
     Executable executable = executableMap.get(binding.getValidEntityName());
-    if (executable != null) {
-        if (binding.getEntityReferenceType().equals(executable.getEntityReferenceType())) {
-            binding.setExecutable(executable);
-            bindingsWithExecutableReference.add(binding);
-            if (!TRUE.equals(binding.getIsFunctionCall())) {
-                possibleEntitiesReferences.add(binding);
-            }
-        }
-    } else if (EntityReferenceType.WIDGET.equals(binding.getEntityReferenceType())) {
-        possibleEntitiesReferences.add(binding);
-    }
-});
+    return executable != null && 
+           binding.getEntityReferenceType().equals(executable.getEntityReferenceType());
+    })
+    .peek(binding -> {
+        Executable executable = executableMap.get(binding.getValidEntityName());
+        binding.setExecutable(executable);
+        if (!TRUE.equals(binding.getIsFunctionCall())) {
+            possibleEntitiesReferences.add(binding);
+        }
+    })
+    .collect(Collectors.toSet());
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5d571b9 and 51ecb28.

📒 Files selected for processing (2)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/OnLoadSpanCE.java (0 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (2 hunks)
💤 Files with no reviewable changes (1)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/OnLoadSpanCE.java
🔇 Additional comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (1)

506-506: LGTM! Clean implementation of method overloading.

The addition of the bindingsInDsl parameter and its handling in the implementation is well-structured. The code maintains backward compatibility through method overloading while extending functionality to track DSL bindings.

Also applies to: 529-580

@github-actions github-actions bot added Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Query & JS Pod Issues related to the query & JS Pod Task A simple Todo labels Oct 24, 2024
@NilanshBansal NilanshBansal added the ok-to-test Required label for CI label Oct 24, 2024
@NilanshBansal NilanshBansal enabled auto-merge (squash) October 24, 2024 06:16
@NilanshBansal NilanshBansal self-assigned this Oct 24, 2024
@NilanshBansal NilanshBansal merged commit 88b987f into release Oct 24, 2024
50 checks passed
@NilanshBansal NilanshBansal deleted the chore/issue-37051/remove-unwanted-metrics branch October 24, 2024 06:48
rishabhrathod01 added a commit that referenced this pull request Oct 29, 2024
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Nov 20, 2024
## Description
> This PR removes the extra metrics that were added which clouded up the
newrelic.
Old PR appsmithorg#37010 is to be
closed because extra indentation was added due to the IDE configuration.

Fixes appsmithorg#37051 

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/11493693400>
> Commit: 51ecb28
> Workflow: `PR Automation test suite`
> Tags: `@tag.Sanity`
> Spec: ``
> <hr>Thu, 24 Oct 2024 06:16:14 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
@coderabbitai coderabbitai bot mentioned this pull request Dec 18, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration ok-to-test Required label for CI Query & JS Pod Issues related to the query & JS Pod skip-changelog Adding this label to a PR prevents it from being listed in the changelog Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Cleanup extra metrics from JS Object update instrumentation
2 participants