mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 07:36:14 +00:00
update
This commit is contained in:
parent
46e9e850c8
commit
e7c98dca29
@ -114,169 +114,3 @@ export const LightChartColors = [
|
||||
];
|
||||
|
||||
export const MaxQueryLength = 120;
|
||||
|
||||
export const TestJson = {
|
||||
snapshot: {
|
||||
expression: "sum(service_resp_time > 20) >= 1",
|
||||
metrics: [
|
||||
{
|
||||
name: "service_resp_time",
|
||||
results: [
|
||||
{
|
||||
metric: {
|
||||
labels: [{ key: "p", value: "75" }],
|
||||
},
|
||||
values: [
|
||||
{
|
||||
id: "202501090857",
|
||||
owner: null,
|
||||
value: "30",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090858",
|
||||
owner: null,
|
||||
value: "29",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090859",
|
||||
owner: null,
|
||||
value: "29",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090900",
|
||||
owner: null,
|
||||
value: "155",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090901",
|
||||
owner: null,
|
||||
value: "35",
|
||||
traceID: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
metric: {
|
||||
labels: [{ key: "p", value: "50" }],
|
||||
},
|
||||
values: [
|
||||
{
|
||||
id: "202501090857",
|
||||
owner: null,
|
||||
value: "20",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090858",
|
||||
owner: null,
|
||||
value: "19",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090859",
|
||||
owner: null,
|
||||
value: "39",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090900",
|
||||
owner: null,
|
||||
value: "135",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090901",
|
||||
owner: null,
|
||||
value: "55",
|
||||
traceID: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "service_cpm",
|
||||
results: [
|
||||
{
|
||||
metric: {
|
||||
labels: [{ key: "name", value: "service_resp_time1" }],
|
||||
},
|
||||
values: [
|
||||
{
|
||||
id: "202501090857",
|
||||
owner: null,
|
||||
value: "30",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090858",
|
||||
owner: null,
|
||||
value: "35",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090859",
|
||||
owner: null,
|
||||
value: "29",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090900",
|
||||
owner: null,
|
||||
value: "85",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090901",
|
||||
owner: null,
|
||||
value: "35",
|
||||
traceID: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
metric: {
|
||||
labels: [{ key: "name", value: "service_resp_time2" }],
|
||||
},
|
||||
values: [
|
||||
{
|
||||
id: "202501090857",
|
||||
owner: null,
|
||||
value: "20",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090858",
|
||||
owner: null,
|
||||
value: "30",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090859",
|
||||
owner: null,
|
||||
value: "39",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090900",
|
||||
owner: null,
|
||||
value: "65",
|
||||
traceID: null,
|
||||
},
|
||||
{
|
||||
id: "202501090901",
|
||||
owner: null,
|
||||
value: "55",
|
||||
traceID: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@ -15,10 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { MetricsResults } from "@/types/dashboard";
|
||||
import { TestJson } from "./data";
|
||||
|
||||
export function useSnapshot(p: { name: string; results: MetricsResults[] }[]) {
|
||||
const { metrics } = TestJson.snapshot as any;
|
||||
export function useSnapshot(metrics: { name: string; results: MetricsResults[] }[]) {
|
||||
function processResults() {
|
||||
const sources = metrics.map((metric: { name: string; results: MetricsResults[] }) => {
|
||||
const values = metric.results.map(
|
||||
|
Loading…
Reference in New Issue
Block a user