<commit_before>package com.ai.cloud.skywalking.analysis.chainbuild;

import com.ai.cloud.skywalking.analysis.chainbuild.po.ChainNode;
import com.ai.cloud.skywalking.protocol.CallType;
import com.ai.cloud.skywalking.protocol.Span;

public class SpanEntry {

    private Span clientSpan;
    private Span serverSpan;

    public SpanEntry() {

    }

    public int getLevelId() {
        if (clientSpan != null) {
            return clientSpan.getLevelId();
        }

        return serverSpan.getLevelId();
    }

    public String getParentLevelId() {
        if (clientSpan != null) {
            return clientSpan.getParentLevel();
        }

        return serverSpan.getParentLevel();
    }

    public String getViewPoint() {
        if (clientSpan != null) {
            return clientSpan.getViewPointId();
        }

        return serverSpan.getViewPointId();
    }

    public CallType getCallType() {
        if (clientSpan != null) {
            return CallType.convert(clientSpan.getCallType());
        }

        return CallType.convert(serverSpan.getCallType());
    }

    public long getCost() {
        long resultCost = 0;
        switch (getCallType()) {
            case ASYNC:
                resultCost = getClientCost() + getServerCost();
                break;
            case SYNC:
                resultCost = getClientCost();
                if (getClientSpan() == null) {
                    resultCost = getServerCost();
                }
                break;
            case LOCAL:
                resultCost = getClientCost();
                break;
        }

        return resultCost;
    }

    private long getClientCost() {
        if (clientSpan != null) {
            return clientSpan.getCost();
        }

        return 0;
    }

    private long getServerCost() {
        if (serverSpan != null) {
            return serverSpan.getCost();
        }

        return 0;
    }

    public String getBusinessKey() {
        if (clientSpan != null) {
            return clientSpan.getBusinessKey();
        }

        return serverSpan.getBusinessKey();
    }

    public void setBusinessKey(String businessKey) {
        if (clientSpan != null) {
            clientSpan.setBusinessKey(businessKey);
        }<commit_msg>修复JDBC类型的Span无法出统计结果<commit_after>package com.ai.cloud.skywalking.analysis.chainbuild;

import com.ai.cloud.skywalking.analysis.chainbuild.po.ChainNode;
import com.ai.cloud.skywalking.protocol.CallType;
import com.ai.cloud.skywalking.protocol.Span;

public class SpanEntry {

    private Span clientSpan;
    private Span serverSpan;

    public SpanEntry() {

    }

    public int getLevelId() {
        if (clientSpan != null) {
            return clientSpan.getLevelId();
        }

        return serverSpan.getLevelId();
    }

    public String getParentLevelId() {
        if (clientSpan != null) {
            return clientSpan.getParentLevel();
        }

        return serverSpan.getParentLevel();
    }

    public String getViewPoint() {
        if (clientSpan != null) {
            return clientSpan.getViewPointId();
        }

        return serverSpan.getViewPointId();
    }

    public CallType getCallType() {
        if (clientSpan != null) {
            return CallType.convert(clientSpan.getCallType());
        }

        return CallType.convert(serverSpan.getCallType());
    }

    public long getCost() {
        long resultCost = 0;
        switch (getCallType()) {
            case ASYNC:
                resultCost = getClientCost() + getServerCost();
                break;
            case SYNC:
                resultCost = getClientCost();
                if (getClientSpan() == null) {
                    resultCost = getServerCost();
                }
                break;
            case LOCAL:
                resultCost = getClientCost();
                break;
        }

        return resultCost;
    }

    private long getClientCost() {
        if (clientSpan != null) {
            return clientSpan.getCost();
        }

        return 0;
    }

    private long getServerCost() {
        if (serverSpan != null) {
            return serverSpan.getCost();
        }

        return 0;
    }

    public String getBusinessKey() {
        if (clientSpan != null) {
            return clientSpan.getBusinessKey();
        }

        return serverSpan.getBusinessKey();
    }

    public void setBusinessKey(String businessKey) {
        if (clientSpan != null) {
            clientSpan.setBusinessKey(businessKey);
            return;
        }
{'fraction_non_alphanumeric': 0.09717043211230533, 'fraction_numerical': 0.0013160780872998464, 'mean_word_length': 1.7536231884057971, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3407981', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1209, 'n_words': 257}