Skip to content

Commit 641010a

Browse files
committed
Reduce excessive logs
1 parent 48fd4ec commit 641010a

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

Engine/Results/LiveTradingResultHandler.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ private void Update()
158158
//Error checks if the algorithm & threads have not loaded yet, or are closing down.
159159
if (Algorithm?.Transactions == null || TransactionHandler.Orders == null || !Algorithm.GetLocked())
160160
{
161-
Log.Debug("LiveTradingResultHandler.Update(): Algorithm not yet initialized.");
162161
ExitEvent.WaitOne(1000);
163162
return;
164163
}
@@ -183,7 +182,6 @@ private void Update()
183182

184183
//Create and send back the changes in chart since the algorithm started.
185184
var deltaCharts = new Dictionary<string, Chart>();
186-
Log.Debug("LiveTradingResultHandler.Update(): Build delta charts");
187185
var performanceCharts = new Dictionary<string, Chart>();
188186
lock (ChartLock)
189187
{
@@ -210,18 +208,15 @@ private void Update()
210208
}
211209
}
212210
}
213-
Log.Debug("LiveTradingResultHandler.Update(): End build delta charts");
214211

215212
//Profit loss changes, get the banner statistics, summary information on the performance for the headers.
216213
var serverStatistics = GetServerStatistics(utcNow);
217214
var holdings = GetHoldings(Algorithm.Securities.Values, Algorithm.SubscriptionManager.SubscriptionDataConfigService);
218215

219216
//Add the algorithm statistics first.
220-
Log.Debug("LiveTradingResultHandler.Update(): Build run time stats");
221217

222218
var summary = GenerateStatisticsResults(performanceCharts).Summary;
223219
var runtimeStatistics = GetAlgorithmRuntimeStatistics(summary);
224-
Log.Debug("LiveTradingResultHandler.Update(): End build run time stats");
225220

226221

227222
// since we're sending multiple packets, let's do it async and forget about it
@@ -236,7 +231,6 @@ private void Update()
236231
//Send full packet to storage.
237232
if (utcNow > _nextChartsUpdate)
238233
{
239-
Log.Debug("LiveTradingResultHandler.Update(): Pre-store result");
240234
var chartComplete = new Dictionary<string, Chart>();
241235
lock (ChartLock)
242236
{
@@ -255,14 +249,12 @@ private void Update()
255249
var complete = new LiveResultPacket(_job, new LiveResult(new LiveResultParameters(chartComplete, orders, Algorithm.Transactions.TransactionRecord, holdings, Algorithm.Portfolio.CashBook, deltaStatistics, runtimeStatistics, orderEvents, serverStatistics, state: GetAlgorithmState())));
256250
StoreResult(complete);
257251
_nextChartsUpdate = DateTime.UtcNow.Add(ChartUpdateInterval);
258-
Log.Debug("LiveTradingResultHandler.Update(): End-store result");
259252
}
260253

261254
// Upload the logs every 1-2 minutes; this can be a heavy operation depending on amount of live logging and should probably be done asynchronously.
262255
if (utcNow > _nextLogStoreUpdate)
263256
{
264257
List<LogEntry> logs;
265-
Log.Debug("LiveTradingResultHandler.Update(): Storing log...");
266258
lock (LogStore)
267259
{
268260
// we need a new container instance so we can store the logs outside the lock
@@ -272,7 +264,6 @@ private void Update()
272264
SaveLogs(AlgorithmId, logs);
273265

274266
_nextLogStoreUpdate = DateTime.UtcNow.AddMinutes(2);
275-
Log.Debug("LiveTradingResultHandler.Update(): Finished storing log");
276267
}
277268

278269
// Every minute send usage statistics:
@@ -331,7 +322,6 @@ private void Update()
331322

332323
if (utcNow > _nextChartTrimming)
333324
{
334-
Log.Debug("LiveTradingResultHandler.Update(): Trimming charts");
335325
var timeLimitUtc = utcNow.AddDays(-2);
336326
lock (ChartLock)
337327
{
@@ -348,7 +338,6 @@ where v.Time > timeLimitUtc
348338
}
349339
}
350340
_nextChartTrimming = DateTime.UtcNow.AddMinutes(10);
351-
Log.Debug("LiveTradingResultHandler.Update(): Finished trimming charts");
352341
}
353342

354343
if (utcNow > _nextInsightStoreUpdate)
@@ -421,8 +410,6 @@ private void StoreStatusFile(SortedDictionary<string, string> runtimeStatistics,
421410
{
422411
try
423412
{
424-
Log.Debug("LiveTradingResultHandler.Update(): status update start...");
425-
426413
if (statistics == null)
427414
{
428415
statistics = GenerateStatisticsResults(chartComplete, profitLoss);
@@ -449,7 +436,6 @@ private void StoreStatusFile(SortedDictionary<string, string> runtimeStatistics,
449436
state: algorithmState));
450437

451438
SaveResults($"{AlgorithmId}.json", result);
452-
Log.Debug("LiveTradingResultHandler.Update(): status update end.");
453439
}
454440
catch (Exception err)
455441
{
@@ -613,7 +599,6 @@ protected override void Sample(string chartName, string seriesName, int seriesIn
613599
return;
614600
}
615601

616-
Log.Debug("LiveTradingResultHandler.Sample(): Sampling " + chartName + "." + seriesName);
617602
lock (ChartLock)
618603
{
619604
//Add a copy locally:
@@ -633,7 +618,6 @@ protected override void Sample(string chartName, string seriesName, int seriesIn
633618
//Add our value:
634619
series.Values.Add(value);
635620
}
636-
Log.Debug("LiveTradingResultHandler.Sample(): Done sampling " + chartName + "." + seriesName);
637621
}
638622

639623
/// <summary>
@@ -643,7 +627,6 @@ protected override void Sample(string chartName, string seriesName, int seriesIn
643627
/// <seealso cref="Sample(string,string,int,SeriesType,ISeriesPoint,string)"/>
644628
protected void SampleRange(IEnumerable<Chart> updates)
645629
{
646-
Log.Debug("LiveTradingResultHandler.SampleRange(): Begin sampling");
647630
lock (ChartLock)
648631
{
649632
foreach (var update in updates)
@@ -679,7 +662,6 @@ protected void SampleRange(IEnumerable<Chart> updates)
679662
}
680663
}
681664
}
682-
Log.Debug("LiveTradingResultHandler.SampleRange(): Finished sampling");
683665
}
684666

685667
/// <summary>
@@ -1047,8 +1029,6 @@ public virtual void ProcessSynchronousEvents(bool forceProcess = false)
10471029

10481030
if (time > _nextSample || forceProcess)
10491031
{
1050-
Log.Debug("LiveTradingResultHandler.ProcessSynchronousEvents(): Enter");
1051-
10521032
//Set next sample time: 4000 samples per backtest
10531033
_nextSample = time.Add(ResamplePeriod);
10541034

@@ -1078,7 +1058,6 @@ public virtual void ProcessSynchronousEvents(bool forceProcess = false)
10781058
if (Algorithm.Notify.Messages.TryDequeue(out message))
10791059
{
10801060
//Process the notification messages:
1081-
Log.Trace("LiveTradingResultHandler.ProcessSynchronousEvents(): Processing Notification...");
10821061
try
10831062
{
10841063
MessagingHandler.SendNotification(message);
@@ -1090,8 +1069,6 @@ public virtual void ProcessSynchronousEvents(bool forceProcess = false)
10901069
}
10911070
}
10921071
}
1093-
1094-
Log.Debug("LiveTradingResultHandler.ProcessSynchronousEvents(): Exit");
10951072
}
10961073

10971074
/// <summary>

0 commit comments

Comments
 (0)