mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-14 09:00:50 +00:00
get process topology
This commit is contained in:
parent
15d9612b36
commit
fb5b7363e3
@ -83,7 +83,6 @@ export const ProcessTopology = {
|
|||||||
nodes {
|
nodes {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
type
|
|
||||||
isReal
|
isReal
|
||||||
serviceName
|
serviceName
|
||||||
serviceId
|
serviceId
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { TaskListItem } from "./../../types/profile.d";
|
|
||||||
/**
|
/**
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -22,11 +21,12 @@ import {
|
|||||||
EBPFProfilingSchedule,
|
EBPFProfilingSchedule,
|
||||||
EBPFTaskList,
|
EBPFTaskList,
|
||||||
AnalyzationTrees,
|
AnalyzationTrees,
|
||||||
|
ProcessNode,
|
||||||
} from "@/types/ebpf";
|
} from "@/types/ebpf";
|
||||||
import { store } from "@/store";
|
import { store } from "@/store";
|
||||||
import graphql from "@/graphql";
|
import graphql from "@/graphql";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
|
import { Call } from "@/types/topology";
|
||||||
interface EbpfStore {
|
interface EbpfStore {
|
||||||
taskList: EBPFTaskList[];
|
taskList: EBPFTaskList[];
|
||||||
networkTasks: EBPFTaskList[];
|
networkTasks: EBPFTaskList[];
|
||||||
@ -40,6 +40,8 @@ interface EbpfStore {
|
|||||||
selectedTask: Recordable<EBPFTaskList>;
|
selectedTask: Recordable<EBPFTaskList>;
|
||||||
selectedNetworkTask: Recordable<EBPFTaskList>;
|
selectedNetworkTask: Recordable<EBPFTaskList>;
|
||||||
aggregateType: string;
|
aggregateType: string;
|
||||||
|
nodes: ProcessNode[];
|
||||||
|
calls: Call[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ebpfStore = defineStore({
|
export const ebpfStore = defineStore({
|
||||||
@ -57,6 +59,8 @@ export const ebpfStore = defineStore({
|
|||||||
selectedTask: {},
|
selectedTask: {},
|
||||||
selectedNetworkTask: {},
|
selectedNetworkTask: {},
|
||||||
aggregateType: "COUNT",
|
aggregateType: "COUNT",
|
||||||
|
nodes: [],
|
||||||
|
calls: [],
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
setSelectedTask(task: EBPFTaskList) {
|
setSelectedTask(task: EBPFTaskList) {
|
||||||
@ -207,6 +211,21 @@ export const ebpfStore = defineStore({
|
|||||||
this.analyzeTrees = analysisEBPFResult.trees;
|
this.analyzeTrees = analysisEBPFResult.trees;
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
|
async getProcessTopology(params: {
|
||||||
|
duration: any;
|
||||||
|
serviceInstanceId: string;
|
||||||
|
}) {
|
||||||
|
const res: AxiosResponse = await graphql
|
||||||
|
.query("getProcessTopology")
|
||||||
|
.params(params);
|
||||||
|
if (res.data.errors) {
|
||||||
|
this.nodes = [];
|
||||||
|
this.calls = [];
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
const topo = res.data.data;
|
||||||
|
return res.data;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
10
src/types/ebpf.d.ts
vendored
10
src/types/ebpf.d.ts
vendored
@ -75,3 +75,13 @@ export type AnalyzationTrees = {
|
|||||||
dumpCount: number;
|
dumpCount: number;
|
||||||
stackType: string;
|
stackType: string;
|
||||||
};
|
};
|
||||||
|
export type ProcessNode = {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
serviceId: string;
|
||||||
|
serviceName: string;
|
||||||
|
serviceInstanceId: string;
|
||||||
|
serviceInstanceName: string;
|
||||||
|
name: string;
|
||||||
|
isReal: boolean;
|
||||||
|
};
|
||||||
|
@ -19,13 +19,16 @@ limitations under the License. -->
|
|||||||
<div class="schedules">
|
<div class="schedules">
|
||||||
<Schedules />
|
<Schedules />
|
||||||
</div>
|
</div>
|
||||||
<div class="item">EBPF Stack</div>
|
<div class="item">
|
||||||
|
<Topology></Topology>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import Tasks from "./components/Tasks.vue";
|
import Tasks from "./components/Tasks.vue";
|
||||||
import Schedules from "./components/Schedules.vue";
|
import Schedules from "./components/Schedules.vue";
|
||||||
|
import Topology from "./components/Topology.vue";
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content {
|
.content {
|
||||||
|
@ -16,13 +16,28 @@ limitations under the License. -->
|
|||||||
<div ref="topology" class="topology"></div>
|
<div ref="topology" class="topology"></div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { useEbpfStore } from "@/store/modules/ebpf";
|
import { useEbpfStore } from "@/store/modules/ebpf";
|
||||||
|
import { useSelectorStore } from "@/store/modules/selectors";
|
||||||
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
|
||||||
/*global Nullable */
|
const selectorStore = useSelectorStore();
|
||||||
const { t } = useI18n();
|
|
||||||
const ebpfStore = useEbpfStore();
|
const ebpfStore = useEbpfStore();
|
||||||
|
const appStore = useAppStoreWithOut();
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getTopology();
|
||||||
|
});
|
||||||
|
|
||||||
|
function getTopology() {
|
||||||
|
const serviceInstanceId =
|
||||||
|
(selectorStore.currentPod && selectorStore.currentPod.id) || "";
|
||||||
|
ebpfStore.getProcessTopology({
|
||||||
|
serviceInstanceId,
|
||||||
|
duration: appStore.durationTime,
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.topology {
|
.topology {
|
||||||
|
Loading…
Reference in New Issue
Block a user