mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 08:17:33 +00:00
fix: update profiling
This commit is contained in:
parent
bdd376ffb3
commit
e02f91deef
@ -69,6 +69,7 @@ export const profileStore = defineStore({
|
||||
},
|
||||
setCurrentTask(task: TaskListItem) {
|
||||
this.currentTask = task || {};
|
||||
this.analyzeTrees = [];
|
||||
},
|
||||
setSegmentSpans(spans: Recordable<SegmentSpan>[]) {
|
||||
const index = spans.length - 1 || 0;
|
||||
@ -77,9 +78,18 @@ export const profileStore = defineStore({
|
||||
},
|
||||
setCurrentSpan(span: Recordable<SegmentSpan>) {
|
||||
this.currentSpan = span;
|
||||
this.analyzeTrees = [];
|
||||
},
|
||||
setCurrentSegment(s: Recordable<Trace>) {
|
||||
this.currentSegment = s;
|
||||
setCurrentSegment(segment: Trace) {
|
||||
this.currentSegment = segment;
|
||||
this.segmentSpans = segment.spans || [];
|
||||
if (segment.spans) {
|
||||
const index = segment.spans.length - 1 || 0;
|
||||
this.currentSpan = segment.spans[index];
|
||||
} else {
|
||||
this.currentSpan = {};
|
||||
}
|
||||
this.analyzeTrees = [];
|
||||
},
|
||||
setHighlightTop() {
|
||||
this.highlightTop = !this.highlightTop;
|
||||
|
@ -20,7 +20,7 @@ limitations under the License. -->
|
||||
{{ t("noData") }}
|
||||
</div>
|
||||
<table class="profile-t">
|
||||
<tr class="profile-tr cp" v-for="(i, index) in profileStore.segmentList" @click="selectTrace(i)" :key="index">
|
||||
<tr class="profile-tr cp" v-for="(i, index) in profileStore.segmentList" @click="selectSegment(i)" :key="index">
|
||||
<td
|
||||
class="profile-td"
|
||||
:class="{
|
||||
@ -57,7 +57,7 @@ limitations under the License. -->
|
||||
const profileStore = useProfileStore();
|
||||
const key = computed(() => (profileStore.currentSpan && profileStore.currentSpan.segmentId) || "");
|
||||
|
||||
async function selectTrace(item: Trace) {
|
||||
async function selectSegment(item: Trace) {
|
||||
profileStore.setCurrentSegment(item);
|
||||
profileStore.setSegmentSpans(item.spans);
|
||||
}
|
||||
|
@ -69,6 +69,10 @@ limitations under the License. -->
|
||||
}
|
||||
|
||||
async function analyzeProfile() {
|
||||
if (!profileStore.currentSpan.profiled) {
|
||||
ElMessage.info("It's a un-profiled span");
|
||||
return;
|
||||
}
|
||||
emits("loading", true);
|
||||
updateTimeRange();
|
||||
const params = timeRange.value.map((t: { start: number; end: number }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user