static void registerAllSpanNamesForCollection() { Tracing.getExportComponent() .getSampledSpanStore() .registerSpanNamesForCollection(ALL_SPAN_NAMES); }
/** * Returns the no-op implementation of the {@code ExportComponent}. * * @return the no-op implementation of the {@code ExportComponent}. * @since 0.5 */ public static ExportComponent newNoopExportComponent() { return new NoopExportComponent(); }
/** * Returns a new immutable {@code TimedEvent<T>}. * * @param timestamp the {@code Timestamp} of this event. * @param event the event. * @param <T> the type of value that is timed. * @return a new immutable {@code TimedEvent<T>} * @since 0.5 */ public static <T> TimedEvent<T> create(Timestamp timestamp, T event) { return new AutoValue_SpanData_TimedEvent<T>(timestamp, event); }
@After public void teardown() { SpanExporter exporter = Tracing.getExportComponent().getSpanExporter(); exporter.unregisterHandler("testing"); }
/** * Unregisters the {@code InstanaTraceExporter}. * * @param spanExporter the instance of the {@code SpanExporter} from where this service is * unregistered. */ @VisibleForTesting static void unregister(SpanExporter spanExporter) { spanExporter.unregisterHandler(REGISTER_NAME); } }
private static String toSpanName(SpanData spanData) { return spanData.getName(); }
@Test public void noopSampledSpanStore_GetLatencySampledSpans() { SampledSpanStore sampledSpanStore = ExportComponent.newNoopExportComponent().getSampledSpanStore(); Collection<SpanData> latencySampledSpans = sampledSpanStore.getLatencySampledSpans( SampledSpanStore.LatencyFilter.create("TestLatencyFilter", 0, 0, 0)); assertThat(latencySampledSpans).isEmpty(); }
@Test public void noopSampledSpanStore_GetErrorSampledSpans() { SampledSpanStore sampledSpanStore = ExportComponent.newNoopExportComponent().getSampledSpanStore(); Collection<SpanData> errorSampledSpans = sampledSpanStore.getErrorSampledSpans( SampledSpanStore.ErrorFilter.create("TestErrorFilter", null, 0)); assertThat(errorSampledSpans).isEmpty(); }
@Override public SpanExporter getSpanExporter() { return SpanExporter.getNoopSpanExporter(); }
@Override public RunningSpanStore getRunningSpanStore() { return RunningSpanStore.getNoopRunningSpanStore(); }
/** * Returns a {@code SampledSpanStore} that maintains a set of span names, but always returns an * empty list of {@link SpanData}. * * @return a {@code SampledSpanStore} that maintains a set of span names, but always returns an * empty list of {@code SpanData}. */ static SampledSpanStore newNoopSampledSpanStore() { return new NoopSampledSpanStore(); }
static void exportSpans(String... spans) { SampledSpanStore store = Tracing.getExportComponent().getSampledSpanStore(); if (store != null) { store.registerSpanNamesForCollection(Arrays.asList(spans)); } } }
@Override public SpanExporter getSpanExporter() { return SpanExporter.getNoopSpanExporter(); }
@Override public RunningSpanStore getRunningSpanStore() { return RunningSpanStore.getNoopRunningSpanStore(); }
/** * Returns the no-op implementation of the {@code ExportComponent}. * * @return the no-op implementation of the {@code ExportComponent}. */ public static ExportComponent newNoopExportComponent() { return new NoopExportComponent(); }
/** * Returns a new immutable {@code TimedEvent<T>}. * * @param timestamp the {@code Timestamp} of this event. * @param event the event. * @param <T> the type of value that is timed. * @return a new immutable {@code TimedEvent<T>} */ public static <T> TimedEvent<T> create(Timestamp timestamp, T event) { return new AutoValue_SpanData_TimedEvent<T>(timestamp, event); }
/** * Returns a {@code SampledSpanStore} that maintains a set of span names, but always returns an * empty list of {@link SpanData}. * * @return a {@code SampledSpanStore} that maintains a set of span names, but always returns an * empty list of {@code SpanData}. */ static SampledSpanStore newNoopSampledSpanStore() { return new NoopSampledSpanStore(); }
static void registerAllSpanNamesForCollection() { Tracing.getExportComponent() .getSampledSpanStore() .registerSpanNamesForCollection(ALL_SPAN_NAMES); }
static void exportSpans(String... spans) { SampledSpanStore store = Tracing.getExportComponent().getSampledSpanStore(); if (store != null) { store.registerSpanNamesForCollection(Arrays.asList(spans)); } } }
Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection( Arrays.asList(SAMPLE_SPAN));