示例#1
0
        public static GlimpseCoreAgentServiceCollectionBuilder RunningAgentWeb(this GlimpseCoreServiceCollectionBuilder services, Action <GlimpseCoreAgentOptions> setupAction)
        {
            if (setupAction != null)
            {
                services.Configure(setupAction);
            }

            return(new GlimpseCoreAgentServiceCollectionBuilder(services));
        }
示例#2
0
        private void RegisterPublisher(GlimpseCoreServiceCollectionBuilder services)
        {
            var configurationBuilder = new ConfigurationBuilder();
            var fileProvider         = configurationBuilder.GetFileProvider();

            if (fileProvider.GetFileInfo("glimpsecore.json").Exists)
            {
                var configuration = configurationBuilder.AddJsonFile("glimpsecore.json").Build();
                var section       = configuration.GetSection("resources");
                services.Configure <ResourceOptions>(section);

                services.Replace(new ServiceDescriptor(typeof(IMessagePublisher), typeof(HttpMessagePublisher), ServiceLifetime.Transient));
            }

            // TODO: If I reach this line, than GlimpseCore has no way to send data from point A to B. Should we blow up?
        }