void HeatmapViewModel_StartEndDateUpdated(string startDate, string endDate) { m_StartDate = startDate; m_EndDate = endDate; RawDataClient.GetInstance().m_DataPath = m_RawDataPath; ProcessAggregation(); }
void OnEnable() { if (m_RawDataClient == null) { Texture2D failedIcon = Resources.Load("unity_analytics_heatmaps_failed") as Texture2D; Texture2D completeIcon = Resources.Load("unity_analytics_heatmaps_success") as Texture2D; Texture2D runningIcon = Resources.Load("unity_analytics_heatmaps_running") as Texture2D; m_RawDataClient = RawDataClient.GetInstance(); if (m_DataSource == FETCH && !m_ValidManifest) { m_RawDataClient.GetJobs(GetJobsCompletionHandler); m_ValidManifest = true; } titleContent = new GUIContent("Raw Data"); m_FailedContent = new GUIContent(failedIcon, "Status: Failed"); m_CompleteContent = new GUIContent(completeIcon, "Status: Completed"); m_RunningContent = new GUIContent(runningIcon, "Status: Running"); return; } }
void ProcessAggregation() { //TODO: Where settings for aggregation go DateTime start, end; try { start = DateTime.Parse(m_StartDate).ToUniversalTime(); } catch { start = DateTime.Parse("2000-01-01").ToUniversalTime(); } try { end = DateTime.Parse(m_EndDate).ToUniversalTime().Add(new TimeSpan(24, 0, 0)); } catch { end = DateTime.UtcNow; } if (m_DateChangeHasOccurred || RawDataClient.GetInstance().m_ManifestInvalidated || HeatmapViewModel.m_RawDataFileList == null || HeatmapViewModel.m_RawDataFileList.Count == 0) { RawDataClient.GetInstance().m_DataPath = m_RawDataPath; HeatmapViewModel.m_RawDataFileList = RawDataClient.GetInstance().GetFiles( new UnityAnalyticsEventType[] { UnityAnalyticsEventType.custom }, start, end); m_DateChangeHasOccurred = false; if (HeatmapViewModel.m_RawDataFileList.Count == 0) { return; } } m_Aggregator.Process(HeatmapViewModel.m_RawDataFileList, start, end); }
/// <summary> /// Fetch the files within the currently specified date range. /// </summary> public void Fetch() { RawDataClient.GetInstance().m_DataPath = m_RawDataPath; ProcessAggregation(); }