import Span from '../../trace/span/Span' ; import { ContextCarrier } from '../context/ContextCarrier' ; import Context from '../context/Context' ; import { SpanType } from '../../proto/language-agent/Tracing_pb' ; import DummyContext from '../context/DummyContext' ; export default class DummySpan extends Span { static create ( context ? ) { return new DummySpan ( { context : context ?? new DummyContext ( ) , operation : '' , type : SpanType . LOCAL , } ) ; } start ( ) { if ( ! this . depth ++ ) this . context . start ( this ) ; } stop ( block ? ) { if ( ! -- this . depth ) this . context . stop ( this ) ; } async ( block ? ) { this . context . async ( this ) ; } resync ( ) { this . context . resync ( this ) ; } error ( error , statusOverride ? ) { return this ; } inject ( ) { return new ContextCarrier ( ) ; } extract ( carrier ) { return this ; } }