From 64654257a15bd5efff85fdb7befe4308f477a2ea Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Wed, 27 Jul 2016 15:53:28 +0100 Subject: [PATCH] Track a few high-frequency events only once. --- services/web/public/coffee/ide.coffee | 6 +++--- .../public/coffee/ide/pdf/controllers/PdfController.coffee | 4 ++-- .../coffee/ide/share/controllers/ShareController.coffee | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index e984b408d5..c34482fca0 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -72,13 +72,13 @@ define [ # Tracking code. $scope.$watch "ui.view", (newView, oldView) -> if newView? and newView != "editor" and newView != "pdf" - event_tracking.sendCountly "ide-open-view-#{ newView }" + event_tracking.sendCountlyOnce "ide-open-view-#{ newView }" $scope.$watch "ui.chatOpen", (isOpen) -> - event_tracking.sendCountly "ide-open-chat" if isOpen + event_tracking.sendCountlyOnce "ide-open-chat" if isOpen $scope.$watch "ui.leftMenuShown", (isOpen) -> - event_tracking.sendCountly "ide-open-left-menu" if isOpen + event_tracking.sendCountlyOnce "ide-open-left-menu" if isOpen # End of tracking code. window._ide = ide diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 36c0b1cdae..f9daf4315a 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -333,7 +333,7 @@ define [ $scope.toggleLogs = () -> $scope.shouldShowLogs = !$scope.shouldShowLogs - event_tracking.sendCountly "ide-open-logs" if $scope.shouldShowLogs + event_tracking.sendCountlyOnce "ide-open-logs" if $scope.shouldShowLogs $scope.showPdf = () -> $scope.pdf.view = "pdf" @@ -499,7 +499,7 @@ define [ App.controller "PdfLogEntryController", ["$scope", "ide", "event_tracking", ($scope, ide, event_tracking) -> $scope.openInEditor = (entry) -> - event_tracking.sendCountly 'logs-jump-to-location' + event_tracking.sendCountlyOnce 'logs-jump-to-location' entity = ide.fileTreeManager.findEntityByPath(entry.file) return if !entity? or entity.type != "doc" if entry.line? diff --git a/services/web/public/coffee/ide/share/controllers/ShareController.coffee b/services/web/public/coffee/ide/share/controllers/ShareController.coffee index fc74862528..9f338ae48d 100644 --- a/services/web/public/coffee/ide/share/controllers/ShareController.coffee +++ b/services/web/public/coffee/ide/share/controllers/ShareController.coffee @@ -3,7 +3,7 @@ define [ ], (App) -> App.controller "ShareController", ["$scope", "$modal", "event_tracking", ($scope, $modal, event_tracking) -> $scope.openShareProjectModal = () -> - event_tracking.sendCountly "ide-open-share-modal" + event_tracking.sendCountlyOnce "ide-open-share-modal" $modal.open( templateUrl: "shareProjectModalTemplate"