From b9ff3260522e7f67e1535478f515b20f8692b474 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Wed, 20 Sep 2023 15:19:17 -0400 Subject: [PATCH 1/3] [ML Model Downloader] Migrate from Firelog to Clearcut logging endpoint --- FirebaseMLModelDownloader/CHANGELOG.md | 2 ++ .../Sources/TelemetryLogger.swift | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 FirebaseMLModelDownloader/CHANGELOG.md diff --git a/FirebaseMLModelDownloader/CHANGELOG.md b/FirebaseMLModelDownloader/CHANGELOG.md new file mode 100644 index 00000000000..f8f5d7a8f0a --- /dev/null +++ b/FirebaseMLModelDownloader/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased +- [changed] Migrated from the Firelog to Clearcut telemetry logging endpoint. diff --git a/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift b/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift index 179d895817a..f6f038a7d38 100644 --- a/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift +++ b/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift @@ -124,29 +124,29 @@ class TelemetryLogger { private let app: FirebaseApp /// Transport for Firelog events. - private let fllTransport: GDTCORTransport + private let clearcutTransport: GDTCORTransport /// Init logger, could be nil if unable to get event transport. init?(app: FirebaseApp) { self.app = app - guard let fllTransport = GDTCORTransport( + guard let clearcutTransport = GDTCORTransport( mappingID: mappingID, transformers: nil, - target: GDTCORTarget.FLL + target: GDTCORTarget.CCT ) else { DeviceLogger.logEvent(level: .debug, message: TelemetryLogger.ErrorDescription.initTelemetryLogger, messageCode: .telemetryInitError) return nil } - self.fllTransport = fllTransport + self.clearcutTransport = clearcutTransport } /// Log events to Firelog. private func logModelEvent(event: FirebaseMlLogEvent) { - let eventForTransport: GDTCOREvent = fllTransport.eventForTransport() + let eventForTransport: GDTCOREvent = clearcutTransport.eventForTransport() eventForTransport.dataObject = FBMLDataObject(event: event) - fllTransport.sendTelemetryEvent(eventForTransport) + clearcutTransport.sendTelemetryEvent(eventForTransport) } /// Log model deleted event to Firelog. From 0fc55a2a97210ce791b32839e3e42108f60bede1 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 30 Oct 2023 17:35:32 -0400 Subject: [PATCH 2/3] Add PR # to changelog entry --- FirebaseMLModelDownloader/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FirebaseMLModelDownloader/CHANGELOG.md b/FirebaseMLModelDownloader/CHANGELOG.md index f8f5d7a8f0a..d9915dc8578 100644 --- a/FirebaseMLModelDownloader/CHANGELOG.md +++ b/FirebaseMLModelDownloader/CHANGELOG.md @@ -1,2 +1,2 @@ # Unreleased -- [changed] Migrated from the Firelog to Clearcut telemetry logging endpoint. +- [changed] Migrated from the Firelog to Clearcut telemetry logging endpoint. (#11837) From 47a66e9365fde74bda7e4f5fb1d94cf3b7c176ed Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 30 Oct 2023 18:34:36 -0400 Subject: [PATCH 3/3] Revert changelog and rename var --- FirebaseMLModelDownloader/CHANGELOG.md | 2 -- .../Sources/TelemetryLogger.swift | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 FirebaseMLModelDownloader/CHANGELOG.md diff --git a/FirebaseMLModelDownloader/CHANGELOG.md b/FirebaseMLModelDownloader/CHANGELOG.md deleted file mode 100644 index d9915dc8578..00000000000 --- a/FirebaseMLModelDownloader/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Unreleased -- [changed] Migrated from the Firelog to Clearcut telemetry logging endpoint. (#11837) diff --git a/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift b/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift index f6f038a7d38..3580408f75f 100644 --- a/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift +++ b/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift @@ -124,12 +124,12 @@ class TelemetryLogger { private let app: FirebaseApp /// Transport for Firelog events. - private let clearcutTransport: GDTCORTransport + private let cctTransport: GDTCORTransport /// Init logger, could be nil if unable to get event transport. init?(app: FirebaseApp) { self.app = app - guard let clearcutTransport = GDTCORTransport( + guard let cctTransport = GDTCORTransport( mappingID: mappingID, transformers: nil, target: GDTCORTarget.CCT @@ -139,14 +139,14 @@ class TelemetryLogger { messageCode: .telemetryInitError) return nil } - self.clearcutTransport = clearcutTransport + self.cctTransport = cctTransport } /// Log events to Firelog. private func logModelEvent(event: FirebaseMlLogEvent) { - let eventForTransport: GDTCOREvent = clearcutTransport.eventForTransport() + let eventForTransport: GDTCOREvent = cctTransport.eventForTransport() eventForTransport.dataObject = FBMLDataObject(event: event) - clearcutTransport.sendTelemetryEvent(eventForTransport) + cctTransport.sendTelemetryEvent(eventForTransport) } /// Log model deleted event to Firelog.