当前位置: 首页>>代码示例>>C#>>正文


C# BrightstarProfiler.GetLogString方法代码示例

本文整理汇总了C#中BrightstarProfiler.GetLogString方法的典型用法代码示例。如果您正苦于以下问题:C# BrightstarProfiler.GetLogString方法的具体用法?C# BrightstarProfiler.GetLogString怎么用?C# BrightstarProfiler.GetLogString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BrightstarProfiler的用法示例。


在下文中一共展示了BrightstarProfiler.GetLogString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestSimpleJoinQuery

        public void TestSimpleJoinQuery()
        {
            var sparqlQuery =
                    @"PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/> 
                    SELECT ?review WHERE { 
                        ?review bsbm:reviewFor ?product . 
                        ?product bsbm:productFeature <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/ProductFeature2330> .
                    } LIMIT 3";
            // Warm-up
            var client = BrightstarService.GetClient("type=embedded;storesDirectory=stores");
            for (int i = 0; i < 5; i++)
            {
                client.ExecuteQuery("SparqlPerformance", sparqlQuery);
            }

            // Profile
            var profiler = new BrightstarProfiler("SimpleJoinQuery");
            for (int i = 0; i < 1000; i++)
            {
                using (profiler.Step("ExecuteQuery"))
                {
                    client.ExecuteQuery("SparqlPerformance", sparqlQuery);
                }
            }

            Console.WriteLine(profiler.GetLogString());
        }
开发者ID:jaensen,项目名称:BrightstarDB,代码行数:27,代码来源:SparqlPerformance.cs

示例2: Run

        public override void Run()
        {
            try
            {
                Logging.LogInfo("Import job being run on file " + _contentFileName);
                StoreWorker.TransactionLog.LogStartTransaction(this);

                var parser = GetParser(_contentFileName);
                var storeDirectory = StoreWorker.WriteStore.DirectoryPath;
                var filePath = Path.Combine(storeDirectory,
                                            ".." + Path.DirectorySeparatorChar + "import" + Path.DirectorySeparatorChar +
                                            _contentFileName);
                var profiler = new BrightstarProfiler("Import " + _contentFileName); // TODO : Conditionally create this if profiling is enabled
                Logging.LogDebug("Import file path calculated as '{0}'", filePath);
                if (!File.Exists(filePath))
                {
                    ErrorMessage = String.Format("Cannot find file {0} in import directory", _contentFileName);
                    throw new FileNotFoundException(ErrorMessage);
                }
                using (_fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
                {
                    _importTripleSink = new StoreTripleSink(StoreWorker.WriteStore, JobId,
                                                            Configuration.TransactionFlushTripleCount,
                                                            profiler:profiler);
                    parser.Parse(_fileStream, this, _graphUri);
                }
                StoreWorker.WriteStore.Commit(JobId, profiler);
                StoreWorker.InvalidateReadStore();

                Logging.LogInfo("Import job completed successfully for " + _contentFileName);
                if (profiler != null)
                {
                    Logging.LogInfo(profiler.GetLogString());
                }
                StoreWorker.TransactionLog.LogEndSuccessfulTransaction(this);
            }
            catch (RdfParserException parserException)
            {
                ErrorMessage = parserException.Message;
                ExceptionDetail = new ExceptionDetail(parserException);
                Logging.LogInfo("Parser error processing import job on file " + _contentFileName + ". " + parserException.Message);
                throw;
            }
            catch (Exception ex)
            {
                ErrorMessage = "Error importing file " + _contentFileName + ". " + ex.Message;
                StoreWorker.TransactionLog.LogEndFailedTransaction(this);
                Logging.LogInfo("Error processing import job on file " + _contentFileName + ". Error Message: " + ex.Message + " Stack trace: " + ex.StackTrace);
                throw;
            }
        }
开发者ID:Garwin4j,项目名称:BrightstarDB,代码行数:51,代码来源:ImportJob.cs


注:本文中的BrightstarProfiler.GetLogString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。