Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set up async profiling tasks #443

Merged
merged 5 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/store/modules/async-profiling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ export const asyncProfilingStore = defineStore({
duration: useAppStoreWithOut().durationTime,
});
if (!res.data.errors) {
this.instances = res.data.data.pods || [];
this.instances = (res.data.data.pods || []).map((d: Instance) => {
d.value = d.id || "";
return d;
});
}
return res.data;
},
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/topology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export const topologyStore = defineStore({
const json = await this.getEndpointTopology(ids);
if (depth > 2) {
const pods = json.nodes
.filter((d: Node) => ![...ids, ...endpointIds].includes(d.id) && d.name != userNodeName)
.filter((d: Node) => ![...ids, ...endpointIds].includes(d.id) && d.name !== userNodeName)
.map((item: Node) => item.id);
if (!pods.length) {
const nodes = [...res.nodes, ...json.nodes];
Expand All @@ -360,7 +360,7 @@ export const topologyStore = defineStore({
const topo = await this.getEndpointTopology(pods);
if (depth > 3) {
const endpoints = topo.nodes
.filter((d: Node) => ![...ids, ...pods, ...endpointIds].includes(d.id) && d.name != userNodeName)
.filter((d: Node) => ![...ids, ...pods, ...endpointIds].includes(d.id) && d.name !== userNodeName)
.map((item: Node) => item.id);
if (!endpoints.length) {
const nodes = [...res.nodes, ...json.nodes, ...topo.nodes];
Expand All @@ -373,7 +373,7 @@ export const topologyStore = defineStore({
const nodeIds = data.nodes
.filter(
(d: Node) =>
![...endpoints, ...ids, ...pods, ...endpointIds].includes(d.id) && d.name != userNodeName,
![...endpoints, ...ids, ...pods, ...endpointIds].includes(d.id) && d.name !== userNodeName,
)
.map((item: Node) => item.id);
if (!nodeIds.length) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/vec2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class Vec2 extends Float32Array {
constructor(v?: unknown, y?: unknown) {
super(2);
if (v instanceof Vec2 || v instanceof Float32Array || (v instanceof Array && v.length == 2)) {
if (v instanceof Vec2 || v instanceof Float32Array || (v instanceof Array && v.length === 2)) {
this[0] = v[0];
this[1] = v[1];
} else if (typeof v === "number" && typeof y === "number") {
Expand Down Expand Up @@ -104,7 +104,7 @@ class Vec2 extends Float32Array {
}
norm(out?: number[] | Vec2): number[] | Vec2 | undefined {
const mag = Math.sqrt(this[0] * this[0] + this[1] * this[1]);
if (mag == 0) return this;
if (mag === 0) return this;
out = out || this;
out[0] = this[0] / mag;
out[1] = this[1] / mag;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/vec3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class Vec3 extends Float32Array {
constructor(v?: unknown, y?: unknown, z?: unknown) {
super(3);
if (v instanceof Vec3 || v instanceof Float32Array || (v instanceof Array && v.length == 3)) {
if (v instanceof Vec3 || v instanceof Float32Array || (v instanceof Array && v.length === 3)) {
this[0] = v[0];
this[1] = v[1];
this[2] = v[2];
Expand Down Expand Up @@ -150,7 +150,7 @@ class Vec3 extends Float32Array {
}
static norm(x: unknown, y: unknown, z: unknown): Vec3 {
const rtn = new Vec3();
if (x instanceof Vec3 || x instanceof Float32Array || (x instanceof Array && x.length == 3)) {
if (x instanceof Vec3 || x instanceof Float32Array || (x instanceof Array && x.length === 3)) {
rtn.copy(x);
} else if (typeof x === "number" && typeof y === "number" && typeof z === "number") {
rtn.xyz(x, y, z);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ limitations under the License. -->
{{ dateFormat(i.createTime) }}
</span>
<span class="mr-10 sm">
{{ dateFormat(i.createTime + i.duration * 60 * 1000) }}
{{ dateFormat(i.createTime + i.duration * 1000) }}
</span>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Hex extends Int16Array {
}

xyz(x: number, y: number, z: number | null = null): Hex {
if (z == null) z = -x - y;
if (z === null) z = -x - y;
if (x + y + z != 0) {
console.log("Bad Axial Coordinate : : q %d r %d s %d", x, y, z);
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/dashboard/related/profile/Content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ limitations under the License. -->
<div class="item">
<SpanTree @loading="loadTrees" @displayMode="setDisplayMode" />
<div class="thread-stack">
<div id="graph-stack" ref="graph" v-show="displayMode == 'flame'" />
<div id="graph-stack" ref="graph" v-show="displayMode === 'flame'" />
<StackTable
v-show="displayMode == 'tree'"
v-show="displayMode === 'tree'"
v-if="profileStore.analyzeTrees.length"
:data="profileStore.analyzeTrees"
:highlightTop="profileStore.highlightTop"
Expand Down
2 changes: 1 addition & 1 deletion src/views/dashboard/related/trace/TraceList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ limitations under the License. -->
:class="{
'trace-success': !i.isError,
'trace-error': i.isError,
selected: selectedKey == i.key,
selected: selectedKey === i.key,
}"
>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/views/dashboard/related/trace/utils/d3-trace-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export default class ListGraph {
)
.on("click", (event: any, d: Recordable) => {
event.stopPropagation();
if (d.data.children.length == 0) return;
if (d.data.children.length === 0) return;
this.click(d, this);
});
nodeUpdate
Expand Down
2 changes: 1 addition & 1 deletion src/views/dashboard/related/trace/utils/d3-trace-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export default class TraceMap {
.attr("cursor", "pointer")
.on("click", (event: any, d: Recordable) => {
event.stopPropagation();
if (d.data.children.length == 0) return;
if (d.data.children.length === 0) return;
click(d);
});
const nodeExit = node
Expand Down
1 change: 1 addition & 0 deletions tsconfig.vitest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"extends": "./tsconfig.app.json",
"exclude": [],
"compilerOptions": {
"target": "esnext",
"lib": [],
"types": ["node", "jsdom"]
}
Expand Down
Loading