コード例 #1
0
        public InvokeInterceptor GetInvokeInterceptor()
        {
#pragma warning disable 618
            return(runtime.GetInvokeInterceptor());

#pragma warning restore 618
        }
コード例 #2
0
        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);

        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public InvokeInterceptor GetInvokeInterceptor()
 {
     return(providerRuntime.GetInvokeInterceptor());
 }
コード例 #7
0
 public InvokeInterceptor GetInvokeInterceptor()
 {
     return(runtime.GetInvokeInterceptor());
 }