public static Segment beginSegment(String name) { return globalRecorder.beginSegment(name); }
public static Segment beginSegment(String name, TraceID traceId, String parentId) { return globalRecorder.beginSegment(name, traceId, parentId); }
public static Segment beginSegment(String name) { return globalRecorder.beginSegment(name); }
public static Segment beginSegment(String name, TraceID traceId, String parentId) { return globalRecorder.beginSegment(name, traceId, parentId); }
/** * Sets the current segment to a new instance of {@code DummySegment}. * * @return the newly created {@code DummySegment}. */ public Segment beginDummySegment() { return beginSegment(new DummySegment(this)); }
/** * Sets the current segment to a new instance of {@code DummySegment}. * * @return the newly created {@code DummySegment}. */ public Segment beginDummySegment() { return beginSegment(new DummySegment(this)); }
public Segment beginDummySegment(TraceID traceId) { return beginSegment(new DummySegment(this, traceId)); }
public Segment beginSegment(String name) { return beginSegment(new SegmentImpl(this, name)); }
public Segment beginDummySegment(TraceID traceId) { return beginSegment(new DummySegment(this, traceId)); }
public Segment beginSegment(String name) { return beginSegment(new SegmentImpl(this, name)); }
public Segment beginSegment(String name, TraceID traceId, String parentId) { Segment segment = new SegmentImpl(this, name, traceId); segment.setParentId(parentId); return beginSegment(segment); }
public Segment beginSegment(String name, TraceID traceId, String parentId) { Segment segment = new SegmentImpl(this, name, traceId); segment.setParentId(parentId); return beginSegment(segment); }
/** * Begins a segment, runs the provided runnable, and ends the segment before returning the supplier's result. Intercepts exceptions, adds them to the segment, and re-throws them. * * @param name * the name to use for the created segment * @param runnable * the runnable to run */ public void createSegment(String name, Runnable runnable) { Segment segment = beginSegment(name); try { runnable.run(); } catch (Exception e) { segment.addException(e); throw e; } finally { endSegment(); } }
/** * Begins a segment and passes it to the supplied consumer. Intercepts exceptions, adds them to the segment, and re-throws them. * * @param name * the name to use for the created segment * @param consumer * the function to invoke */ public void createSegment(String name, Consumer<Segment> consumer) { Segment segment = beginSegment(name); try { consumer.accept(segment); } catch (Exception e) { segment.addException(e); throw e; } finally { endSegment(); } }
/** * Begins a segment and passes it to the supplied consumer. Intercepts exceptions, adds them to the segment, and re-throws them. * * @param name * the name to use for the created segment * @param consumer * the function to invoke */ public void createSegment(String name, Consumer<Segment> consumer) { Segment segment = beginSegment(name); try { consumer.accept(segment); } catch (Exception e) { segment.addException(e); throw e; } finally { endSegment(); } }
/** * Begins a segment, runs the provided runnable, and ends the segment before returning the supplier's result. Intercepts exceptions, adds them to the segment, and re-throws them. * * @param name * the name to use for the created segment * @param runnable * the runnable to run */ public void createSegment(String name, Runnable runnable) { Segment segment = beginSegment(name); try { runnable.run(); } catch (Exception e) { segment.addException(e); throw e; } finally { endSegment(); } }
/** * Begins a segment, invokes the provided supplier, and ends the segment before returning the supplier's result. Intercepts exceptions, adds them to the segment, and re-throws them. * * @param <R> * the type of the value returned by {@code supplier} * @param name * the name to use for the created segment * @param supplier * the supplier to invoke * @return the value returned by the provided supplier */ public <R> R createSegment(String name, Supplier<R> supplier) { Segment segment = beginSegment(name); try { return supplier.get(); } catch (Exception e) { segment.addException(e); throw e; } finally { endSegment(); } }
/** * Begins a segment, passes it to the supplied function, and ends the segment before returning the supplied function's result. Intercepts exceptions, adds them to the segment, and re-throws them. * * @param <R> * the type of the value returned by {@code function} * @param name * the name to use for the created segment * @param function * the function to invoke * @return the value returned by the supplied function */ public <R> R createSegment(String name, Function<Segment, R> function) { Segment segment = beginSegment(name); try { return function.apply(segment); } catch (Exception e) { segment.addException(e); throw e; } finally { endSegment(); } }
/** * Begins a segment, passes it to the supplied function, and ends the segment before returning the supplied function's result. Intercepts exceptions, adds them to the segment, and re-throws them. * * @param <R> * the type of the value returned by {@code function} * @param name * the name to use for the created segment * @param function * the function to invoke * @return the value returned by the supplied function */ public <R> R createSegment(String name, Function<Segment, R> function) { Segment segment = beginSegment(name); try { return function.apply(segment); } catch (Exception e) { segment.addException(e); throw e; } finally { endSegment(); } }
/** * Begins a segment, invokes the provided supplier, and ends the segment before returning the supplier's result. Intercepts exceptions, adds them to the segment, and re-throws them. * * @param <R> * the type of the value returned by {@code supplier} * @param name * the name to use for the created segment * @param supplier * the supplier to invoke * @return the value returned by the provided supplier */ public <R> R createSegment(String name, Supplier<R> supplier) { Segment segment = beginSegment(name); try { return supplier.get(); } catch (Exception e) { segment.addException(e); throw e; } finally { endSegment(); } }