@Override
    public void close() {
        if (closed) {
            logger.warn("Already closed {}", this);
            return;
        }
        closed = true;

        final long afterTime = System.currentTimeMillis();
        if (!callStack.empty()) {
            if (logger.isWarnEnabled()) {
                stackDump("not empty call stack");
            }
            // skip
        } else {
            if (span.isTimeRecording()) {
                span.markAfterTime(afterTime);
            }
            logSpan();
        }

        this.wrappedSpanEventRecorder.close();
        this.storage.close();
        this.closeListener.close(afterTime);
    }
@author netspider
@author emeroad
@author jaehong.kim
agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DefaultTrace.java