the log file stops my display

VictorChen1142 · 27 May 2025, 12:19 UTC

Closed
VI
VictorChen1142
My FR5 diagnostic replay looks disconnected when I export a large log from the same folder. The display freezes, then several readings appear together. I added detailed logging recently. This application only displays diagnostics. Another person will maintain it after me, and I do not want to leave them an 'offline' warning which actually means my file handling is slow. Where should I put timing checks first?

13 replies

LE
LeahBarnes0582
Replying to VictorChen1142

Time the receive step, file write and display update separately, using a monotonic clock for durations so a clock adjustment does not confuse the comparison.

18 points
VI
VictorChen1142
Replying to LeahBarnes0582

Receive and file write are in the same callback. I only timed the whole callback before. I can split that measurement.

6 points
HA
HazelBrown0919
Replying to VictorChen1142

Get the file write out of that callback. A busy disk shouldn't make the screen sit there pretending nothing has changed. But cap whatever queue you add, or you'll just build a different mess.

20 points
LE
LeahBarnes0582
Replying to HazelBrown0919

I would keep the measurements first, since moving the write will not help if the callback is also waiting on another blocking operation.

6 points
HA
HazelBrown0919
Replying to LeahBarnes0582

Sure, time it. I wouldn't keep the design though, even if this particular stall turns out to be elsewhere.

25 points
VI
VictorChen1142
Replying to LeahBarnes0582

The long interval is inside the file write. Receive finishes before it. Thank you for suggesting separate timings; the combined number hid that.

15 points
YA
YasminBennett0702
Replying to VictorChen1142

Show the age of the last reading too. A frozen value can look perfectly believable if you're not staring at the clock.

21 points
AA
AaronBaker0436
Replying to HazelBrown0919

I'd let routine diagnostic lines drop before letting the queue eat all the memory, but show how many were dropped. Otherwise support gets a very convincing incomplete log.

11 points
LE
LeahBarnes0582
Replying to AaronBaker0436

That policy depends on the log's purpose; if particular events must be retained, distinguish them from high-volume diagnostic samples and make a recording failure visible.

21 points
AA
AaronBaker0436
Replying to LeahBarnes0582

Yes, I meant the repeated sample lines. Not every event. Thanks for catching that; I'd label the two streams separately in the handover.

15 points
VI
VictorChen1142
Replying to HazelBrown0919

I tried a bounded queue in the replay application. The display continues while the writer falls behind, with an increasing age on the saved-log position. Still deciding which samples can be dropped.

21 points
YA
YasminBennett0702
Replying to VictorChen1142

Does closing the window leave a writer hanging around? That's the bit I'd try next, with the queue still full.

10 points
VI
VictorChen1142
Replying to YasminBennett0702

It does. The window goes away but the process remains. I have another change to make before anyone else gets this version.

6 points

Discussion closed

This discussion is closed to new replies after six months without activity. Last activity: .