From 3032adc09cde653dd0c3d006dc9006759036654d Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:31:22 +0530 Subject: [PATCH] chore: heartbeat code removed (#36837) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!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.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: cc4ac6de04eb8383eafbdc48183933ae39de47ad > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Tue, 15 Oct 2024 07:53:17 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Integrated New Relic for enhanced telemetry tracking. - **Bug Fixes** - Removed the `Heartbeat` component to streamline application performance and rendering logic. - **Chores** - Cleaned up unnecessary variables related to component rendering. --- app/client/src/Heartbeat.tsx | 34 ---------------------------------- app/client/src/index.tsx | 6 ------ 2 files changed, 40 deletions(-) delete mode 100644 app/client/src/Heartbeat.tsx diff --git a/app/client/src/Heartbeat.tsx b/app/client/src/Heartbeat.tsx deleted file mode 100644 index 1dfccffb3e0..00000000000 --- a/app/client/src/Heartbeat.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { useEffect } from "react"; -import log from "loglevel"; -const Heartbeat = () => { - const heartbeatUrl = - "https://uptime.betterstack.com/api/v1/heartbeat/71SZmsvAVW73QvEPQzLvxwEL"; - const interval = 30 * 1000; // 30 secs in milliseconds - - const sendHeartbeat = async () => { - try { - const response = await fetch(heartbeatUrl); - - if (response.ok) { - log.info("Heartbeat sent successfully"); - } else { - log.error("Failed to send heartbeat", response.status); - } - } catch (error) { - log.error("Error sending heartbeat:", error); - } - }; - - useEffect(() => { - const heartbeatInterval = setInterval(() => { - sendHeartbeat(); - }, interval); - - // Cleanup the interval when the component is unmounted - return () => clearInterval(heartbeatInterval); - }, []); // Empty dependency array ensures this runs once on mount - - return null; // This component doesn't render anything -}; - -export default Heartbeat; diff --git a/app/client/src/index.tsx b/app/client/src/index.tsx index 115c8fba1b7..1b21d5f0f73 100755 --- a/app/client/src/index.tsx +++ b/app/client/src/index.tsx @@ -30,7 +30,6 @@ import { PageViewTiming } from "@newrelic/browser-agent/features/page_view_timin import { PageViewEvent } from "@newrelic/browser-agent/features/page_view_event"; import { Agent } from "@newrelic/browser-agent/loaders/agent"; import { getCommonTelemetryAttributes } from "UITelemetry/generateTraces"; -import Heartbeat from "Heartbeat"; const { newRelic } = getAppsmithConfigs(); const { enableNewRelic } = newRelic; @@ -73,12 +72,8 @@ if (enableNewRelic) { newRelicBrowserAgent.setCustomAttribute("appMode", appMode); } -const { cloudHosting } = getAppsmithConfigs(); - const shouldAutoFreeze = process.env.NODE_ENV === "development"; -const isProduction = process.env.NODE_ENV === "production"; - setAutoFreeze(shouldAutoFreeze); runSagaMiddleware(); @@ -100,7 +95,6 @@ function App() { - {cloudHosting && isProduction && }