public InvokeInterceptor GetInvokeInterceptor() { #pragma warning disable 618 return(runtime.GetInvokeInterceptor()); #pragma warning restore 618 }
public GrainProfiler(TaskScheduler taskScheduler, IProviderRuntime providerRuntime) { this.TaskScheduler = taskScheduler; this.ProviderRuntime = providerRuntime; // register interceptor, wrapping any previously set interceptor this.innerInterceptor = providerRuntime.GetInvokeInterceptor(); providerRuntime.SetInvokeInterceptor(this.InvokeInterceptor); siloAddress = providerRuntime.SiloIdentity.ToSiloAddress(); // register timer to report every second timer = new Timer(this.ProcessStats, providerRuntime, 1 * 1000, 1 * 1000); }
public GrainProfiler(TaskScheduler taskScheduler, IProviderRuntime providerRuntime) { this.TaskScheduler = taskScheduler; this.ProviderRuntime = providerRuntime; this.Logger = this.ProviderRuntime.GetLogger("GrainProfiler"); // register interceptor, wrapping any previously set interceptor this.innerInterceptor = providerRuntime.GetInvokeInterceptor(); providerRuntime.SetInvokeInterceptor(this.InvokeInterceptor); siloAddress = providerRuntime.SiloIdentity.ToSiloAddress(); // register timer to report every second timer = new Timer(this.ProcessStats, providerRuntime, 1 * 1000, 1 * 1000); }
public MetricsTrackerTelemetryConsumer(IProviderRuntime runtime, TaskScheduler taskScheduler) { try { Runtime = runtime; TaskScheduler = taskScheduler; logger = Runtime.GetLogger(nameof(MetricsTrackerTelemetryConsumer)); Configuration = new MetricsConfiguration(); Counters = new ConcurrentDictionary <string, long>(); CounterHistory = new ConcurrentDictionary <string, ConcurrentQueue <long> >(); Metrics = new ConcurrentDictionary <string, double>(); MetricHistory = new ConcurrentDictionary <string, ConcurrentQueue <double> >(); TimeSpanMetrics = new ConcurrentDictionary <string, TimeSpan>(); TimeSpanMetricHistory = new ConcurrentDictionary <string, ConcurrentQueue <TimeSpan> >(); Requests = new ConcurrentDictionary <string, MeasuredRequest>(); RequestHistory = new ConcurrentDictionary <string, ConcurrentQueue <MeasuredRequest> >(); PreviousInterceptor = Runtime.GetInvokeInterceptor(); // start a message pump to give ourselves the right synchronization context // from which we can communicate with grains via normal grain references // TODO: don't start the pump until it's been requested //StartMessagePump().Ignore(); //Task.Factory.StartNew(() => StartMessagePump(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler); var dispatchTask = Dispatch(() => StartMessagePump()); Management = Runtime.GrainFactory.GetGrain <IManagementGrain>(0); } catch (Exception ex) { logger.TrackException(ex); throw; } }
public GrainProfiler(TaskScheduler taskScheduler, IProviderRuntime providerRuntime) { this.TaskScheduler = taskScheduler; this.ProviderRuntime = providerRuntime; this.Logger = this.ProviderRuntime.GetLogger("GrainProfiler"); // check if custom method name formatter is registered var formatter = providerRuntime.ServiceProvider.GetService <Func <MethodInfo, InvokeMethodRequest, IGrain, string> >(); if (formatter != null) { formatMethodName = formatter; } // register interceptor, wrapping any previously set interceptor this.innerInterceptor = providerRuntime.GetInvokeInterceptor(); providerRuntime.SetInvokeInterceptor(this.InvokeInterceptor); siloAddress = providerRuntime.SiloIdentity.ToSiloAddress(); // register timer to report every second timer = new Timer(this.ProcessStats, providerRuntime, 1 * 1000, 1 * 1000); }
public InvokeInterceptor GetInvokeInterceptor() { return(providerRuntime.GetInvokeInterceptor()); }
public InvokeInterceptor GetInvokeInterceptor() { return(runtime.GetInvokeInterceptor()); }