From 92d77c2b4a700b4695f37d7700da167368b3be4d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 15 Dec 2021 11:53:26 -0800 Subject: [PATCH] Removes unused files from LuaIDE, Telemetry is not being used, the only ebus called is Initialized, but no "LogEvents are being called. Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../LuaIDE/Source/LUA/BasicScriptChecker.h | 27 ------- .../LuaIDE/Source/LUA/LUADebuggerMessages.h | 35 -------- .../LUA/LUATargetContextTrackerMessages.cpp | 15 ---- .../LuaIDE/Source/LUA/ScriptCheckerAPI.h | 40 ---------- .../Source/StandaloneToolsApplication.cpp | 13 +-- .../LuaIDE/Source/Telemetry/TelemetryBus.h | 31 ------- .../Source/Telemetry/TelemetryComponent.cpp | 48 ----------- .../Source/Telemetry/TelemetryComponent.h | 41 ---------- .../Source/Telemetry/TelemetryEvent.cpp | 80 ------------------- .../LuaIDE/Source/Telemetry/TelemetryEvent.h | 45 ----------- Code/Tools/LuaIDE/lua_ide_files.cmake | 9 --- 11 files changed, 1 insertion(+), 383 deletions(-) delete mode 100644 Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h delete mode 100644 Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h delete mode 100644 Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp delete mode 100644 Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h diff --git a/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h b/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h deleted file mode 100644 index c24bba2aaa..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef BASICSCRIPTCHECKER_H -#define BASICSCRIPTCHECKER_H - -#include -#include - -namespace LUAEditor -{ - class BasicScriptChecker - { - public: - AZ_CLASS_ALLOCATOR(BasicScriptChecker, AZ::SystemAllocator, 0); - - // eat a script and export any errors: - void ConsumeScript ( - }; - } - -#endif diff --git a/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h b/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h deleted file mode 100644 index d35be7574a..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef LUADEBUGGER_API_H -#define LUADEBUGGER_API_H - -#include -#include - -#pragma once - -namespace LUADebugger -{ - class Messages - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // Bus configuration - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; // we have one bus that we always broadcast to - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::Multiple; // we can have multiple listeners. - ////////////////////////////////////////////////////////////////////////// - typedef AZ::EBus Bus; - typedef Bus::Handler Handler; - - virtual ~Messages() {} - }; -}; - -#endif//LUADEBUGGER_API_H diff --git a/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp b/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp deleted file mode 100644 index a54135993d..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include "LUATargetContextTrackerMessages.h" - - -namespace LUAEditor -{ -} diff --git a/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h b/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h deleted file mode 100644 index 30f912d4d2..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef SCRIPTCHECKER_H -#define SCRIPTCHECKER_H - -#include -#include - - -namespace LUAEditor -{ - class ScriptCheckerRequests - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // Bus configuration - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::Single; - ////////////////////////////////////////////////////////////////////////// - typedef AZ::EBus Bus; - typedef Bus::Handler Handler; - - virtual void StartScriptingCheck(const BreakpointMap& uniqueBreakpoints) = 0; - virtual void BreakpointHit(const Breakpoint& bp) = 0; - virtual void BreakpointResume() = 0; - - virtual ~ScriptCheckerRequests() {} - }; -} - -#pragma once - -#endif diff --git a/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp b/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp index 6f7f2e8705..f9dac47dc5 100644 --- a/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp +++ b/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp @@ -8,9 +8,6 @@ #include "StandaloneToolsApplication.h" -#include -#include - #include #include #include @@ -38,7 +35,6 @@ namespace StandaloneTools { LegacyFramework::Application::RegisterCoreComponents(); - RegisterComponentDescriptor(Telemetry::TelemetryComponent::CreateDescriptor()); RegisterComponentDescriptor(LegacyFramework::IPCComponent::CreateDescriptor()); RegisterComponentDescriptor(AZ::UserSettingsComponent::CreateDescriptor()); @@ -62,7 +58,6 @@ namespace StandaloneTools EnsureComponentCreated(AZ::StreamerComponent::RTTI_Type()); EnsureComponentCreated(AZ::JobManagerComponent::RTTI_Type()); - EnsureComponentCreated(Telemetry::TelemetryComponent::RTTI_Type()); EnsureComponentCreated(AzFramework::TargetManagementComponent::RTTI_Type()); EnsureComponentCreated(LegacyFramework::IPCComponent::RTTI_Type()); @@ -90,14 +85,8 @@ namespace StandaloneTools void BaseApplication::OnApplicationEntityActivated() { - const int k_processIntervalInSecs = 2; - const bool doSDKInitShutdown = true; - EBUS_EVENT(Telemetry::TelemetryEventsBus, Initialize, "O3DE_IDE", k_processIntervalInSecs, doSDKInitShutdown); - - bool launched = LaunchDiscoveryService(); - + [[maybe_unused]] bool launched = LaunchDiscoveryService(); AZ_Warning("EditorApplication", launched, "Could not launch GridHub; Only replay is available."); - (void)launched; } void BaseApplication::SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h deleted file mode 100644 index 9c7e9aa10d..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once -#ifndef TELEMETRY_TELEMETRYBUS_H -#define TELEMETRY_TELEMETRYBUS_H - -#include - -#include "Source/Telemetry/TelemetryEvent.h" - -namespace Telemetry -{ - class TelemetryComponent; - - class TelemetryEvents - : public AZ::EBusTraits - { - public: - virtual void Initialize(const char* applicationName, AZ::u32 processIntervalInSecs, bool doSDKInitShutdown) = 0; - virtual void LogEvent(const TelemetryEvent& event) = 0; - virtual void Shutdown() = 0; - }; - - typedef AZ::EBus TelemetryEventsBus; -} -#endif diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp deleted file mode 100644 index 84519b8114..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "TelemetryComponent.h" - -#include - -namespace Telemetry -{ - void TelemetryComponent::Reflect(AZ::ReflectContext* context) - { - AZ::SerializeContext* serialize = azrtti_cast(context); - - if (serialize) - { - serialize->Class() - ->Version(1) - ; - } - } - - void TelemetryComponent::Activate() - { - TelemetryEventsBus::Handler::BusConnect(); - } - - void TelemetryComponent::Deactivate() - { - Shutdown(); - TelemetryEventsBus::Handler::BusDisconnect(); - } - - void TelemetryComponent::Initialize([[maybe_unused]] const char* applicationName, [[maybe_unused]] AZ::u32 processInterval, [[maybe_unused]] bool doAPIInitShutdown) - { - } - - void TelemetryComponent::LogEvent([[maybe_unused]] const TelemetryEvent& telemetryEvent) - { - } - - void TelemetryComponent::Shutdown() - { - } -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h deleted file mode 100644 index f924908ea2..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -#include "TelemetryBus.h" - -namespace Telemetry -{ - class TelemetryComponent - : public AZ::Component - , public TelemetryEventsBus::Handler - { - public: - AZ_COMPONENT(TelemetryComponent, "{CE41EE3C-AF98-4B22-BA7C-2D425D1F468A}") - - TelemetryComponent() = default; - - ////////////////// - // AZ::Component - void Activate() override; - void Deactivate() override; - static void Reflect(AZ::ReflectContext* context); - ////////////////// - - ////////////////////////////////////////// - // Telemetry::TelemetryEventBus::Handler - void Initialize(const char* applicationName, AZ::u32 processIntervalInSeconds, bool doSDKInitShutdown) override; - void LogEvent(const TelemetryEvent& event) override; - void Shutdown() override; - ////////////////////////////////////////// - }; -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp deleted file mode 100644 index 24dc381ad7..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "TelemetryEvent.h" - -#include "TelemetryBus.h" - -namespace Telemetry -{ - TelemetryEvent::TelemetryEvent(const char* eventName) - : m_eventName(eventName) - { - } - - void TelemetryEvent::SetAttribute(const AZStd::string& name, const AZStd::string& value) - { - m_attributes[name] = value; - } - - const AZStd::string& TelemetryEvent::GetAttribute(const AZStd::string& name) - { - static AZStd::string k_emptyString; - - AZStd::unordered_map< AZStd::string, AZStd::string >::iterator attributeIter = m_attributes.find(name); - - if (attributeIter != m_attributes.end()) - { - return attributeIter->second; - } - - return k_emptyString; - } - - void TelemetryEvent::SetMetric(const AZStd::string& name, double metric) - { - m_metrics[name] = metric; - } - - double TelemetryEvent::GetMetric(const AZStd::string& name) - { - AZStd::unordered_map< AZStd::string, double >::iterator metricIter = m_metrics.find(name); - - if (metricIter != m_metrics.end()) - { - return metricIter->second; - } - - return 0.0; - } - - void TelemetryEvent::Log() - { - EBUS_EVENT(TelemetryEventsBus, LogEvent, (*this)); - } - - void TelemetryEvent::ResetEvent() - { - m_metrics.clear(); - m_attributes.clear(); - } - - const char* TelemetryEvent::GetEventName() const - { - return m_eventName.c_str(); - } - - const TelemetryEvent::AttributesMap& TelemetryEvent::GetAttributes() const - { - return m_attributes; - } - - const TelemetryEvent::MetricsMap& TelemetryEvent::GetMetrics() const - { - return m_metrics; - } -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h deleted file mode 100644 index f7ffed824b..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef TELEMETRY_TELEMETRYEVENT_H -#define TELEMETRY_TELEMETRYEVENT_H - -#include -#include - -namespace Telemetry -{ - class TelemetryEvent - { - public: - typedef AZStd::unordered_map< AZStd::string, AZStd::string > AttributesMap; - typedef AZStd::unordered_map< AZStd::string, double > MetricsMap; - - TelemetryEvent(const char* eventName); - - void SetAttribute(const AZStd::string& name, const AZStd::string& value); - const AZStd::string& GetAttribute(const AZStd::string& name); - - void SetMetric(const AZStd::string& name, double metric); - double GetMetric(const AZStd::string& name); - - void Log(); - void ResetEvent(); - - const char* GetEventName() const; - const AttributesMap& GetAttributes() const; - const MetricsMap& GetMetrics() const; - - private: - AZStd::string m_eventName; - AttributesMap m_attributes; - MetricsMap m_metrics; - }; -} - -#endif diff --git a/Code/Tools/LuaIDE/lua_ide_files.cmake b/Code/Tools/LuaIDE/lua_ide_files.cmake index 1506e45c88..26b40372d3 100644 --- a/Code/Tools/LuaIDE/lua_ide_files.cmake +++ b/Code/Tools/LuaIDE/lua_ide_files.cmake @@ -9,17 +9,11 @@ set(FILES Source/StandaloneToolsApplication.cpp Source/StandaloneToolsApplication.h - Source/Telemetry/TelemetryBus.h - Source/Telemetry/TelemetryComponent.cpp - Source/Telemetry/TelemetryComponent.h - Source/Telemetry/TelemetryEvent.cpp - Source/Telemetry/TelemetryEvent.h Source/LuaIDEApplication.h Source/LuaIDEApplication.cpp Source/AssetDatabaseLocationListener.h Source/AssetDatabaseLocationListener.cpp Source/Editor/LuaEditor.cpp - Source/LUA/BasicScriptChecker.h Source/LUA/BreakpointPanel.cpp Source/LUA/BreakpointPanel.hxx Source/LUA/ClassReferenceFilter.cpp @@ -33,7 +27,6 @@ set(FILES Source/LUA/LUAContextControlMessages.h Source/LUA/LUADebuggerComponent.cpp Source/LUA/LUADebuggerComponent.h - Source/LUA/LUADebuggerMessages.h Source/LUA/LUAEditorBlockState.h Source/LUA/LUAEditorBreakpointWidget.cpp Source/LUA/LUAEditorBreakpointWidget.hxx @@ -71,10 +64,8 @@ set(FILES Source/LUA/LUAEditorViewMessages.h Source/LUA/LUALocalsTrackerMessages.h Source/LUA/LUAStackTrackerMessages.h - Source/LUA/LUATargetContextTrackerMessages.cpp Source/LUA/LUATargetContextTrackerMessages.h Source/LUA/LUAWatchesDebuggerMessages.h - Source/LUA/ScriptCheckerAPI.h Source/LUA/StackPanel.cpp Source/LUA/StackPanel.hxx Source/LUA/TargetContextButton.cpp