private static bool RegisterEvent(string eventName) { const string vendorKey = "unity.tiny.editor"; var result = EditorAnalytics.RegisterEventWithLimit(eventName, 100, 1000, vendorKey); switch (result) { case AnalyticsResult.Ok: { #if UTINY_INTERNAL Debug.Log($"Tiny: Registered event: {eventName}"); #endif return(true); } case AnalyticsResult.TooManyRequests: // this is fine - event registration survives domain reload (native) return(true); default: { TraceError($"failed to register analytics event '{eventName}'. Result: '{result}'"); return(false); } } }
private bool RegisterEvent(string eventName) { const string vendorKey = "unity.testtools.codecoverage"; var result = EditorAnalytics.RegisterEventWithLimit(eventName, 100, 1000, vendorKey); switch (result) { case AnalyticsResult.Ok: { #if COVERAGE_ANALYTICS_LOGGING ResultsLogger.LogSessionItem($"Registered analytics event: {eventName}", LogVerbosityLevel.Info); #endif return(true); } case AnalyticsResult.TooManyRequests: // this is fine - event registration survives domain reload (native) return(true); default: { ResultsLogger.LogSessionItem($"Failed to register analytics event {eventName}. Result: {result}", LogVerbosityLevel.Error); return(false); } } }
private static bool RegisterEvent(string eventName) { const string vendorKey = "unity.scene-template"; var result = EditorAnalytics.RegisterEventWithLimit(eventName, 100, 1000, vendorKey); switch (result) { case AnalyticsResult.Ok: { #if PERFORMANCE_TRACKING_ANALYTICS_LOGGING Debug.Log($"SceneTemplate: Registered event: {eventName}"); #endif return(true); } case AnalyticsResult.TooManyRequests: // this is fine - event registration survives domain reload (native) return(true); default: { Console.WriteLine($"[ST] Failed to register analytics event '{eventName}'. Result: '{result}'"); return(false); } } }
static bool EnableAnalytics() { if (s_EventsRegistered) { return(true); } #if UNITY_EDITOR AnalyticsResult result = EditorAnalytics.RegisterEventWithLimit(k_RemotePolicyInitializedEventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey); #else AnalyticsResult result = AnalyticsResult.UnsupportedPlatform; #endif if (result != AnalyticsResult.Ok) { return(false); } s_EventsRegistered = true; if (s_SentRemotePolicyInitialized == null) { s_SentRemotePolicyInitialized = new HashSet <string>(); s_TrainingSessionGuid = Guid.NewGuid(); } return(s_EventsRegistered); }
static bool EnableAnalytics() { #if MLA_UNITY_ANALYTICS_MODULE_ENABLED if (s_EventsRegistered) { return(true); } foreach (var eventName in s_EventNames) { #if UNITY_EDITOR AnalyticsResult result = EditorAnalytics.RegisterEventWithLimit(eventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey); if (result != AnalyticsResult.Ok) { return(false); } #else return(false); #endif // UNITY_EDITOR } s_EventsRegistered = true; if (s_SentRemotePolicyInitialized == null) { s_SentRemotePolicyInitialized = new HashSet <string>(); s_SentTrainingBehaviorInitialized = new HashSet <string>(); s_TrainingSessionGuid = Guid.NewGuid(); } return(s_EventsRegistered); #else return(false); #endif // MLA_UNITY_ANALYTICS_MODULE_ENABLED }
public static void SendEvent() { if (!EditorAnalytics.enabled) { return; } var hdrpAsset = HDRenderPipeline.currentAsset; if (hdrpAsset == null) { return; } if (EditorAnalytics.RegisterEventWithLimit(k_EventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey) != AnalyticsResult.Ok) { return; } RenderPipelineSettings settings = hdrpAsset.currentPlatformRenderPipelineSettings; RenderPipelineSettings defaults = RenderPipelineSettings.NewDefault(); var data = new EventData(DiffSettings(settings, defaults)); EditorAnalytics.SendEventWithLimit(k_EventName, data); }
static bool EnableAnalytics() { if (s_EventRegistered) { return(true); } #if UNITY_EDITOR && MLA_UNITY_ANALYTICS_MODULE AnalyticsResult result = EditorAnalytics.RegisterEventWithLimit(k_EventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey, k_EventVersion); if (result == AnalyticsResult.Ok) { s_EventRegistered = true; } #elif MLA_UNITY_ANALYTICS_MODULE AnalyticsResult result = AnalyticsResult.UnsupportedPlatform; if (result == AnalyticsResult.Ok) { s_EventRegistered = true; } #endif if (s_EventRegistered && s_SentModels == null) { s_SentModels = new HashSet <NNModel>(); } return(s_EventRegistered); }
public static void SendEvent() { if (!EditorAnalytics.enabled) { return; } var activeBuildTarget = EditorUserBuildSettings.activeBuildTarget; var qualityLevelCount = QualitySettings.names.Length; for (int i = 0; i < QualitySettings.names.Length; ++i) { var hdrpAsset = QualitySettings.GetRenderPipelineAssetAt(i) as HDRenderPipelineAsset; if (hdrpAsset != null) { if (EditorAnalytics.RegisterEventWithLimit(k_UsageEventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey, k_UsageCurrentVersion) != AnalyticsResult.Ok) { continue; } RenderPipelineSettings settings = hdrpAsset.currentPlatformRenderPipelineSettings; RenderPipelineSettings defaults = RenderPipelineSettings.NewDefault(); var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(hdrpAsset.GetInstanceID())); var data = new UsageEventData(activeBuildTarget, guid, DiffSettings(settings, defaults)); EditorAnalytics.SendEventWithLimit(k_UsageEventName, data, k_UsageCurrentVersion); } } }
private static bool RegisterEvent(string eventName) { const string vendorKey = "unity.quicksearch"; var result = EditorAnalytics.RegisterEventWithLimit(eventName, 100, 1000, vendorKey); switch (result) { case AnalyticsResult.Ok: { #if QUICKSEARCH_ANALYTICS_LOGGING Debug.Log($"QuickSearch: Registered event: {eventName}"); #endif return(true); } case AnalyticsResult.TooManyRequests: // this is fine - event registration survives domain reload (native) return(true); default: { Console.WriteLine($"[QS] Failed to register analytics event '{eventName}'. Result: '{result}'"); return(false); } } }
private static bool Initialize() { #if ENABLE_TEST_SUPPORT || !UNITY_ANALYTICS return(false); #else if (s_Initialized) { return(true); } #if UNITY_EDITOR if (!EditorAnalytics.enabled) { return(false); } if (AnalyticsResult.Ok != EditorAnalytics.RegisterEventWithLimit(kEventInitialize, kMaxEventsPerHour, kMaxNumberOfElements, kVendorKey)) #else if (AnalyticsResult.Ok != Analytics.Analytics.RegisterEvent(kEventInitialize, kMaxEventsPerHour, kMaxNumberOfElements, kVendorKey)) #endif { return(false); } s_Initialized = true; return(true); #endif }
static bool EnableAnalytics() { var res = EditorAnalytics.RegisterEventWithLimit(k_EventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey); s_EventRegistered = res == AnalyticsResult.Ok; return(s_EventRegistered); }
private void SetupAnalytics() { int maxEventsPerHour = 100; int maxNumberOfElementInStruct = 100; string vendorKey = "unity.immediate-window"; EditorAnalytics.RegisterEventWithLimit("evaluatecode", maxEventsPerHour, maxNumberOfElementInStruct, vendorKey); }
public long ts; // in milliseconds public static void Setup() { int maxEventsPerHour = 1000; int maxNumberOfElementInStruct = 100; string vendorKey = "unity.package-manager-ui"; EditorAnalytics.RegisterEventWithLimit("packageManagerWindowUserAction", maxEventsPerHour, maxNumberOfElementInStruct, vendorKey); }
public void RegisterAnalyticsEvent(string name, int maxPerHour, int maxPropertiesPerEvent) { const string vendorKey = "unity.input"; #if UNITY_EDITOR EditorAnalytics.RegisterEventWithLimit(name, maxPerHour, maxPropertiesPerEvent, vendorKey); #else Analytics.Analytics.RegisterEvent(name, maxPerHour, maxPropertiesPerEvent, vendorKey); #endif }
public static void EnableAnalytics() { #if UNITY_2018_1_OR_NEWER AnalyticsResult result = EditorAnalytics.RegisterEventWithLimit(k_EventTopicName, k_MaxEventsPerHour, k_MaxEventItems, k_VendorKey); if (result == AnalyticsResult.Ok) { s_EnableAnalytics = true; } #endif }
//Returns true if registering the event was successful private static bool RegisterEvent() { AnalyticsResult registerEvent = EditorAnalytics.RegisterEventWithLimit(EventName, 100, 100, VendorKey); if (registerEvent == AnalyticsResult.Ok) { _eventRegistered = true; } return(_eventRegistered); }
static bool EnableAnalytics() { AnalyticsResult result = EditorAnalytics.RegisterEventWithLimit(k_EventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey); if (result == AnalyticsResult.Ok) { s_EventRegistered = true; } return(s_EventRegistered); }
static bool RegisterEvent(string name) { AnalyticsResult result = EditorAnalytics.RegisterEventWithLimit(name, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey); if (result != AnalyticsResult.Ok) { DebugError("Error in RegisterEvent: {0}", result); return(false); } return(true); }
private static void SetUpIfNeeded() { if (isSetUp) { return; } isSetUp = true; EditorAnalytics.RegisterEventWithLimit(RunFinishedEventName, 60, 30, VendorKey); EditorAnalytics.RegisterEventWithLimit(AnalyzeTestTreeName, 3, 30, VendorKey); }
public AnalyticsResult SendData(string eventString, IAnalyticsData data) { //Debug.Log("Sent Data " + JsonUtility.ToJson(data)); if (false == s_Initialize) { EditorAnalytics.RegisterEventWithLimit(AnalyticsDataTypes.k_LightDataString, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey, k_Version); EditorAnalytics.RegisterEventWithLimit(AnalyticsDataTypes.k_Renderer2DDataString, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey, k_Version); s_Initialize = true; } return(EditorAnalytics.SendEventWithLimit(eventString, data, k_Version)); }
private static bool RegisterEvent() { if (!_isRegistered) { var result = EditorAnalytics.RegisterEventWithLimit(EventName, MaxEventsPerHour, MaxNumberOfElements, VendorKey); if (result == UnityEngine.Analytics.AnalyticsResult.Ok) { _isRegistered = true; } } return(_isRegistered); }
static bool RegisterEvent() { #if UNITY_EDITOR AnalyticsResult result = EditorAnalytics.RegisterEventWithLimit(k_EventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey, k_VersionId); #else // IF !UNITY_EDITOR AnalyticsResult result = Analytics.RegisterEvent(k_EventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey, k_VersionId); #endif bool isResultOk = result == AnalyticsResult.Ok; return(isResultOk); }
public static void SendStopEvent(RecorderController controller, bool error) { if (!EditorAnalytics.enabled) { return; } EditorAnalytics.RegisterEventWithLimit(completeEventName, maxEventsPerHour, maxNumberOfElements, vendorKey); var data = CreateStopEvent(controller, error); EditorAnalytics.SendEventWithLimit(completeEventName, data); }
private static void SendEvent <T>(T eventObject, string eventName) { #if UNITY_EDITOR if (!EditorAnalytics.enabled) { return; } EditorAnalytics.RegisterEventWithLimit(eventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey); EditorAnalytics.SendEventWithLimit(eventName, eventObject); #endif }
// Used by the Timeline public static void SendStartEvent(RecordingSession session) { if (!EditorAnalytics.enabled) { return; } EditorAnalytics.RegisterEventWithLimit(startEventName, maxEventsPerHour, maxNumberOfElements, vendorKey); var data = CreateSessionStartEvent(session); // Send the data to the database EditorAnalytics.SendEventWithLimit(startEventName, data); }
public static void SendStopEvent(RecordingSession session, bool error, bool complete) { if (!EditorAnalytics.enabled) { return; } EditorAnalytics.RegisterEventWithLimit(completeEventName, maxEventsPerHour, maxNumberOfElements, vendorKey); var data = CreateStopEvent(session, error, complete); // Send the data to the database EditorAnalytics.SendEventWithLimit(completeEventName, data); }
static bool TryRegisterEvents() { if (s_IsRegistered) { return(true); } var success = true; success &= EditorAnalytics.RegisterEventWithLimit(k_RunInUnitySimulationName, k_MaxEventsPerHour, k_MaxItems, k_VendorKey) == AnalyticsResult.Ok; s_IsRegistered = success; return(success); }
public static void SendEvent(bool buttonClick) { if (!EditorAnalytics.enabled) { return; } EditorAnalytics.RegisterEventWithLimit(k_EventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey); AnalyticsData data = new AnalyticsData() { create_simulation_btn_click = buttonClick }; EditorAnalytics.SendEventWithLimit(k_EventName, data); }
public static void SendDefaultValuesEvent() { if (!EditorAnalytics.enabled) { return; } if (EditorAnalytics.RegisterEventWithLimit(k_DefaultsEventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey) != AnalyticsResult.Ok) { return; } RenderPipelineSettings defaults = RenderPipelineSettings.NewDefault(); var data = new DefaultsEventData(AllSettings(defaults)); EditorAnalytics.SendEventWithLimit(k_DefaultsEventName, data); }
/// <summary> /// Send analytics event when using entering playmode /// </summary> /// <param name="state">State change to detect entering playmode</param> static void SendAnalyticsOnPlayEnter(PlayModeStateChange state) { // Only send analytics if it is enabled if (!EditorAnalytics.enabled) { return; } // Only send data when entering playmode if (state != PlayModeStateChange.EnteredPlayMode) { return; } var startTime = Time.realtimeSinceStartup; var cinemachineCore = CinemachineCore.Instance; var vcamCount = cinemachineCore.VirtualCameraCount; var vcamDatas = new List <VcamData>(); // collect data from all vcams for (int i = 0; i < vcamCount; ++i) { var vcamBase = cinemachineCore.GetVirtualCamera(i); CollectData(vcamBase, i.ToString(), ref vcamDatas); } var projectData = new ProjectData { brain_count = cinemachineCore.BrainCount, vcam_count = cinemachineCore.VirtualCameraCount, cam_count = Camera.allCamerasCount, vcams = vcamDatas, time_elapsed = Time.realtimeSinceStartup - startTime, }; // Register our event EditorAnalytics.RegisterEventWithLimit("cm_vcams_on_play", k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey); // Send the data to the database EditorAnalytics.SendEventWithLimit("cm_vcams_on_play", projectData); }