Убрать NPlot

This commit is contained in:
Roman Efremov 2024-12-25 13:54:07 +05:00
parent 45fbfaf657
commit df7148688d
2 changed files with 17 additions and 45 deletions

View File

@ -2,13 +2,12 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.10" />
<PackageReference Include="NPlot" Version="0.9.10" /> <PackageReference Include="NPlot" Version="0.9.10" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" /> <PackageReference Include="System.Drawing.Common" Version="9.0.0" />

View File

@ -1,7 +1,6 @@
using DD.Persistence.Client; using DD.Persistence.Client;
using DD.Persistence.Models; using DD.Persistence.Models;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using NPlot;
using System.Diagnostics; using System.Diagnostics;
namespace Persistence.Benchmark.Tests; namespace Persistence.Benchmark.Tests;
@ -26,54 +25,28 @@ public static class WitsDataBenchmark
var sw = new Stopwatch(); var sw = new Stopwatch();
//// Create a new bitmap plot surface
//var plotSurface = new NPlot.Bitmap.PlotSurface2D(800, 600);
//// Create a line plot var abscissaData = new List<double>() { };
//var linePlot = new LinePlot(); var ordinateData = new List<double>() { };
var saved = 0;
foreach (var item in data)
{
var time = sw.Elapsed;
//var abscissaData = new List<double>() { }; sw.Start();
//var ordinateData = new List<double>() { }; var response = await client.AddRange(item, source.Token);
sw.Stop();
//var saved = 0; Console.WriteLine($"Сохранено: {response.ToString()}");
//foreach (var item in data) saved = saved + response;
//{ abscissaData.Add(saved / 100_000);
// var time = sw.Elapsed;
// sw.Start(); Console.WriteLine($"Затрачено времени на сохранение части: {sw.Elapsed - time}");
// var response = await client.AddRange(item, source.Token); ordinateData.Add((double)(sw.Elapsed - time).TotalSeconds);
// sw.Stop(); }
// Console.WriteLine($"Сохранено: {response.ToString()}");
// saved = saved + response;
// abscissaData.Add(saved / 100_000);
// Console.WriteLine($"Затрачено времени на сохранение части: {sw.Elapsed - time}");
// ordinateData.Add((double)(sw.Elapsed - time).TotalSeconds);
//}
//Console.WriteLine($"Затрачено времени на сохранение: {sw.Elapsed}");
//// Add the line plot to the plot surface
//linePlot.AbscissaData = abscissaData;
//linePlot.OrdinateData = ordinateData;
//plotSurface.Add(linePlot);
//// Customize the plot (e.g., titles, labels)
//plotSurface.Title = "График";
//plotSurface.XAxis1.Label = "Количество сохраненных записей в БД (100.000)";
//plotSurface.YAxis1.Label = "Время на сохранение 100.000 записей (сек.)";
//// Refresh the plot to render it
//plotSurface.Refresh();
//#pragma warning disable
//// Save the plot as a PNG image
//plotSurface.Bitmap.Save("C:\\Users\\fremo\\source\\repos\\persistence\\Persistence.Benchmark\\plot.png", System.Drawing.Imaging.ImageFormat.Png);
//#pragma warning enable
Console.WriteLine($"Затрачено времени на сохранение: {sw.Elapsed}");
var dis = Guid.Parse(discriminatorId); var dis = Guid.Parse(discriminatorId);
var date = DateTime.Now.AddDays(-1); var date = DateTime.Now.AddDays(-1);