From 1772c18c607b6d9bc80b4116fc4768753bb2d735 Mon Sep 17 00:00:00 2001 From: irov Date: Tue, 12 Dec 2023 20:52:50 +0200 Subject: [PATCH] Wip apple firebase performance --- ...AppleFirebasePerformanceMonitoringInterface.h | 16 ++++++++++++++++ .../AppleFirebasePerformanceMonitoringService.h | 5 ++++- .../AppleFirebasePerformanceMonitoringService.mm | 7 +++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringInterface.h b/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringInterface.h index ebfe411909..22f1320466 100644 --- a/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringInterface.h +++ b/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringInterface.h @@ -1,16 +1,32 @@ #pragma once #include "Interface/ServiceInterface.h" +#include "Interface/ServantInterface.h" #import namespace Mengine { + ////////////////////////////////////////////////////////////////////////// + class AppleFirebasePerformanceMonitoringTraceInterface + : public ServantInterface + { + public: + virtual void start() = 0; + virtual void stop() = 0; + }; + ////////////////////////////////////////////////////////////////////////// + typedef IntrusivePtr AppleFirebasePerformanceMonitoringTraceInterfacePtr; + ////////////////////////////////////////////////////////////////////////// class AppleFirebasePerformanceMonitoringServiceInterface : public ServiceInterface { SERVICE_DECLARE( "AppleFirebasePerformanceMonitoringService" ) + + public: + virtual AppleFirebasePerformanceMonitoringTraceInterfacePtr createTrace( const ConstString & _name ) = 0; }; + ////////////////////////////////////////////////////////////////////////// } ////////////////////////////////////////////////////////////////////////// #define APPLE_FIREBASE_PERFORMANCEMONITORING_SERVICE()\ diff --git a/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringService.h b/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringService.h index a6cd4a1815..4c8c301396 100644 --- a/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringService.h +++ b/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringService.h @@ -1,6 +1,6 @@ #pragma once -#include "AppleFirebasePerformanceMonitoringServiceInterface.h" +#include "AppleFirebasePerformanceMonitoringInterface.h" #include "Kernel/ServiceBase.h" @@ -16,5 +16,8 @@ namespace Mengine protected: bool _initializeService() override; void _finalizeService() override; + + public: + AppleFirebasePerformanceMonitoringTraceInterfacePtr createTrace( const ConstString & _name ) override; }; } diff --git a/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringService.mm b/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringService.mm index 651b6012f5..4a2e3c883e 100644 --- a/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringService.mm +++ b/src/Plugins/AppleFirebasePerformanceMonitoringPlugin/AppleFirebasePerformanceMonitoringService.mm @@ -31,4 +31,11 @@ //Empty } ////////////////////////////////////////////////////////////////////////// + AppleFirebasePerformanceMonitoringTraceInterfacePtr AppleFirebasePerformanceMonitoringService::createTrace( const ConstString & _name ) + { + //FIRTrace *trace = [[FIRPerformance sharedInstance] traceWithName:name]; + + return AppleFirebasePerformanceMonitoringTraceInterfacePtr::none(); + } + ////////////////////////////////////////////////////////////////////////// }