Conversation
🤖 Code FormattingYour PR still has some code formatting issues. I've updated PR #590 with the necessary formatting changes. You can merge that PR into this branch to fix the code style check. Alternatively, you can run |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-6 #589 +/- ##
============================================
Coverage ? 80.74%
============================================
Files ? 212
Lines ? 6462
Branches ? 0
============================================
Hits ? 5218
Misses ? 1244
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think storing the |
|
I would strongly not suggest doing the Also we discussed that a bit in the corresponding RxInferBoard discussion and reached the conclusion that the tracing system should be dead-simple linear and should not have a notion of a span by itself. Spans are OpenTelemetry related and do not exist in TensorBoard for example. So ReactiveMP should not inherently create those spans but it should make it easy to recover those spans (e.g. with extra fields like |
|
The current solution is not bad either btw, so I don't have a strong preference of this implementation over the |
|
I only want to make sure that this extra field does not have performance implications in a sense that if there are no callbacks, Julia compile should be able to remove both callsites. Can you write a test for that to make sure that is what is happening (with the |
🤖 Code FormattingYour PR still has some code formatting issues. I've updated PR #590 with the necessary formatting changes. You can merge that PR into this branch to fix the code style check. Alternatively, you can run |
wouterwln
left a comment
There was a problem hiding this comment.
Super nice, I like this a lot
|
It seems that Julia v1.10 isn't that smart :( I'm ok with just guarding the test with |
|
OR - it might also happening because |
🤖 Code FormattingYour PR still has some code formatting issues. I've updated PR #590 with the necessary formatting changes. You can merge that PR into this branch to fix the code style check. Alternatively, you can run |
🤖 Code FormattingYour PR still has some code formatting issues. I've updated PR #590 with the necessary formatting changes. You can merge that PR into this branch to fix the code style check. Alternatively, you can run |
|
I'll work through the CI Julia 1.10 and then I merge 👍 |
|
For future reference, here is a function that matches traces based on their ID: function find_spans(trace_events::Vector{TracedEvent})
# Found spans
spans = Tuple{TracedEvent,TracedEvent}[]
# Currently waiting to be matched
lonely = OrderedDict{Base.UUID, Any}()
# No match possible
not_matched = TracedEvent[]
for te in trace_events
event = te.event
if hasfield(typeof(event), :trace_id)
tid = event.trace_id
friend = get(lonely, tid, nothing)
if !isnothing(friend)
delete!(lonely, tid)
push!(spans, (friend, te))
else
lonely[tid] = te
end
else
push!(not_matched, te)
end
end
push!(not_matched, values(lonely)...)
return (; spans, not_matched )
end |
I think it is useful to link before and after events. Here is one implementation, using a field
trace_idadded to events. This also needs to be done to the events defined in RxInfer.jl.It works, but maybe we can do better?
Alternative 1:
beforefield inAfterSomethingeventsWe can add a field
.beforethat stores the counterpart of anAfterSomethingevent. Instead oftrace_id. (Then the 'before' objectID functions the trace ID.)Aternative 2:
Before{...}andAfter{...}typesWe could change the types to eg:
The
Aftertype can have a.resultfield.Then we can replace this:
with: