Sha256: 8b51537a902a7d0dae92b9cfbda7344059c91fe9f3cbd7ce0f52f9859ac3cfdd
Contents?: true
Size: 909 Bytes
Versions: 4
Compression:
Stored size: 909 Bytes
Contents
#include "current_trace.h" #include "event_store.h" #include "types/event.h" static __thread Trace *current_trace = NULL; Trace *get_current_trace() { return current_trace; } VALUE rb_create_trace(VALUE _self) { if(current_trace != NULL) { current_trace->active = false; Event event = {}; event.trace = current_trace; event.event = END_OF_OBSOLOTE_TRACE_EVENT; produce_event(event); // This will tell sidecar to free the memory } Span *span = malloc(sizeof(Span)); span->children_count = 0; span->caller = NULL; current_trace = malloc(sizeof(Trace)); current_trace->finished = false; current_trace->top_span = span; current_trace->current_span = span; current_trace->active = true; return Qtrue; } VALUE rb_send_eot(VALUE _self) { Event event = {}; event.trace = current_trace; event.event = END_OF_TRACE; produce_event(event); return Qtrue; }
Version data entries
4 entries across 4 versions & 1 rubygems