Exemplo n.º 1
0
        /// <summary>
        /// アプリケーションの開始処理。
        /// </summary>
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            LoggerConfig.RegisterLoggers();
            ValidationConfig.RegisterAdapter();
            DapperConfig.RegisterMappings();
            AutoMapperConfig.RegisterMappings();

            // ビューエンジンをRazorViewEngineのみを有効化
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new RazorViewEngine());

            // MVC応答ヘッダを無効化
            MvcHandler.DisableMvcResponseHeader = true;

            // CSRFトークンのクッキー名を変更
            AntiForgeryConfig.CookieName = "token";

            // ローカル環境以外の場合
            if (AppEnvironment.EnvironmentCode != EnvironmentCode.Local)
            {
                // スレッドプール監視開始
                threadPoolMonitor = new ThreadPoolMonitor();
            }
        }
Exemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            var monitor = new ThreadPoolMonitor();

            monitor.Start();
        }
Exemplo n.º 3
0
        public async Task <ClusterResult> ExecuteAsync(IRequestContext context, Func <IRequestContext, Task <ClusterResult> > next)
        {
            var result = await next(context).ConfigureAwait(false);

            if (result.Response.Code == ResponseCode.RequestTimeout)
            {
                ThreadPoolMonitor.ReportAndFixIfNeeded(context.Log);
            }

            return(result);
        }
Exemplo n.º 4
0
        public MainWindowViewModel(IDialogService dialog)
        {
            InitCommands();
            UiEnabled = true;
            Monitor   = new ThreadPoolMonitor();
            Monitor.StartMonitor();

            this.dialog            = dialog;
            directory.CopyCreated += (s, e) =>
            {
                dialog.MessageBoxOk("The copy was created successfully");
            };
        }
Exemplo n.º 5
0
 public LocalSiloHealthMonitor(
     IEnumerable <IHealthCheckParticipant> healthCheckParticipants,
     MembershipTableManager membershipTableManager,
     ConnectionManager connectionManager,
     ClusterHealthMonitor clusterHealthMonitor,
     ILocalSiloDetails localSiloDetails,
     ILogger <LocalSiloHealthMonitor> log,
     IOptions <ClusterMembershipOptions> clusterMembershipOptions,
     IAsyncTimerFactory timerFactory,
     ILoggerFactory loggerFactory,
     ProbeRequestMonitor probeRequestMonitor)
 {
     _healthCheckParticipants = healthCheckParticipants.ToList();
     _membershipTableManager  = membershipTableManager;
     _clusterHealthMonitor    = clusterHealthMonitor;
     _localSiloDetails        = localSiloDetails;
     _log = log;
     _probeRequestMonitor      = probeRequestMonitor;
     _clusterMembershipOptions = clusterMembershipOptions.Value;
     _degradationCheckTimer    = timerFactory.Create(
         _clusterMembershipOptions.LocalHealthDegradationMonitoringPeriod,
         nameof(LocalSiloHealthMonitor));
     _threadPoolMonitor = new ThreadPoolMonitor(loggerFactory.CreateLogger <ThreadPoolMonitor>());
 }
Exemplo n.º 6
0
        static OptimizationOptions()
        {
            string setting = string.Empty;

            try
            {
                ConfigurationFile configFile = ConfigurationFile.Current;
                CategorizedSettingsElementCollection systemSettings = configFile.Settings["systemSettings"];
                systemSettings.Add("OptimizationsConnectionString", "", "Specifies which optimizations to enable for the system.");
                setting = systemSettings["OptimizationsConnectionString"].ValueAsString("");
                Dictionary <string, string> optimizations = setting.ParseKeyValuePairs();

                LoadThreadPoolMonitoring(optimizations);
                LoadPreferDedicatedThreads(optimizations);
                LoadAsyncQueueInProtocolParsing(optimizations);
                LoadProcessorAffinity(optimizations);
                LoadRoutingTable(optimizations);
            }
            catch (Exception ex)
            {
                Log.Publish(MessageLevel.Warning, "Could not parse Optimization Settings", setting, null, ex);
            }
            ThreadPoolMonitor.Initialize();
        }