Grpc-MicroService icon indicating copy to clipboard operation
Grpc-MicroService copied to clipboard

AppMetricsTaskScheduler

Open kongkong56 opened this issue 6 years ago • 1 comments

public static IMicroServiceSetupBuilder UseAppMetrics(this IMicroServiceSetupBuilder config) { var metrics = config.Server.ApplicationServices.GetService<IMetricsRoot>();

        config.Server.UseInterceptor(new GrpcMetricsServerInterceptor(config.Server.ApplicationServices));

        new AppMetricsTaskScheduler(TimeSpan.FromSeconds(3),
            async () =>
            {
                await Task.WhenAll(metrics.ReportRunner.RunAllAsync());
            }).Start();
        return config;
    }

其中执行AppMetricsTaskScheduler的作用是什么

kongkong56 avatar Mar 23 '18 06:03 kongkong56

这就是一个定时任务,每3秒执行一次report

893949088 avatar Aug 22 '18 08:08 893949088