private static void Main(string[] args) { var opts = new BenchmarkArgs(); if (CommandLine.Parser.ParseArgumentsWithUsage(args, opts)) { if (!string.IsNullOrEmpty(opts.LogFilePath)) { BenchmarkLogging.EnableFileLogging(opts.LogFilePath); var logStream = new FileStream(opts.LogFilePath + ".bslog", FileMode.Create); BrightstarListener = new TextWriterTraceListener(logStream); BrightstarDB.Logging.BrightstarTraceSource.Listeners.Add(BrightstarListener); BrightstarDB.Logging.BrightstarTraceSource.Switch.Level = SourceLevels.All; } } else { var usage = CommandLine.Parser.ArgumentsUsage(typeof(BenchmarkArgs)); Console.WriteLine(usage); } var runner = new BenchmarkRunner(opts); runner.Run(); BenchmarkLogging.Close(); BrightstarDB.Logging.BrightstarTraceSource.Close(); }
private static void Main(string[] args) { var opts = new BenchmarkArgs(); if (CommandLine.Parser.ParseArgumentsWithUsage(args, opts)) { if (!string.IsNullOrEmpty(opts.LogFilePath)) { BenchmarkLogging.EnableFileLogging(opts.LogFilePath); var logStream = new FileStream(opts.LogFilePath + ".bslog", FileMode.Create); BrightstarListener = new TextWriterTraceListener(logStream); BrightstarDB.Logging.BrightstarTraceSource.Listeners.Add(BrightstarListener); BrightstarDB.Logging.BrightstarTraceSource.Switch.Level = SourceLevels.All; } } else { var usage = CommandLine.Parser.ArgumentsUsage(typeof (BenchmarkArgs)); Console.WriteLine(usage); } var runner = new BenchmarkRunner(opts); runner.Run(); BenchmarkLogging.Close(); BrightstarDB.Logging.BrightstarTraceSource.Close(); }
public BenchmarkRunner(BenchmarkArgs args) { SourceFiles = Directory.GetFiles(args.TestDataDirectory, "*.nt", SearchOption.AllDirectories); BenchmarkLogging.Info("Found {0} source NTriples files for benchmark test", SourceFiles.Length); if (args.MaxNumberFiles > 0 && args.MaxNumberFiles < SourceFiles.Length) { SourceFiles = SourceFiles.Take(args.MaxNumberFiles).ToArray(); BenchmarkLogging.Info("Limited number of source files to be processed to {0} (from command-line options)", SourceFiles.Length); } _brightstar = new EmbeddedBrightstarService("."); _storeName = "BenchmarkStore_" + DateTime.Now.ToString("yyMMdd_HHmmss"); }