Merge pull request 'feature/27526736-cache-table' (#207) from feature/27526736-cache-table into dev

Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/207
This commit is contained in:
Никита Фролов 2024-02-02 15:57:06 +05:00
commit fa28fdfefe
10 changed files with 10047 additions and 0 deletions

View File

@ -72,5 +72,12 @@ namespace AsbCloudApp.Repositories
/// </summary>
/// <returns></returns>
IEnumerable<TelemetryDataStatDto> GetStat();
/// <summary>
/// Получить ключи телеметрии по параметрам запроса
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
IEnumerable<int> GetIds(TelemetryDataRequest request);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Add_Table_DataSaubStat : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "t_data_saub_stat",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
date_start = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "Дата и время начала"),
date_end = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "Дата и время окончания"),
depth_start = table.Column<double>(type: "double precision", nullable: false, comment: "Глубина забоя по стволу начальная"),
depth_end = table.Column<double>(type: "double precision", nullable: false, comment: "Глубина забоя по стволу конечная"),
speed = table.Column<double>(type: "double precision", nullable: false, comment: "Скорость бурения"),
block_speed_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Ограничение скорости блока"),
pressure = table.Column<double>(type: "double precision", nullable: false, comment: "Давление"),
pressure_idle = table.Column<double>(type: "double precision", nullable: true, comment: "Давление холостого хода"),
pressure_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Ограничение фактического давления"),
axial_load = table.Column<double>(type: "double precision", nullable: false, comment: "Фактическая нагрузка"),
axial_load_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Ограничение факт. нагрузки"),
axial_load_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Максимально допустимая нагрузка"),
rotor_torque = table.Column<double>(type: "double precision", nullable: false, comment: "Фактический момент"),
rotor_torque_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Ограничение факт. момента"),
rotor_torque_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Максимально допустимый момент"),
id_feed_regulator = table.Column<short>(type: "smallint", nullable: true, comment: "Работа при достижении ограничения"),
rotor_speed = table.Column<double>(type: "double precision", nullable: false, comment: "Фактическая скорость оборотов ВСП"),
id_category = table.Column<int>(type: "integer", nullable: false, comment: "Название автоопределённой операции"),
enabled_subsystems = table.Column<int>(type: "integer", nullable: false, comment: "Флаги подсистем"),
has_oscillation = table.Column<bool>(type: "boolean", nullable: false, comment: "Наличие или отсутствие осцилляции"),
flow = table.Column<double>(type: "double precision", nullable: false, comment: "Фактический расход"),
id_telemetry = table.Column<int>(type: "integer", nullable: false, comment: "Ключ телеметрии")
},
constraints: table =>
{
table.PrimaryKey("PK_t_data_saub_stat", x => x.id);
table.ForeignKey(
name: "FK_t_data_saub_stat_t_telemetry_id_telemetry",
column: x => x.id_telemetry,
principalTable: "t_telemetry",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_t_data_saub_stat_t_well_operation_category_id_category",
column: x => x.id_category,
principalTable: "t_well_operation_category",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
},
comment: "Кеш-таблица для хранения данных для РТК-отчета");
migrationBuilder.CreateIndex(
name: "IX_t_data_saub_stat_id_category",
table: "t_data_saub_stat",
column: "id_category");
migrationBuilder.CreateIndex(
name: "IX_t_data_saub_stat_id_telemetry",
table: "t_data_saub_stat",
column: "id_telemetry");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "t_data_saub_stat");
}
}
}

View File

@ -317,6 +317,136 @@ namespace AsbCloudDb.Migrations
b.HasComment("Ежедневные отчёты");
});
modelBuilder.Entity("AsbCloudDb.Model.DataSaubStat", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<double>("AxialLoad")
.HasColumnType("double precision")
.HasColumnName("axial_load")
.HasComment("Фактическая нагрузка");
b.Property<double?>("AxialLoadLimitMax")
.HasColumnType("double precision")
.HasColumnName("axial_load_limit_max")
.HasComment("Максимально допустимая нагрузка");
b.Property<double?>("AxialLoadSp")
.HasColumnType("double precision")
.HasColumnName("axial_load_sp")
.HasComment("Ограничение факт. нагрузки");
b.Property<double?>("BlockSpeedSp")
.HasColumnType("double precision")
.HasColumnName("block_speed_sp")
.HasComment("Ограничение скорости блока");
b.Property<DateTimeOffset>("DateEnd")
.HasColumnType("timestamp with time zone")
.HasColumnName("date_end")
.HasComment("Дата и время окончания");
b.Property<DateTimeOffset>("DateStart")
.HasColumnType("timestamp with time zone")
.HasColumnName("date_start")
.HasComment("Дата и время начала");
b.Property<double>("DepthEnd")
.HasColumnType("double precision")
.HasColumnName("depth_end")
.HasComment("Глубина забоя по стволу конечная");
b.Property<double>("DepthStart")
.HasColumnType("double precision")
.HasColumnName("depth_start")
.HasComment("Глубина забоя по стволу начальная");
b.Property<int>("EnabledSubsystems")
.HasColumnType("integer")
.HasColumnName("enabled_subsystems")
.HasComment("Флаги подсистем");
b.Property<double>("Flow")
.HasColumnType("double precision")
.HasColumnName("flow")
.HasComment("Фактический расход");
b.Property<bool>("HasOscillation")
.HasColumnType("boolean")
.HasColumnName("has_oscillation")
.HasComment("Наличие или отсутствие осцилляции");
b.Property<int>("IdCategory")
.HasColumnType("integer")
.HasColumnName("id_category")
.HasComment("Название автоопределённой операции");
b.Property<short?>("IdFeedRegulator")
.HasColumnType("smallint")
.HasColumnName("id_feed_regulator")
.HasComment("Работа при достижении ограничения");
b.Property<int>("IdTelemetry")
.HasColumnType("integer")
.HasColumnName("id_telemetry")
.HasComment("Ключ телеметрии");
b.Property<double>("Pressure")
.HasColumnType("double precision")
.HasColumnName("pressure")
.HasComment("Давление");
b.Property<double?>("PressureIdle")
.HasColumnType("double precision")
.HasColumnName("pressure_idle")
.HasComment("Давление холостого хода");
b.Property<double?>("PressureSp")
.HasColumnType("double precision")
.HasColumnName("pressure_sp")
.HasComment("Ограничение фактического давления");
b.Property<double>("RotorSpeed")
.HasColumnType("double precision")
.HasColumnName("rotor_speed")
.HasComment("Фактическая скорость оборотов ВСП");
b.Property<double>("RotorTorque")
.HasColumnType("double precision")
.HasColumnName("rotor_torque")
.HasComment("Фактический момент");
b.Property<double?>("RotorTorqueLimitMax")
.HasColumnType("double precision")
.HasColumnName("rotor_torque_limit_max")
.HasComment("Максимально допустимый момент");
b.Property<double?>("RotorTorqueSp")
.HasColumnType("double precision")
.HasColumnName("rotor_torque_sp")
.HasComment("Ограничение факт. момента");
b.Property<double>("Speed")
.HasColumnType("double precision")
.HasColumnName("speed")
.HasComment("Скорость бурения");
b.HasKey("Id");
b.HasIndex("IdCategory");
b.HasIndex("IdTelemetry");
b.ToTable("t_data_saub_stat");
b.HasComment("Кеш-таблица для хранения данных для РТК-отчета");
});
modelBuilder.Entity("AsbCloudDb.Model.Deposit", b =>
{
b.Property<int>("Id")
@ -8292,6 +8422,25 @@ namespace AsbCloudDb.Migrations
b.Navigation("Well");
});
modelBuilder.Entity("AsbCloudDb.Model.DataSaubStat", b =>
{
b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory")
.WithMany()
.HasForeignKey("IdCategory")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry")
.WithMany()
.HasForeignKey("IdTelemetry")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("OperationCategory");
b.Navigation("Telemetry");
});
modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b =>
{
b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory")

View File

@ -90,6 +90,8 @@ namespace AsbCloudDb.Model
public DbSet<Contact> Contacts => Set<Contact>();
public DbSet<DrillTest> DrillTests => Set<DrillTest>();
public DbSet<DataSaubStat> DataSaubStat => Set<DataSaubStat>();
public AsbCloudDbContext() : base()
{
Interlocked.Increment(ref referenceCount);

View File

@ -0,0 +1,89 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace AsbCloudDb.Model
{
[Table("t_data_saub_stat"), Comment("Кеш-таблица для хранения данных для РТК-отчета")]
public class DataSaubStat : IId
{
[Key]
[Column("id")]
public int Id { get; set; }
[Column("date_start", TypeName = "timestamp with time zone"), Comment("Дата и время начала")]
public DateTimeOffset DateStart { get; set; }
[Column("date_end", TypeName = "timestamp with time zone"), Comment("Дата и время окончания")]
public DateTimeOffset DateEnd { get; set; }
[Column("depth_start"), Comment("Глубина забоя по стволу начальная")]
public double DepthStart { get; set; }
[Column("depth_end"), Comment("Глубина забоя по стволу конечная")]
public double DepthEnd { get; set; }
[Column("speed"), Comment("Скорость бурения")]
public double Speed { get; set; }
[Column("block_speed_sp"), Comment("Ограничение скорости блока")]
public double? BlockSpeedSp { get; set; }
[Column("pressure"), Comment("Давление")]
public double Pressure { get; set; }
[Column("pressure_idle"), Comment("Давление холостого хода")]
public double? PressureIdle { get; set; }
[Column("pressure_sp"), Comment("Ограничение фактического давления")]
public double? PressureSp { get; set; }
[Column("axial_load"), Comment("Фактическая нагрузка")]
public double AxialLoad { get; set; }
[Column("axial_load_sp"), Comment("Ограничение факт. нагрузки")]
public double? AxialLoadSp { get; set; }
[Column("axial_load_limit_max"), Comment("Максимально допустимая нагрузка")]
public double? AxialLoadLimitMax { get; set; }
[Column("rotor_torque"), Comment("Фактический момент")]
public double RotorTorque { get; set; }
[Column("rotor_torque_sp"), Comment("Ограничение факт. момента")]
public double? RotorTorqueSp { get; set; }
[Column("rotor_torque_limit_max"), Comment("Максимально допустимый момент")]
public double? RotorTorqueLimitMax { get; set; }
[Column("id_feed_regulator"), Comment("Работа при достижении ограничения")]
public short? IdFeedRegulator { get; set; }
[Column("rotor_speed"), Comment("Фактическая скорость оборотов ВСП")]
public double RotorSpeed { get; set; }
[Column("id_category"), Comment("Название автоопределённой операции")]
public int IdCategory { get; set; }
[Column("enabled_subsystems"), Comment("Флаги подсистем")]
public int EnabledSubsystems { get; set; }
[Column("has_oscillation"), Comment("Наличие или отсутствие осцилляции")]
public bool HasOscillation { get; set; }
[Column("flow"), Comment("Фактический расход")]
public double Flow { get; set; }
[Column("id_telemetry"), Comment("Ключ телеметрии")]
public int IdTelemetry { get; set; }
[ForeignKey(nameof(IdTelemetry))]
public virtual Telemetry Telemetry { get; set; } = null!;
[JsonIgnore]
[ForeignKey(nameof(IdCategory))]
public virtual WellOperationCategory OperationCategory { get; set; } = null!;
}
}

View File

@ -80,6 +80,7 @@ namespace AsbCloudDb.Model
DbSet<DrillTest> DrillTests { get; }
DbSet<TrajectoryFact> TrajectoriesFact { get; }
DbSet<WellSectionPlan> WellSectionsPlan { get; }
DbSet<DataSaubStat> DataSaubStat { get; }
DatabaseFacade Database { get; }
Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token);

View File

@ -0,0 +1,235 @@
using AsbCloudApp.Data.SAUB;
using AsbCloudApp.Repositories;
using AsbCloudApp.Requests;
using AsbCloudDb.Model;
using AsbCloudInfrastructure.Services.DetectOperations.Detectors;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Background.PeriodicWorks
{
/// <summary>
/// задача по добавлению данных в таблицу DataSaubStat, которая используется дл построения РТК-отчета
/// </summary>
internal class WorkDataSaubStat : Work
{
private int MechanicalDrillingCategoryId = 4001;
private int Gap = 60;
public WorkDataSaubStat() : base("Generate DataSaubStat entries and save them into Db")
{
Timeout = TimeSpan.FromMinutes(10);
}
protected override async Task Action(string id, IServiceProvider services, Action<string, double?> onProgressCallback, CancellationToken token)
{
using var db = services.GetRequiredService<IAsbCloudDbContext>();
var telemetryDataCache = services.GetRequiredService<ITelemetryDataCache<TelemetryDataSaubDto>>();
var cacheRequest = new TelemetryDataRequest()
{
GeDate = DateTime.UtcNow.AddDays(-Gap)
};
var idTelemetries = telemetryDataCache.GetIds(cacheRequest).ToArray();
if (!idTelemetries.Any())
return;
var stats = await db.Set<DataSaubStat>()
.Where(s => idTelemetries.Contains(s.IdTelemetry))
.GroupBy(s => s.IdTelemetry)
.Select(g => new
{
IdTelemetry = g.Key,
DateEnd = g.Max(s => s.DateEnd),
})
.ToArrayAsync(token);
for( var i =0; i < idTelemetries.Length; i++)
{
var idTelemetry = idTelemetries[i];
var lastDate = stats.FirstOrDefault(s => s.IdTelemetry == idTelemetry)?.DateEnd ?? DateTimeOffset.UnixEpoch;
var statsCount = await CreateStatForTelemetryFromDate(db, idTelemetry, lastDate, token);
onProgressCallback($"Calculate stat for telemetry: {idTelemetry}; from {lastDate}; results count: {statsCount};", 100*i / idTelemetries.Length);
}
}
private async Task<int> CreateStatForTelemetryFromDate(IAsbCloudDbContext db, int idTelemetry, DateTimeOffset begin, CancellationToken token)
{
var detectedOperations = await db.Set<DetectedOperation>()
.Where(o => o.IdTelemetry == idTelemetry)
.Where(o => o.DateStart > begin)
.Where(o => o.OperationCategory.IdParent == MechanicalDrillingCategoryId)
.OrderBy(o => o.DateStart)
.Take(250)
.ToArrayAsync(token);
if (!detectedOperations.Any())
return 0;
var minDate = detectedOperations.First().DateStart;
var maxDate = detectedOperations.OrderByDescending(d => d.DateEnd).First().DateEnd;
var telemetryDataSaub = await db.Set<TelemetryDataSaub>()
.Where(t => t.IdTelemetry == idTelemetry)
.Where(t => t.DateTime >= minDate)
.Where(t => t.DateTime <= maxDate)
.Where(t => Math.Abs(t.BitDepth - t.WellDepth) < 0.0001)
.OrderBy(t => t.DateTime)
.Take(100_000)
.ToArrayAsync(token);
if (!telemetryDataSaub.Any())
return 0;
var dataSaubStats = CreateDataSaubStat(detectedOperations, telemetryDataSaub);
db.Set<DataSaubStat>().AddRange(dataSaubStats);
return await db.SaveChangesAsync(token);
}
private static IEnumerable<DataSaubStat> CreateDataSaubStat(IEnumerable<DetectedOperation> detectedOperations, TelemetryDataSaub[] telemetryDataSaub)
{
var indexStart = 0;
var indexEnd = 0;
var result = new List<DataSaubStat>();
if (!telemetryDataSaub.Any())
return result;
foreach (var operation in detectedOperations)
{
indexStart = Array.FindIndex(telemetryDataSaub, indexEnd, t => t.DateTime >= operation.DateStart);
if (indexStart < 0)
break;
indexEnd = Array.FindIndex(telemetryDataSaub, indexStart, t => t.DateTime > operation.DateEnd);
if (indexEnd < 0)
indexEnd = telemetryDataSaub.Length - 1;
if (indexEnd == indexStart)
continue;
var length = indexEnd - indexStart;
var subset = telemetryDataSaub.AsSpan(indexStart, length);
var stats = CalcStats(operation, subset);
result.AddRange(stats);
}
return result;
}
private static IEnumerable<DataSaubStat> CalcStats(DetectedOperation operation, Span<TelemetryDataSaub> telemetryDataSaub)
{
var result = new List<DataSaubStat>();
var indexStart = 0;
for (var i = 1; i < telemetryDataSaub.Length; i++)
{
var previous = telemetryDataSaub[i - 1];
var current = telemetryDataSaub[i];
if (IsNewCacheItem(previous, current) || i == telemetryDataSaub.Length - 1)
{
var length = i - indexStart;
var span = telemetryDataSaub.Slice(indexStart, length);
indexStart = i;
if (length <= 2 || (span[^1].WellDepth - span[0].WellDepth) < 0.001)
continue; // мелкие выборки не учитываем.
var stat = CalcStat(operation, span);
result.Add(stat);
}
}
return result;
}
private static DataSaubStat CalcStat(DetectedOperation operation, Span<TelemetryDataSaub> span)
{
var hasOscillation = operation.ExtraData.TryGetValue(DetectorDrilling.ExtraDataKeyHasOscillation, out object? hasOscillationObject)
&& hasOscillationObject is true;
var aggregatedValues = CalcAggregate(span);
var processMapDrillingCacheItem = new DataSaubStat
{
DateStart = operation.DateStart,
DateEnd = operation.DateEnd,
DepthStart = operation.DepthStart,
DepthEnd = operation.DepthEnd,
Speed = (operation.DepthEnd - operation.DepthStart) / ((operation.DateEnd - operation.DateStart).TotalHours),
BlockSpeedSp = span[0].BlockSpeedSp,
Pressure = aggregatedValues.Pressure,
PressureIdle = span[0].PressureIdle,
PressureSp = span[0].PressureSp,
AxialLoad = aggregatedValues.AxialLoad,
AxialLoadSp = span[0].AxialLoadSp,
AxialLoadLimitMax = span[0].AxialLoadLimitMax,
RotorTorque = aggregatedValues.RotorTorque,
RotorTorqueSp = span[0].RotorTorqueSp,
RotorTorqueLimitMax = span[0].RotorTorqueLimitMax,
IdFeedRegulator = span[0].IdFeedRegulator,
RotorSpeed = aggregatedValues.RotorSpeed,
IdCategory = operation.IdCategory,
EnabledSubsystems = operation.EnabledSubsystems,
HasOscillation = hasOscillation,
IdTelemetry = operation.IdTelemetry,
Flow = aggregatedValues.Flow
};
return processMapDrillingCacheItem;
}
private static (
double Pressure,
double AxialLoad,
double RotorTorque,
double RotorSpeed,
double Flow
) CalcAggregate(Span<TelemetryDataSaub> span)
{
var sumPressure = 0.0;
var sumAxialLoad = 0.0;
var sumRotorTorque = 0.0;
var sumRotorSpeed = 0.0;
var flow = span[0].Flow ?? 0.0;
var diffDepthTotal = span[^1].WellDepth - span[0].WellDepth;
for (var i = 0; i < span.Length - 1; i++)
{
var diffDepth = span[i + 1].WellDepth - span[i].WellDepth;
sumPressure += diffDepth * span[i].Pressure;
sumAxialLoad += diffDepth * span[i].AxialLoad;
sumRotorTorque += diffDepth * span[i].RotorTorque;
sumRotorSpeed += diffDepth * span[i].RotorSpeed;
flow = span[i + 1].Flow > flow ? span[i + 1].Flow ?? 0.0 : flow;
}
return (
Pressure: sumPressure / diffDepthTotal,
AxialLoad: sumAxialLoad / diffDepthTotal,
RotorTorque: sumRotorTorque / diffDepthTotal,
RotorSpeed: sumRotorSpeed / diffDepthTotal,
Flow: flow
);
}
private static bool IsNewCacheItem(TelemetryDataSaub previous, TelemetryDataSaub current)
{
return !(current.Mode == previous.Mode)
|| !(current.WellDepth >= previous.WellDepth)
|| !(current.BlockSpeedSp == previous.BlockSpeedSp)
|| !(current.PressureIdle == previous.PressureIdle)
|| !(current.PressureSp == previous.PressureSp)
|| !(current.AxialLoadSp == previous.AxialLoadSp)
|| !(current.AxialLoadLimitMax == previous.AxialLoadLimitMax)
|| !(current.HookWeightIdle == previous.HookWeightIdle)
|| !(current.RotorTorqueIdle == previous.RotorTorqueIdle)
|| !(current.RotorTorqueSp == previous.RotorTorqueSp)
|| !(current.RotorTorqueLimitMax == previous.RotorTorqueLimitMax)
|| !(current.IdFeedRegulator == previous.IdFeedRegulator);
}
}
}

View File

@ -324,5 +324,33 @@ namespace AsbCloudInfrastructure.Services.SAUB
return data;
}
public IEnumerable<int> GetIds(TelemetryDataRequest request)
{
var data = caches.Where(i => i.Value.LastData.Count > 0);
if (request.GeDate.HasValue)
{
data = data
.Where(item => {
var lastItem = item.Value.LastData.Last();
var geDate = request.GeDate.Value.ToOffset(TimeSpan.FromHours(item.Value.TimezoneHours));
return lastItem.DateTime >= geDate;
});
}
if (request.LeDate.HasValue)
{
data = data
.Where(item => {
var firstItem = item.Value.LastData.First();
var leDate = request.LeDate.Value.ToOffset(TimeSpan.FromHours(item.Value.TimezoneHours));
return firstItem.DateTime <= leDate;
});
}
var telemetryIds = data.Select(item => item.Key);
return telemetryIds;
}
}
}

View File

@ -32,6 +32,7 @@ namespace AsbCloudInfrastructure
backgroundWorker.Add<WorkToDeleteOldReports>(TimeSpan.FromDays(1));
backgroundWorker.Add<WellInfoService.WorkWellInfoUpdate>(TimeSpan.FromMinutes(30));
backgroundWorker.Add<WorkOperationDetection>(TimeSpan.FromMinutes(15));
backgroundWorker.Add<WorkDataSaubStat>(TimeSpan.FromMinutes(15));
backgroundWorker.Add<WorkLimitingParameterCalc>(TimeSpan.FromMinutes(30));
backgroundWorker.Add(MakeMemoryMonitoringWork(), TimeSpan.FromMinutes(1));