當前位置: 首頁>>代碼示例>>C#>>正文


C# Benchmark.End方法代碼示例

本文整理匯總了C#中Benchmark.End方法的典型用法代碼示例。如果您正苦於以下問題:C# Benchmark.End方法的具體用法?C# Benchmark.End怎麽用?C# Benchmark.End使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Benchmark的用法示例。


在下文中一共展示了Benchmark.End方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Application_Start

        void Application_Start(Object sender, EventArgs e)
        {
            Benchmark b = new Benchmark(true);
            System.IO.FileInfo logFile = new System.IO.FileInfo(Server.MapPath("Mubble.log4net"));
            SqlServerMetrics.Init();
            log4net.Config.XmlConfigurator.ConfigureAndWatch(logFile);
            Configuration configuration = WebConfigurationManager.OpenWebConfiguration("~/");
            HttpHandlersSection handlers = (HttpHandlersSection)configuration.GetSection("system.web/httpHandlers");

            foreach (HttpHandlerAction handler in handlers.Handlers)
            {
                Type t = Type.GetType(handler.Type);
                if (t != null &&
                    t.IsSubclassOf(typeof(Handlers.HttpHandler)) &&
                    handler.Path.IndexOf('*') == 0 &&
                    !Mubble.Handlers.Settings.Extensions.ContainsKey(t.FullName))
                {
                   Mubble.Handlers.Settings.Extensions.Add(t.FullName, handler.Path.Substring(1));
               }
               else if (t != null && t == typeof(Mubble.Handlers.StaticFileHelper) && handler.Path.StartsWith("*"))
               {
                   Config.Caching.StaticFileHelperExtension = handler.Path.Substring(1);
               }
            }

            // Set various middle tier object configuration settings
            ConnectionStringsSection section = (ConnectionStringsSection)
                    WebConfigurationManager.GetSection("connectionStrings");
            ActiveObjects.SqlServer.SqlDataUtility.ReadDB = section.ConnectionStrings["mubbleDBRead"].ConnectionString;
            ActiveObjects.SqlServer.SqlDataUtility.WriteDB = section.ConnectionStrings["mubbleDBRead"].ConnectionString;

            Controller.RootContentPath = WebConfigurationManager.AppSettings["DefaultContent"];
            Controller.RootContent = DataBroker.GetController(Controller.RootContentPath);

            File.FileStoreBase = Server.MapPath(WebConfigurationManager.AppSettings["StoreBase"]);

            MubbleUrl.ApplicationPath = this.Context.Request.ApplicationPath;

            // Loads new modules
            Mubble.Config.Module.LoadDbFromFileSystem(Server.MapPath("~/Modules"), "~/Modules/");

            Mubble.Models.Settings.Lucene lucene = new Mubble.Models.Settings.Lucene();
            lucene.IndexLocation = Server.MapPath(WebConfigurationManager.AppSettings["LuceneIndexLocation"]);
            Mubble.Models.Settings.Application.Lucene = lucene;

            Mubble.Models.Settings.Web web = new Mubble.Models.Settings.Web();
            web.ApplicationPath = this.Context.Request.ApplicationPath;;
            Mubble.Models.Settings.Application.Web = web;

            Mubble.Models.QueryEngine.Engine.CurrentEngine =
                            Mubble.Models.QueryEngine.Engines.Lucene.Init(lucene.IndexLocation, Config.Index.Current.UseRamSearcher);
            //Mubble.Models.QueryEngine.Engines.Lucene.Init(lucene.IndexLocation, Config.Index.Current.UseRamSearcher);

            //Mubble.Caching.CacheLocation = System.IO.Path.Combine(File.FileStoreBase, "CacheKeys");

            //DataBroker.Warmup();

            CacheBroker.Init();

            Mubble.Models.ScheduledCommand.StartTimer();

            b.End();

            log.InfoFormat("Application startup too {0}", b.ElapsedTime);
        }
開發者ID:mrkurt,項目名稱:mubble-old,代碼行數:65,代碼來源:Global.asax.cs


注:本文中的Benchmark.End方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。