当前位置: 首页>>代码示例>>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;未经允许,请勿转载。