Beispiel #1
0
        private void logMemory()
        {
            messageBuilder.Length = 0;
            messageBuilder.Append("runtime-memory>");
            Disney.Kelowna.Common.Performance performance = Service.Get <Disney.Kelowna.Common.Performance>();
            performance.UpdateAssetMemoryUsage();
            Dictionary <Disney.Kelowna.Common.Performance.MemoryType, Disney.Kelowna.Common.Performance.Metric <int> > .Enumerator memoryMetricsEnumerator = performance.MemoryMetricsEnumerator;
            while (memoryMetricsEnumerator.MoveNext())
            {
                KeyValuePair <Disney.Kelowna.Common.Performance.MemoryType, Disney.Kelowna.Common.Performance.Metric <int> > current = memoryMetricsEnumerator.Current;
                messageBuilder.Append(" ");
                messageBuilder.Append(current.Key);
                messageBuilder.Append(": ");
                messageBuilder.Append(current.Value.Value);
            }
            if ((float)performance.TotalMemoryUsed.Value > 0f)
            {
                messageBuilder.Append(" Total: ");
                messageBuilder.Append(performance.TotalMemoryUsed.Value);
            }
            ulong processUsedBytes = Service.Get <MemoryMonitorManager>().GetProcessUsedBytes();

            messageBuilder.Append(" Native: ");
            messageBuilder.Append(processUsedBytes);
            logger.Print(messageBuilder.ToString());
        }
Beispiel #2
0
 private void logFrametime()
 {
     messageBuilder.Length = 0;
     Disney.Kelowna.Common.Performance performance = Service.Get <Disney.Kelowna.Common.Performance>();
     messageBuilder.Append("runtime-frametime> avg: ");
     messageBuilder.Append(performance.FrameTime.Average);
     messageBuilder.Append(" max: ");
     messageBuilder.Append(performance.FrameTime.Max);
     messageBuilder.Append(" min: ");
     messageBuilder.Append(performance.FrameTime.Min);
     logger.Print(messageBuilder.ToString());
 }
Beispiel #3
0
 private bool onRuntimeProfileStart(BenchmarkRuntimeProfileEvents.RuntimeProfileStart startEvent)
 {
     profiling    = true;
     pollRate     = startEvent.PollRate;
     memProfiling = startEvent.PollMemory;
     frameCount   = 0;
     Disney.Kelowna.Common.Performance performance = Service.Get <Disney.Kelowna.Common.Performance>();
     performance.AutomaticMemorySampling = false;
     performance.ResetMetrics();
     logger.Print("Runtime Profiling Starting. Profiling Memory = " + memProfiling);
     return(false);
 }
        public override IEnumerator PerformFirstPass()
        {
            _ = typeof(MemoryMonitorManager);
            Type typeFromHandle           = typeof(MemoryMonitorWindowsManager);
            MemoryMonitorManager instance = Service.Get <GameObject>().AddComponent(typeFromHandle) as MemoryMonitorManager;

            Service.Set(instance);
            Disney.Kelowna.Common.Performance performance = new Disney.Kelowna.Common.Performance();
            performance.AutomaticMemorySampling = false;
            Service.Set(performance);
            yield break;
        }
Beispiel #5
0
 private void initializeMetric()
 {
     if (!string.IsNullOrEmpty(data.MetricName))
     {
         Disney.Kelowna.Common.Performance performance = Service.Get <Disney.Kelowna.Common.Performance>();
         releasedMetric = performance.GetMetric <int>(data.MetricName);
         if (releasedMetric == null)
         {
             releasedMetric = new Disney.Kelowna.Common.Performance.Metric <int>(data.MetricName, data.MetricName + ": {0:0}", null, 1uL);
             performance.AddMetric(releasedMetric);
         }
         releasedMetric.ResetValues();
     }
 }
 public void OnEnable()
 {
     perf = Service.Get <Performance>();
 }
Beispiel #7
0
 private void Awake()
 {
     perf          = Service.Get <Disney.Kelowna.Common.Performance>();
     pendingTimers = new Dictionary <string, CPSwrveTimer>();
 }