Beispiel #1
0
        private void OnLowMemory()
        {
            if (!InternalConfig.GetInstance().monitoring_enabled)
            {
                return;
            }

            Elephant.Event("Application_low_memory", MonitoringUtils.GetInstance().GetCurrentLevel());
        }
Beispiel #2
0
        private void LogMonitoringData()
        {
            _fps = (1f / Time.unscaledDeltaTime);

            if (Time.time > _nextActionTime)
            {
                _nextActionTime += _period;
                MonitoringUtils.GetInstance().LogFps(Math.Round(_fps, 1));
                MonitoringUtils.GetInstance().LogCurrentLevel();
            }
        }
        private MonitoringData()
        {
            fpsLogs = new List <double>();
            fpsLogs.AddRange(MonitoringUtils.GetInstance().GetFpsSessionLog());

            currentLevelLog = new List <int>();
            currentLevelLog.AddRange(MonitoringUtils.GetInstance().GetCurrentLevelLog());

            systemMemory = SystemInfo.systemMemorySize;

            MonitoringUtils.GetInstance().Flush();
        }
Beispiel #4
0
        // iOS only!
        // No-op for Android.
        private void ReportLatestCrashLog()
        {
            if (!InternalConfig.GetInstance().monitoring_enabled)
            {
                return;
            }

            var report = CrashReport.lastReport;

            if (report == null)
            {
                return;
            }

            var parameters = Params.New();

            parameters.Set("time", report.time.ToString(CultureInfo.CurrentCulture));
            parameters.Set("text", report.text);
            Elephant.Event("Application_last_crash_log", MonitoringUtils.GetInstance().GetCurrentLevel(), parameters);
        }
 public static MonitoringUtils GetInstance()
 {
     return(_instance ?? (_instance = new MonitoringUtils()));
 }
Beispiel #6
0
 public static void LevelStarted(int level, Params parameters = null)
 {
     MonitoringUtils.GetInstance().SetCurrentLevel(level);
     CustomEvent(LEVEL_STARTED, level, parameters);
 }