public IResourcePerformanceCounter CreateCounter(Guid resourceId, WarewolfPerfCounterType type, string name) { if (GetCounter(resourceId, type) == EmptyCounter) { IResourcePerformanceCounter counter; switch (type) { case WarewolfPerfCounterType.ExecutionErrors: counter = new WarewolfNumberOfErrorsByResource(resourceId, name); break; case WarewolfPerfCounterType.AverageExecutionTime: counter = new WarewolfAverageExecutionTimePerformanceCounterByResource(resourceId, name); break; case WarewolfPerfCounterType.ConcurrentRequests: counter = new WarewolfCurrentExecutionsPerformanceCounterByResource(resourceId, name); break; case WarewolfPerfCounterType.RequestsPerSecond: counter = new WarewolfRequestsPerSecondPerformanceCounterByResource(resourceId, name); break; default: return(new EmptyCounter()); } _resourceCounters.Add(counter); _perf.Save(_resourceCounters, EnvironmentVariables.ServerResourcePerfmonSettingsFile); return(counter); } return((IResourcePerformanceCounter)GetCounter(resourceId, type).FromSafe()); }
public WarewolfCurrentExecutionsPerformanceCounter(IRealPerformanceCounterFactory performanceCounterFactory) : base(performanceCounterFactory) { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.ConcurrentRequests; }
public WarewolfAverageExecutionTimePerformanceCounter(IRealPerformanceCounterFactory performanceCounterFactory) : base(performanceCounterFactory) { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.AverageExecutionTime; }
public WarewolfNumberOfErrors(IRealPerformanceCounterFactory performanceCounterFactory) : base(performanceCounterFactory) { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.ExecutionErrors; }
public WarewolfNumberOfAuthErrors(IRealPerformanceCounterFactory performanceCounterFactory) : base(performanceCounterFactory) { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.NotAuthorisedErrors; }
public WarewolfServicesNotFoundCounter(IRealPerformanceCounterFactory performanceCounterFactory) : base(performanceCounterFactory) { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.ServicesNotFound; }
public TestCounter(WarewolfPerfCounterType warewolfPerfCounterType, bool isActive = true) { Category = ""; Name = "bob"; IsActive = isActive; PerfCounterType = warewolfPerfCounterType; }
public WarewolfNumberOfErrorsByResource(Guid resourceId, string categoryInstanceName) { ResourceId = resourceId; CategoryInstanceName = categoryInstanceName; _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.ExecutionErrors; }
public WarewolfCurrentExecutionsPerformanceCounterByResource(Guid resourceId, string categoryInstanceName) { ResourceId = resourceId; CategoryInstanceName = categoryInstanceName; _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.ConcurrentRequests; }
public DefaultCounterTest(Guid resourceId, string name, WarewolfPerfCounterType type) { _resourceId = resourceId; CategoryInstanceName = name; _started = false; IsActive = true; _perfCounterType = type; }
public WarewolfAverageExecutionTimePerformanceCounterByResource(Guid resourceId, string categoryInstanceName) { ResourceId = resourceId; CategoryInstanceName = categoryInstanceName; _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.AverageExecutionTime; }
public TestResourceCounter(WarewolfPerfCounterType warewolfPerfCounterType, Guid resourceId) { Category = ""; Name = "bob"; PerfCounterType = warewolfPerfCounterType; ResourceId = resourceId; CategoryInstanceName = "bobcat"; }
public IPerformanceCounter GetCounter(Guid resourceId, WarewolfPerfCounterType type) { try { var returnValue = _resourceCounters.Where(a => a is IResourcePerformanceCounter).Cast <IResourcePerformanceCounter>().First(a => a.ResourceId == resourceId && a.PerfCounterType == type).ToSafe(); return(returnValue); } catch (Exception) { return(EmptyCounter); } }
public void RemoverCounter(Guid resourceId, WarewolfPerfCounterType type, string name) { var toRemove = _resourceCounters.FirstOrDefault(a => { var resourcePerformanceCounter = a as IResourcePerformanceCounter; return(resourcePerformanceCounter != null && (resourcePerformanceCounter.ResourceId == resourceId && resourcePerformanceCounter.PerfCounterType == type)); }); if (toRemove != null) { _resourceCounters.Remove(toRemove); _perf.Save(_resourceCounters, EnvironmentVariables.ServerResourcePerfmonSettingsFile); } }
public WarewolfAverageExecutionTimePerformanceCounter() { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.AverageExecutionTime; }
public WarewolfNumberOfAuthErrors() { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.NotAuthorisedErrors; }
public IPerformanceCounter GetCounter(WarewolfPerfCounterType type) => _counters.First(a => a.PerfCounterType == type).ToSafe();
public WarewolfServicesNotFoundCounter() { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.ServicesNotFound; }
public WarewolfNumberOfErrors() { _started = false; IsActive = true; _perfCounterType = WarewolfPerfCounterType.ExecutionErrors; }