From dd7ae529596e46db2367b7d74cbdf992e5d2083e Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 18 Sep 2024 14:29:07 +0200 Subject: [PATCH] revert changes to benchmark project --- .../Benchmarks/BulkIngestionBenchmarks.cs | 2 +- .../Program.cs | 23 ++++++++++++++++++- elastic-ingest-dotnet.sln.DotSettings | 5 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Benchmarks/BulkIngestionBenchmarks.cs b/benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Benchmarks/BulkIngestionBenchmarks.cs index 81360ba..52fa94c 100644 --- a/benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Benchmarks/BulkIngestionBenchmarks.cs +++ b/benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Benchmarks/BulkIngestionBenchmarks.cs @@ -70,6 +70,6 @@ public void BulkAll() channel.TryWriteMany(_data); channel.TryComplete(); - // _waitHandle.WaitOne(); + _waitHandle.WaitOne(); } } diff --git a/benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Program.cs b/benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Program.cs index c347608..2564764 100644 --- a/benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Program.cs +++ b/benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Program.cs @@ -14,8 +14,29 @@ using System.Globalization; using Elastic.Ingest.Elasticsearch.Benchmarks.Benchmarks; +#if DEBUG +// MANUALLY RUN A BENCHMARKED METHOD DURING DEBUGGING + +//var bm = new BulkIngestion(); +//bm.Setup(); +//await bm.BulkAllAsync() +//Console.WriteLine("DONE"); + +var bm = new BulkRequestCreationWithFixedIndexNameBenchmarks(); +bm.Setup(); +await bm.WriteToStreamAsync(); + +var length = bm.MemoryStream.Length; + +bm.MemoryStream.Position = 0; +var sr = new StreamReader(bm.MemoryStream); +var json = sr.ReadToEnd(); + +Console.ReadKey(); +#else var config = ManualConfig.Create(DefaultConfig.Instance); config.SummaryStyle = new SummaryStyle(CultureInfo.CurrentCulture, true, BenchmarkDotNet.Columns.SizeUnit.B, null!, ratioStyle: BenchmarkDotNet.Columns.RatioStyle.Percentage); config.AddDiagnoser(MemoryDiagnoser.Default); -BenchmarkRunner.Run(config); +BenchmarkRunner.Run(config); +#endif diff --git a/elastic-ingest-dotnet.sln.DotSettings b/elastic-ingest-dotnet.sln.DotSettings index 172fc64..673b0d8 100644 --- a/elastic-ingest-dotnet.sln.DotSettings +++ b/elastic-ingest-dotnet.sln.DotSettings @@ -122,7 +122,7 @@ See the LICENSE file in the project root for more information </Entry.Match> <Entry.SortBy> <Kind Is="Member" /> - <Name Is="Enter Pattern Here" /> + <Name /> </Entry.SortBy> </Entry> <Entry DisplayName="Readonly Fields"> @@ -140,7 +140,7 @@ See the LICENSE file in the project root for more information <Entry.SortBy> <Access /> <Readonly /> - <Name Is="Enter Pattern Here" /> + <Name /> </Entry.SortBy> </Entry> <Entry DisplayName="Constructors"> @@ -415,6 +415,7 @@ See the LICENSE file in the project root for more information True True True + True True True False