Decrease TelemetryDataCache size.

This commit is contained in:
ngfrolov 2022-12-05 10:53:24 +05:00
parent 289d1831b4
commit 84dfa183d7
4 changed files with 4 additions and 7 deletions

View File

@ -61,7 +61,7 @@ namespace AsbCloudDb.Model
public DbSet<WITS.Record60> Record60 => Set<WITS.Record60>();
public DbSet<WITS.Record61> Record61 => Set<WITS.Record61>();
public int ReferenceCount { get; private set; }
public static int ReferenceCount { get; private set; }
public AsbCloudDbContext() : base()
{

View File

@ -1,7 +1,4 @@
using AsbCloudInfrastructure.Services.DetectOperations;
using AsbCloudInfrastructure.Services.Subsystems;
using AsbCloudInfrastructure.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Diagnostics;

View File

@ -14,7 +14,7 @@ namespace AsbCloudInfrastructure.Services.SAUB
public class TelemetryDataCache<TDto>
where TDto : AsbCloudApp.Data.ITelemetryData
{
private const int activeWellCapacity = 24 * 60 * 60;
private const int activeWellCapacity = 12 * 60 * 60;
private const int doneWellCapacity = 65 * 60;
private readonly ConcurrentDictionary<int, CyclycArray<TDto>> caches;

View File

@ -43,7 +43,7 @@ namespace AsbCloudInfrastructure
var workAction = (string _, IServiceProvider _, CancellationToken _) => {
var bytes = GC.GetTotalMemory(false);
var bytesString = FromatBytes(bytes);
System.Diagnostics.Trace.TraceInformation($"Total memory allocated is {bytesString} bytes");
System.Diagnostics.Trace.TraceInformation($"Total memory allocated is {bytesString} bytes. DbContext count is:{AsbCloudDb.Model.AsbCloudDbContext.ReferenceCount}");
return Task.CompletedTask;
};
var workPeriod = TimeSpan.FromMinutes(1);