Cost of Delay 1.122

This commit is contained in:
2025-04-14 12:55:28 -07:00
parent 906868540b
commit 3e8f5931e2
28 changed files with 17480 additions and 184 deletions

View File

@ -19,23 +19,20 @@ public class FileRead : Shared.FileRead, IFileRead
{
private readonly Timer _Timer;
internal static ILog Log => _Log;
internal static Settings Settings => _Settings;
internal static Dictionary<int, WorkItem> WorkItems => _WorkItems;
#pragma warning disable IDE0032, CS8618
private static new ILog _Log;
private static Settings _Settings;
private static Dictionary<int, WorkItem> _WorkItems;
#pragma warning restore IDE0032, CS8618
internal static ILog? Log { get; private set; }
internal static Settings? Settings { get; private set; }
internal static Dictionary<int, WorkItem>? WorkItems { get; private set; }
internal static Dictionary<string, Queue<KeyValuePair<string, WorkItem>>>? Queue { get; private set; }
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) :
base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null)
{
_WorkItems = new();
Queue = new();
WorkItems = new();
_MinFileLength = 10;
_Logistics = new(this);
_NullData = string.Empty;
_Log = LogManager.GetLogger(typeof(FileRead));
Log = LogManager.GetLogger(typeof(FileRead));
if (_FileParameter is null)
throw new Exception(cellInstanceConnectionName);
if (_ModelObjectParameterDefinitions is null)
@ -45,7 +42,7 @@ public class FileRead : Shared.FileRead, IFileRead
if (_IsEAFHosted)
NestExistingFiles(_FileConnectorConfiguration);
string parentDirectory = Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation) ?? throw new Exception();
_Settings = new(digits: 5,
Settings = new(digits: 5,
parentDirectory: parentDirectory,
priorities: 3,
priorityGroups: 9,
@ -151,10 +148,14 @@ public class FileRead : Shared.FileRead, IFileRead
{
try
{
if (Settings is null)
throw new NullReferenceException(nameof(Settings));
if (WorkItems is null)
throw new NullReferenceException(nameof(WorkItems));
_Log.Info($"Enter-{nameof(WeightedShortestJobFirstModule.PopulatedWorkItemsAndGetJson)}");
string? json = WeightedShortestJobFirstModule.PopulatedWorkItemsAndGetJson(_Settings);
string? json = WeightedShortestJobFirstModule.PopulatedWorkItemsAndGetJson(Settings, WorkItems);
if (!string.IsNullOrEmpty(json))
WeightedShortestJobFirstModule.WriteJson(json);
WeightedShortestJobFirstModule.WriteJson(Settings, json);
_Log.Info($"End-{nameof(WeightedShortestJobFirstModule.PopulatedWorkItemsAndGetJson)}");
}
catch (Exception exception)