You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Repeated events are not coalesced, unlike trace-client-java 0.7.0 #28
The README says the Java and Python clients "speak the same wire format and make the same promises". That no longer holds for repeated events. trace-client-java 0.7.0 (Stephenson-Software/trace-client-java#30) coalesces identical reports, and this client sends each one.
The Java change was made because one server sent about 425k events in five days through a single command. In this client, Report queues every event (src/TraceClient/TraceClient.cs, _queue.TryAdd(body)), and Drain sends them one at a time. QueueCapacity bounds memory, but not the event rate. A program that reports in a tight loop sends one request after another for as long as it runs, limited only by how quickly the server answers.
What the Java client does
As described in that PR:
The first report is sent at once and opens a 60 s window. Identical reports inside the window are counted, and the count is sent as one event when the window closes.
A coalesced event carries the tag coalesced = count. It also carries value = count when the original event had no value.
close() flushes open counts. startup is never coalesced.
At most 256 distinct events are counted at once.
Why this is a decision, not an auto-fix
This changes behaviour that every vendoring program depends on, and adds a tag to the wire format, so the dev loop treats it as a contract change. These points need a maintainer's answer:
Should this client adopt coalescing at all, given that it mostly serves desktop programs and games rather than servers?
Should the window, the coalesced tag and the 256 cap match Java exactly?
Is trace-client-python expected to follow? The README's parity sentence needs rewording if the clients stay different.
How should the window close? Drain blocks on the queue, so it would need a timed wait. The one-background-thread design can be kept, but that is a real change to Drain and Close.
Python was not inspected for coalescing beyond its recent merged PR titles, none of which mention it.
Activity