mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:49:24 +00:00
fix
This commit is contained in:
parent
ef73ace6ce
commit
f152520d4e
@ -124,7 +124,7 @@ export const TestJson = {
|
||||
results: [
|
||||
{
|
||||
metric: {
|
||||
labels: [{ key: "name", value: "1" }],
|
||||
labels: [{ key: "p", value: "75" }],
|
||||
},
|
||||
values: [
|
||||
{
|
||||
@ -161,7 +161,7 @@ export const TestJson = {
|
||||
},
|
||||
{
|
||||
metric: {
|
||||
labels: [{ key: "name", value: "2" }],
|
||||
labels: [{ key: "p", value: "50" }],
|
||||
},
|
||||
values: [
|
||||
{
|
||||
@ -203,7 +203,7 @@ export const TestJson = {
|
||||
results: [
|
||||
{
|
||||
metric: {
|
||||
labels: [{ key: "name", value: "service_cpm1" }],
|
||||
labels: [{ key: "name", value: "service_resp_time1" }],
|
||||
},
|
||||
values: [
|
||||
{
|
||||
@ -215,7 +215,7 @@ export const TestJson = {
|
||||
{
|
||||
id: "202501090858",
|
||||
owner: null,
|
||||
value: "29",
|
||||
value: "35",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
@ -227,7 +227,7 @@ export const TestJson = {
|
||||
{
|
||||
id: "202501090900",
|
||||
owner: null,
|
||||
value: "155",
|
||||
value: "85",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
@ -240,7 +240,7 @@ export const TestJson = {
|
||||
},
|
||||
{
|
||||
metric: {
|
||||
labels: [{ key: "name", value: "service_cpm2" }],
|
||||
labels: [{ key: "name", value: "service_resp_time2" }],
|
||||
},
|
||||
values: [
|
||||
{
|
||||
@ -252,7 +252,7 @@ export const TestJson = {
|
||||
{
|
||||
id: "202501090858",
|
||||
owner: null,
|
||||
value: "19",
|
||||
value: "30",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
@ -264,7 +264,7 @@ export const TestJson = {
|
||||
{
|
||||
id: "202501090900",
|
||||
owner: null,
|
||||
value: "135",
|
||||
value: "65",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
|
@ -27,13 +27,16 @@ export function useSnapshot(params: { name: string; results: MetricsResults[] }[
|
||||
if (!r.metric.labels.length) {
|
||||
return { values: arr };
|
||||
}
|
||||
const label = r.metric.labels[0];
|
||||
return { name: `${label.key}=${label.value}`, values: arr };
|
||||
const name = r.metric.labels
|
||||
.map((label: { key: string; value: string }) => `${label.key}=${label.value}`)
|
||||
.join(",");
|
||||
return { name, values: arr };
|
||||
},
|
||||
);
|
||||
|
||||
return { name: metric.name, values };
|
||||
});
|
||||
|
||||
return sources;
|
||||
}
|
||||
|
||||
@ -50,6 +53,7 @@ export function useSnapshot(params: { name: string; results: MetricsResults[] }[
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return metricsMap;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ limitations under the License. -->
|
||||
for (const item of metric.values) {
|
||||
series.push({
|
||||
data: item.values.map((item: number, itemIndex: number) => [props.intervalTime[itemIndex], item]),
|
||||
name: metric.name,
|
||||
name: item.name,
|
||||
type: "line",
|
||||
symbol: "circle",
|
||||
symbolSize: 4,
|
||||
@ -117,7 +117,7 @@ limitations under the License. -->
|
||||
legend: {
|
||||
type: "scroll",
|
||||
icon: "circle",
|
||||
top: 0,
|
||||
top: -5,
|
||||
left: 0,
|
||||
itemWidth: 12,
|
||||
textStyle: {
|
||||
|
Loading…
Reference in New Issue
Block a user