public CounterControl() { // Check user is Administrator and has granted UAC elevation permission to run this app var userIdent = WindowsIdentity.GetCurrent(); var userPrincipal = new WindowsPrincipal(userIdent); IsRunningAsAdministrator = userPrincipal.IsInRole(WindowsBuiltInRole.Administrator); perfCounterConsumer = new OrleansPerfCounterTelemetryConsumer(); }
/// <summary> /// Constructors -- Registers Orleans system performance counters, /// plus any grain-specific activation counters that can be detected when this installer is run. /// </summary> public OrleansPerformanceCounterInstaller() { Trace.Listeners.Clear(); var cfg = new NodeConfiguration { TraceFilePattern = null, TraceToConsole = false }; LogManager.Initialize(cfg); consumer = new OrleansPerfCounterTelemetryConsumer(); }
/// <summary> /// Installs predefined performance counters logged by this telemetry consumer. /// </summary> /// <param name="stateSaver">An <see cref="T:System.Collections.IDictionary" /> used to save information needed to perform a commit, rollback, or uninstall operation. </param> public override void Install(IDictionary stateSaver) { consumer.InstallCounters(); if (OrleansPerfCounterTelemetryConsumer.AreWindowsPerfCountersAvailable()) Context.LogMessage("Orleans counters registered successfully"); else Context.LogMessage("Orleans counters are NOT registered"); base.Install(stateSaver); }
/// <summary> /// Constructors -- Registers Orleans system performance counters, /// plus any grain-specific activation counters that can be detected when this installer is run. /// </summary> public OrleansPerformanceCounterInstaller() { Trace.Listeners.Clear(); var cfg = new NodeConfiguration { TraceFilePattern = null, TraceToConsole = false }; LogManager.Initialize(cfg); var siloAssemblyLoader = new SiloAssemblyLoader(new NodeConfiguration(), null); LogManager.GrainTypes = siloAssemblyLoader.GetGrainClassTypes().Keys.ToList(); consumer = new OrleansPerfCounterTelemetryConsumer(); }
/// <summary> /// Constructors -- Registers Orleans system performance counters, /// plus any grain-specific activation counters that can be detected when this installer is run. /// </summary> public OrleansPerformanceCounterInstaller() { Trace.Listeners.Clear(); var cfg = new NodeConfiguration { TraceFilePattern = null }; var loggerFactory = CreateDefaultLoggerFactory(cfg.TraceFileName); var siloAssemblyLoader = new SiloAssemblyLoader(new NodeConfiguration(), null, new LoggerWrapper <SiloAssemblyLoader>(loggerFactory)); CrashUtils.GrainTypes = siloAssemblyLoader.GetGrainClassTypes().Keys.ToList(); consumer = new OrleansPerfCounterTelemetryConsumer(loggerFactory); this.logger = loggerFactory.CreateLogger <OrleansPerformanceCounterInstaller>(); }
/// <summary> /// Constructors -- Registers Orleans system performance counters, /// plus any grain-specific activation counters that can be detected when this installer is run. /// </summary> public OrleansPerformanceCounterInstaller() { Trace.Listeners.Clear(); var loggerFactory = CreateDefaultLoggerFactory($"{this.GetType()}.log"); var parts = new ApplicationPartManager(); parts.ConfigureDefaults().AddFeatureProvider(new AssemblyAttributeFeatureProvider <GrainClassFeature>()); var grainClassFeature = parts.CreateAndPopulateFeature <GrainClassFeature>(); CrashUtils.GrainTypes = grainClassFeature.Classes.Select(metadata => TypeUtils.GetFullName(metadata.ClassType)).ToList(); consumer = new OrleansPerfCounterTelemetryConsumer(loggerFactory); this.logger = loggerFactory.CreateLogger <OrleansPerformanceCounterInstaller>(); }
/// <summary> /// Constructors -- Registers Orleans system performance counters, /// plus any grain-specific activation conters that can be detected when this installer is run. /// </summary> public OrleansPerformanceCounterInstaller() { SerializationTestEnvironment.Initialize(); Trace.Listeners.Clear(); var cfg = new NodeConfiguration { TraceFilePattern = null, TraceToConsole = false }; LogManager.Initialize(cfg); consumer = new OrleansPerfCounterTelemetryConsumer(); if (GrainTypeManager.Instance == null) { var loader = new SiloAssemblyLoader(new Dictionary<string, SearchOption>()); var typeManager = new GrainTypeManager(false, loader, new RandomPlacementDefaultStrategy()); GrainTypeManager.Instance.Start(false); } }
/// <summary> /// Constructors -- Registers Orleans system performance counters, /// plus any grain-specific activation conters that can be detected when this installer is run. /// </summary> public OrleansPerformanceCounterInstaller() { SerializationManager.InitializeForTesting(); Trace.Listeners.Clear(); var cfg = new NodeConfiguration { TraceFilePattern = null, TraceToConsole = false }; LogManager.Initialize(cfg); consumer = new OrleansPerfCounterTelemetryConsumer(); if (GrainTypeManager.Instance == null) { var loader = new SiloAssemblyLoader(new Dictionary<string, SearchOption>()); var typeManager = new GrainTypeManager(false, null, loader); // We shouldn't need GrainFactory in this case GrainTypeManager.Instance.Start(false); } }
/// <summary> /// Constructors -- Registers Orleans system performance counters, /// plus any grain-specific activation conters that can be detected when this installer is run. /// </summary> public OrleansPerformanceCounterInstaller() { SerializationManager.InitializeForTesting(); Trace.Listeners.Clear(); var cfg = new NodeConfiguration { TraceFilePattern = null, TraceToConsole = false }; LogManager.Initialize(cfg); consumer = new OrleansPerfCounterTelemetryConsumer(); if (GrainTypeManager.Instance == null) { var loader = new SiloAssemblyLoader(new Dictionary <string, SearchOption>()); var typeManager = new GrainTypeManager(false, null, loader); // We shouldn't need GrainFactory in this case GrainTypeManager.Instance.Start(false); } }
/// <summary> /// Constructors -- Registers Orleans system performance counters, /// plus any grain-specific activation counters that can be detected when this installer is run. /// </summary> public OrleansPerformanceCounterInstaller() { Trace.Listeners.Clear(); var cfg = new NodeConfiguration { TraceFilePattern = null }; var loggerFactory = CreateDefaultLoggerFactory(cfg.TraceFileName); var parts = new ApplicationPartManager(); parts.AddApplicationPartsFromAppDomain(); parts.AddApplicationPartsFromBasePath(); parts.AddFeatureProvider(new AssemblyAttributeFeatureProvider <GrainClassFeature>()); var grainClassFeature = parts.CreateAndPopulateFeature <GrainClassFeature>(); CrashUtils.GrainTypes = grainClassFeature.Classes.Select(metadata => TypeUtils.GetFullName(metadata.ClassType)).ToList(); consumer = new OrleansPerfCounterTelemetryConsumer(loggerFactory); this.logger = loggerFactory.CreateLogger <OrleansPerformanceCounterInstaller>(); }
/// <summary> /// Removes performance counters installed by this telemetry consumers. /// </summary> /// <param name="savedState">An <see cref="T:System.Collections.IDictionary" /> that contains the state of the computer after the installation was complete. </param> public override void Uninstall(IDictionary savedState) { if (!OrleansPerfCounterTelemetryConsumer.AreWindowsPerfCountersAvailable(this.logger)) { Context.LogMessage("Orleans counters are already unregistered"); } else { try { consumer.DeleteCounters(); } catch (Exception exc) { Context.LogMessage("Error deleting old Orleans counters - {0}" + exc); } } base.Uninstall(savedState); }