using System; ////TODO: provide total metric for amount of unmanaged memory (device state + action state) namespace UnityEngine.InputSystem.LowLevel { /// /// Provides information on the level of throughput going through the system. /// /// [Serializable] public struct InputMetrics { /// /// Maximum number of devices that were concurrently added to the system. /// /// public int maxNumDevices { get; set; } /// /// Number of devices currently added to the system. /// /// public int currentNumDevices { get; set; } /// /// The largest the combined state memory for all devices got. /// public int maxStateSizeInBytes { get; set; } /// /// Total size of the combined state memory for all current devices. /// public int currentStateSizeInBytes { get; set; } /// /// Total number of s currently alive in /// devices in the system. /// public int currentControlCount { get; set; } /// /// Total number of currently registered layouts. /// public int currentLayoutCount { get; set; } /// /// Total number of bytes of s consumed so far. /// public int totalEventBytes { get; set; } /// /// Total number of s consumed so far. /// public int totalEventCount { get; set; } /// /// Total number of input system updates run so far. /// /// public int totalUpdateCount { get; set; } /// /// Total time in seconds spent processing s so far. /// /// /// Event processing usually amounts for the majority of time spent in /// but not necessarily for all of it. /// /// public double totalEventProcessingTime { get; set; } /// /// Total accumulated time that has passed between when events were generated (see ) /// compared to when they were processed. /// public double totalEventLagTime { get; set; } /// /// Average size of the event buffer received on every . /// public float averageEventBytesPerFrame => (float)totalEventBytes / totalUpdateCount; ////REVIEW: we probably want better averaging than we get with this method; ideally, we should take averages //// each frame and then compute weighted averages as we go; the current method disregards updating spacing //// and event clustering entirely /// /// Average time in seconds spend on processing each individual . /// public double averageProcessingTimePerEvent => totalEventProcessingTime / totalEventCount; /// /// Average time it takes from when an event is generated to when it is processed. /// /// public double averageLagTimePerEvent => totalEventLagTime / totalEventCount; } }