public DashboardTelemetryProducer(ILocalSiloDetails localSiloDetails, IGrainFactory grainFactory, IExternalDispatcher dispatcher)
        {
            this.localSiloDetails = localSiloDetails;
            this.grainFactory     = grainFactory;
            this.dispatcher       = dispatcher;

            // register timer to report every second
            timer = new Timer(x => Flush(), null, 1 * 1000, 1 * 1000);
        }
예제 #2
0
        public Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config)
        {
            Name = name;

            dispatcher = providerRuntime.ServiceProvider.GetRequiredService <IExternalDispatcher>();
            runtime    = providerRuntime;

            return(Task.CompletedTask);
        }
예제 #3
0
 public DashboardMiddleware(RequestDelegate next,
                            IGrainFactory grainFactory,
                            IExternalDispatcher dispatcher,
                            IOptions <DashboardOptions> options,
                            DashboardLogger logger)
 {
     this.grainFactory = grainFactory;
     this.dispatcher   = dispatcher;
     this.options      = options;
     this.logger       = logger;
     this.next         = next;
 }
예제 #4
0
        public GrainProfiler(
            IServiceProvider services,
            IExternalDispatcher dispatcher,
            ILogger <GrainProfiler> logger)
        {
            this.dispatcher = dispatcher;
            this.services   = services;
            this.logger     = logger;

            formatMethodName = services.GetService <Func <IGrainCallContext, string> >() ?? DefaultFormatter;

            // register timer to report every second
            timer = new Timer(ProcessStats, null, 1 * 1000, 1 * 1000);
        }
예제 #5
0
        public GrainProfiler(
            ILogger <GrainProfiler> logger,
            ILocalSiloDetails localSiloDetails,
            IExternalDispatcher dispatcher,
            IServiceProvider services,
            IGrainFactory grainFactory)
        {
            this.dispatcher       = dispatcher;
            this.logger           = logger;
            this.localSiloDetails = localSiloDetails;
            this.grainFactory     = grainFactory;

            formatMethodName = services.GetService <Func <IIncomingGrainCallContext, string> >() ?? DefaultFormatter;

            // register timer to report every second
            timer = new Timer(ProcessStats, null, 1 * 1000, 1 * 1000);
        }
예제 #6
0
        public GrainProfiler(
            ILogger <GrainProfiler> logger,
            ILocalSiloDetails localSiloDetails,
            IExternalDispatcher dispatcher,
            GrainMethodFormatterDelegate formatMethodName,
            IGrainFactory grainFactory)
        {
            this.dispatcher       = dispatcher;
            this.logger           = logger;
            this.localSiloDetails = localSiloDetails;
            this.grainFactory     = grainFactory;

            this.formatMethodName = formatMethodName;

            // register timer to report every second
            timer = new Timer(ProcessStats, null, 1 * 1000, 1 * 1000);
        }
예제 #7
0
        internal static IServiceCollection AddServicesForHostedDashboard(this IServiceCollection services, IGrainFactory grainFactory, IExternalDispatcher dispatcher, DashboardOptions options)
        {
            services.AddSingleton(DashboardLogger.Instance);
            services.AddSingleton(Options.Create(options));
            services.AddSingleton <ILoggerProvider>(DashboardLogger.Instance);
            services.AddSingleton(dispatcher);
            services.AddSingleton(grainFactory);

            return(services);
        }
예제 #8
0
 public MessageDispatcher(IMessageDispatcherProvider dispatcherProvider, IExternalDispatcher externalDispatcher)
 {
     _dispatcherProvider = dispatcherProvider ?? throw new ArgumentNullException(nameof(dispatcherProvider));
     _externalDispatcher = externalDispatcher ?? throw new ArgumentNullException(nameof(externalDispatcher));
 }