mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: trace profiling
This commit is contained in:
parent
341966c52e
commit
50ca810c7e
@ -163,7 +163,7 @@ export const profileStore = defineStore({
|
|||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
async getSegmentSpans(params: { segmentId: string }) {
|
async getSegmentSpans(params: { segmentId: string }) {
|
||||||
if (!params.segmentId) {
|
if (!(params && params.segmentId)) {
|
||||||
return new Promise((resolve) => resolve({}));
|
return new Promise((resolve) => resolve({}));
|
||||||
}
|
}
|
||||||
const res: AxiosResponse = await graphql.query("queryProfileSegment").params(params);
|
const res: AxiosResponse = await graphql.query("queryProfileSegment").params(params);
|
||||||
|
@ -58,6 +58,7 @@ limitations under the License. -->
|
|||||||
const key = computed(
|
const key = computed(
|
||||||
() =>
|
() =>
|
||||||
(profileStore.currentSegment &&
|
(profileStore.currentSegment &&
|
||||||
|
profileStore.currentSegment.spans &&
|
||||||
profileStore.currentSegment.spans.length &&
|
profileStore.currentSegment.spans.length &&
|
||||||
profileStore.currentSegment.spans[0].segmentId) ||
|
profileStore.currentSegment.spans[0].segmentId) ||
|
||||||
"",
|
"",
|
||||||
|
@ -14,7 +14,10 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License. -->
|
limitations under the License. -->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div :class="['profile-item', 'level' + data.parentId]" :style="{ color: data.topDur ? '#448dfe' : '#3d444f' }">
|
<div
|
||||||
|
:class="['profile-item', 'level' + data.parentId]"
|
||||||
|
:style="{ color: data.topDur ? '#448dfe' : appStore.theme === Themes.Dark ? '#fafbfc' : '#3d444f' }"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
:class="['thread', 'level' + data.parentId]"
|
:class="['thread', 'level' + data.parentId]"
|
||||||
:style="{
|
:style="{
|
||||||
@ -47,6 +50,8 @@ limitations under the License. -->
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ref, defineComponent, toRefs } from "vue";
|
import { ref, defineComponent, toRefs } from "vue";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
import { Themes } from "@/constants/data";
|
||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
data: { type: Object as PropType<any>, default: () => ({}) },
|
data: { type: Object as PropType<any>, default: () => ({}) },
|
||||||
@ -56,24 +61,25 @@ limitations under the License. -->
|
|||||||
name: "TableItem",
|
name: "TableItem",
|
||||||
props,
|
props,
|
||||||
setup(props) {
|
setup(props) {
|
||||||
|
const appStore = useAppStoreWithOut();
|
||||||
const displayChildren = ref<boolean>(true);
|
const displayChildren = ref<boolean>(true);
|
||||||
function toggle() {
|
function toggle() {
|
||||||
displayChildren.value = !displayChildren.value;
|
displayChildren.value = !displayChildren.value;
|
||||||
}
|
}
|
||||||
return { toggle, displayChildren, ...toRefs(props) };
|
return { Themes, appStore, toggle, displayChildren, ...toRefs(props) };
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./profile.scss";
|
@import url("./profile.scss");
|
||||||
|
|
||||||
.profile-item.level0 {
|
.profile-item.level0 {
|
||||||
background: rgba(0, 0, 0, 0.04);
|
background-color: var(--sw-list-hover);
|
||||||
color: #448dfe;
|
color: var(--el-color-primary);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(0, 0, 0, 0.04);
|
background-color: var(--sw-list-hover);
|
||||||
color: #448dfe;
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
@ -81,7 +87,7 @@ limitations under the License. -->
|
|||||||
content: "";
|
content: "";
|
||||||
width: 5px;
|
width: 5px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #448dfe;
|
background-color: var(--el-color-primary);
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,11 +98,11 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
.profile-item.selected {
|
.profile-item.selected {
|
||||||
background: rgba(0, 0, 0, 0.04);
|
background-color: var(--sw-list-selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-item:not(.level0):hover {
|
.profile-item:not(.level0):hover {
|
||||||
background: rgba(0, 0, 0, 0.04);
|
background-color: var(--sw-list-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-item > div {
|
.profile-item > div {
|
||||||
@ -123,7 +129,7 @@ limitations under the License. -->
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 6px;
|
height: 6px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background: rgb(63, 177, 227);
|
background: var(--el-color-primary);
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 11px;
|
margin-top: 11px;
|
||||||
border: none;
|
border: none;
|
||||||
@ -131,7 +137,7 @@ limitations under the License. -->
|
|||||||
|
|
||||||
.inner-progress_bar {
|
.inner-progress_bar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: rgb(110, 64, 170);
|
background: rgb(110 64 170);
|
||||||
height: 4px;
|
height: 4px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -143,11 +143,12 @@ limitations under the License. -->
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { ref, computed, defineComponent } from "vue";
|
import { ref, computed, defineComponent, watch } from "vue";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import SpanDetail from "../D3Graph/SpanDetail.vue";
|
import SpanDetail from "../D3Graph/SpanDetail.vue";
|
||||||
import { dateFormat } from "@/utils/dateFormat";
|
import { dateFormat } from "@/utils/dateFormat";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
import { Themes } from "@/constants/data";
|
||||||
|
|
||||||
/*global Recordable*/
|
/*global Recordable*/
|
||||||
const props = {
|
const props = {
|
||||||
@ -201,12 +202,12 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
const items: any = document.querySelectorAll(".trace-item");
|
const items: any = document.querySelectorAll(".trace-item");
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
item.style.background = "#fff";
|
item.style.background = appStore.theme === Themes.Dark ? "#212224" : "#fff";
|
||||||
}
|
}
|
||||||
dom.style.background = "rgba(0, 0, 0, 0.1)";
|
dom.style.background = appStore.theme === Themes.Dark ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.1)";
|
||||||
const p: any = document.getElementsByClassName("profiled")[0];
|
const p: any = document.getElementsByClassName("profiled")[0];
|
||||||
if (p) {
|
if (p) {
|
||||||
p.style.background = "#eee";
|
p.style.background = appStore.theme === Themes.Dark ? "#333" : "#eee";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function selectSpan(event: Recordable) {
|
function selectSpan(event: Recordable) {
|
||||||
@ -232,6 +233,19 @@ limitations under the License. -->
|
|||||||
showSelectSpan(dom);
|
showSelectSpan(dom);
|
||||||
showDetail.value = true;
|
showDetail.value = true;
|
||||||
}
|
}
|
||||||
|
watch(
|
||||||
|
() => appStore.theme,
|
||||||
|
() => {
|
||||||
|
const items: any = document.querySelectorAll(".trace-item");
|
||||||
|
for (const item of items) {
|
||||||
|
item.style.background = appStore.theme === Themes.Dark ? "#212224" : "#fff";
|
||||||
|
}
|
||||||
|
const p: any = document.getElementsByClassName("profiled")[0];
|
||||||
|
if (p) {
|
||||||
|
p.style.background = appStore.theme === Themes.Dark ? "#333" : "#eee";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
return {
|
return {
|
||||||
displayChildren,
|
displayChildren,
|
||||||
outterPercent,
|
outterPercent,
|
||||||
@ -272,7 +286,8 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
.profiled {
|
.profiled {
|
||||||
background-color: #eee;
|
// background-color: #eee;
|
||||||
|
background-color: var(--sw-table-header);
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,7 +303,7 @@ limitations under the License. -->
|
|||||||
background-color: $font-color;
|
background-color: $font-color;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow: #eee 1px 2px 10px;
|
box-shadow: var(--box-shadow-color) 0 2px 3px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,11 +335,11 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trace-item.selected {
|
.trace-item.selected {
|
||||||
background: rgb(0 0 0 / 4%);
|
background-color: var(--sw-list-selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
.trace-item:not(.level0):hover {
|
.trace-item:not(.level0):hover {
|
||||||
background: rgb(0 0 0 / 4%);
|
background-color: var(--sw-list-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.trace-item > div {
|
.trace-item > div {
|
||||||
|
Loading…
Reference in New Issue
Block a user