forked from ddrilling/AsbCloudServer
Decrease TelemetryDataCache size.
This commit is contained in:
parent
289d1831b4
commit
84dfa183d7
@ -61,7 +61,7 @@ namespace AsbCloudDb.Model
|
|||||||
public DbSet<WITS.Record60> Record60 => Set<WITS.Record60>();
|
public DbSet<WITS.Record60> Record60 => Set<WITS.Record60>();
|
||||||
public DbSet<WITS.Record61> Record61 => Set<WITS.Record61>();
|
public DbSet<WITS.Record61> Record61 => Set<WITS.Record61>();
|
||||||
|
|
||||||
public int ReferenceCount { get; private set; }
|
public static int ReferenceCount { get; private set; }
|
||||||
|
|
||||||
public AsbCloudDbContext() : base()
|
public AsbCloudDbContext() : base()
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
using AsbCloudInfrastructure.Services.DetectOperations;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using AsbCloudInfrastructure.Services.Subsystems;
|
|
||||||
using AsbCloudInfrastructure.Services;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
@ -14,7 +14,7 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
|||||||
public class TelemetryDataCache<TDto>
|
public class TelemetryDataCache<TDto>
|
||||||
where TDto : AsbCloudApp.Data.ITelemetryData
|
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 const int doneWellCapacity = 65 * 60;
|
||||||
|
|
||||||
private readonly ConcurrentDictionary<int, CyclycArray<TDto>> caches;
|
private readonly ConcurrentDictionary<int, CyclycArray<TDto>> caches;
|
||||||
|
@ -43,7 +43,7 @@ namespace AsbCloudInfrastructure
|
|||||||
var workAction = (string _, IServiceProvider _, CancellationToken _) => {
|
var workAction = (string _, IServiceProvider _, CancellationToken _) => {
|
||||||
var bytes = GC.GetTotalMemory(false);
|
var bytes = GC.GetTotalMemory(false);
|
||||||
var bytesString = FromatBytes(bytes);
|
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;
|
return Task.CompletedTask;
|
||||||
};
|
};
|
||||||
var workPeriod = TimeSpan.FromMinutes(1);
|
var workPeriod = TimeSpan.FromMinutes(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user