chore: adding addition telemetry to cover JSONForm widget's performance#35229
chore: adding addition telemetry to cover JSONForm widget's performance#35229rajatagrawal merged 2 commits intoreleasefrom
Conversation
WalkthroughThis update significantly enhances telemetry in the JSONFormWidgets by introducing a utility function, Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant W as JSONFormWidget
participant T as Telemetry
C->>W: Trigger clearErrors
W->>T: startAndEndSpanForFn(clearErrors)
T-->>W: Begin telemetry span
W->>W: clearErrors(fieldName)
T-->>W: End telemetry span
W-->>C: Complete clearErrors operation
sequenceDiagram
participant C as Client
participant W as JSONFormWidget
participant T as Telemetry
C->>W: Trigger parseAndSaveFieldState
W->>T: startRootSpan(parseAndSaveFieldState)
T-->>W: Begin telemetry span
W->>W: parseAndSaveFieldState()
T-->>W: End telemetry span
W-->>C: Complete parseAndSaveFieldState operation
Assessment against linked issues
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- app/client/src/UITelemetry/generateTraces.ts (1 hunks)
- app/client/src/widgets/JSONFormWidget/fields/useRegisterFieldValidity.ts (2 hunks)
- app/client/src/widgets/JSONFormWidget/widget/index.tsx (3 hunks)
Additional comments not posted (5)
app/client/src/widgets/JSONFormWidget/fields/useRegisterFieldValidity.ts (2)
10-10: Good job on importing the telemetry function.The import statement for
startAndEndSpanForFnis necessary for the new telemetry functionality.
38-40: Well done on adding telemetry tracing.The use of
startAndEndSpanForFnto wrap theclearErrorsfunction call enhances observability without altering the core logic.However, ensure that all function calls to
useRegisterFieldValidityare correctly handling the new telemetry tracing.app/client/src/UITelemetry/generateTraces.ts (1)
90-99: Excellent implementation of the telemetry function.The function
startAndEndSpanForFnis correctly implemented to start a span, execute a function, and end the span. This ensures proper resource management and enhances telemetry capabilities.app/client/src/widgets/JSONFormWidget/widget/index.tsx (2)
71-71: Good job on importing the telemetry functions.The import statements for
startRootSpanandendSpanare necessary for the new telemetry functionality.
Line range hint
655-669: Well done on adding telemetry tracing.The use of
startRootSpanandendSpanto wrap theparseAndSaveFieldStatemethod enhances observability and performance monitoring.However, ensure that all method calls to
parseAndSaveFieldStateare correctly handling the new telemetry tracing.
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- app/client/src/widgets/JSONFormWidget/fields/useRegisterFieldValidity.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- app/client/src/widgets/JSONFormWidget/fields/useRegisterFieldValidity.ts
Description
We need to profile a few functions in JSON forms, observed that in some customer's apps the following functions
takes as much 10% in main thread scripting. We are adding setError just to check if this function is performant or not as well.
Fixes #35228
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
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/10114403810
Commit: 90f5c31
Cypress dashboard.
Tags:
@tag.SanitySpec:
Fri, 26 Jul 2024 16:46:46 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Improvements
parseAndSaveFieldStatemethod in the JSONFormWidget for optimized performance insights.