コード例 #1
0
        public static MachineMetrics Create(MachineMetricsCategory category = MachineMetricsCategory.All)
        {
            var metrics = new MachineMetrics();

            if (category.HasFlag(MachineMetricsCategory.PhysicalDisk))
            {
                metrics.InstallPhysicalDisk();
            }

            if (category.HasFlag(MachineMetricsCategory.LogicalDisk))
            {
                metrics.InstallLogicalDisk();
            }

            if (category.HasFlag(MachineMetricsCategory.LocksAndThreads))
            {
                metrics.InstallClrLocksAndThreads();
            }

            if (category.HasFlag(MachineMetricsCategory.Memory))
            {
                metrics.InstallClrMemory();
            }

            return(metrics);
        }
コード例 #2
0
        public static MachineMetrics Create(MachineMetricsCategory category = MachineMetricsCategory.All)
        {
            var metrics = new MachineMetrics();
            if (category.HasFlag(MachineMetricsCategory.PhysicalDisk))
                metrics.InstallPhysicalDisk();

            if (category.HasFlag(MachineMetricsCategory.LogicalDisk))
                metrics.InstallLogicalDisk();

            if (category.HasFlag(MachineMetricsCategory.LocksAndThreads))
                metrics.InstallClrLocksAndThreads();

            if (category.HasFlag(MachineMetricsCategory.Memory))
                metrics.InstallClrMemory();

            return metrics;
        }