#if BESTHTTP_PROFILE && UNITY_2021_2_OR_NEWER using Unity.Profiling; namespace Best.HTTP.Profiler.Network { public sealed class NetworkStats { public const string CategoryName = "Best - Network"; public static readonly ProfilerCategory Category = new ProfilerCategory(CategoryName, ProfilerCategoryColor.Scripts); // Sent public const string BufferedToSendName = "Buffered to Send"; public static readonly ProfilerCounterValue BufferedToSend = new ProfilerCounterValue(Category, BufferedToSendName, ProfilerMarkerDataUnit.Bytes, ProfilerCounterOptions.FlushOnEndOfFrame | ProfilerCounterOptions.ResetToZeroOnFlush); public const string SentSinceLastFrameName = "Sent (Since Last Frame)"; public static readonly ProfilerCounterValue SentSinceLastFrame = new ProfilerCounterValue(Category, SentSinceLastFrameName, ProfilerMarkerDataUnit.Bytes, ProfilerCounterOptions.FlushOnEndOfFrame | ProfilerCounterOptions.ResetToZeroOnFlush); public const string SentTotalName = "Sent Total"; public static readonly ProfilerCounterValue SentTotal = new ProfilerCounterValue(Category, SentTotalName, ProfilerMarkerDataUnit.Bytes, ProfilerCounterOptions.FlushOnEndOfFrame | ProfilerCounterOptions.ResetToZeroOnFlush); // Received public const string ReceivedSinceLastFrameName = "Received (Since Last Frame)"; public static readonly ProfilerCounterValue ReceivedSinceLastFrame = new ProfilerCounterValue(Category, ReceivedSinceLastFrameName, ProfilerMarkerDataUnit.Bytes, ProfilerCounterOptions.FlushOnEndOfFrame | ProfilerCounterOptions.ResetToZeroOnFlush); public const string ReceivedAndUnprocessedName = "Received and Unprocessed"; public static readonly ProfilerCounterValue ReceivedAndUnprocessed = new ProfilerCounterValue(Category, ReceivedAndUnprocessedName, ProfilerMarkerDataUnit.Bytes, ProfilerCounterOptions.FlushOnEndOfFrame | ProfilerCounterOptions.ResetToZeroOnFlush); public const string ReceivedTotalName = "Received Total"; public static readonly ProfilerCounterValue ReceivedTotal = new ProfilerCounterValue(Category, ReceivedTotalName, ProfilerMarkerDataUnit.Bytes, ProfilerCounterOptions.FlushOnEndOfFrame | ProfilerCounterOptions.ResetToZeroOnFlush); // Connections public const string OpenConnectionsName = "Open Connections"; public static readonly ProfilerCounterValue OpenConnectionsCounter = new ProfilerCounterValue(Category, OpenConnectionsName, ProfilerMarkerDataUnit.Count, ProfilerCounterOptions.FlushOnEndOfFrame); public const string TotalConnectionsName = "Total Connections"; public static readonly ProfilerCounterValue TotalConnectionsCounter = new ProfilerCounterValue(Category, TotalConnectionsName, ProfilerMarkerDataUnit.Count, ProfilerCounterOptions.FlushOnEndOfFrame); // DNS public const string TotalDNSCacheHits = "DNS Cache Hits"; public static readonly ProfilerCounterValue TotalDNSCacheHitsCounter = new ProfilerCounterValue(Category, TotalDNSCacheHits, ProfilerMarkerDataUnit.Count, ProfilerCounterOptions.FlushOnEndOfFrame); public const string TotalDNSCacheMiss = "DNS Cache Miss"; public static readonly ProfilerCounterValue TotalDNSCacheMissCounter = new ProfilerCounterValue(Category, TotalDNSCacheMiss, ProfilerMarkerDataUnit.Count, ProfilerCounterOptions.FlushOnEndOfFrame); } } #endif