mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 08:17:33 +00:00
feat: remove typesOfMQE
This commit is contained in:
parent
55e38b85d4
commit
8479ca14b7
@ -159,7 +159,6 @@ export async function useExpressionsQueryPodsMetrics(
|
|||||||
pods: Array<(Instance | Endpoint | Service) & Indexable>,
|
pods: Array<(Instance | Endpoint | Service) & Indexable>,
|
||||||
config: {
|
config: {
|
||||||
expressions: string[];
|
expressions: string[];
|
||||||
typesOfMQE: string[];
|
|
||||||
subExpressions: string[];
|
subExpressions: string[];
|
||||||
metricConfig: MetricConfigOpt[];
|
metricConfig: MetricConfigOpt[];
|
||||||
},
|
},
|
||||||
@ -168,16 +167,13 @@ export async function useExpressionsQueryPodsMetrics(
|
|||||||
function expressionsGraphqlPods() {
|
function expressionsGraphqlPods() {
|
||||||
const metrics: string[] = [];
|
const metrics: string[] = [];
|
||||||
const subMetrics: string[] = [];
|
const subMetrics: string[] = [];
|
||||||
const metricTypes: string[] = [];
|
|
||||||
config.expressions = config.expressions || [];
|
config.expressions = config.expressions || [];
|
||||||
config.subExpressions = config.subExpressions || [];
|
config.subExpressions = config.subExpressions || [];
|
||||||
config.typesOfMQE = config.typesOfMQE || [];
|
|
||||||
|
|
||||||
for (let i = 0; i < config.expressions.length; i++) {
|
for (let i = 0; i < config.expressions.length; i++) {
|
||||||
if (config.expressions[i]) {
|
if (config.expressions[i]) {
|
||||||
metrics.push(config.expressions[i]);
|
metrics.push(config.expressions[i]);
|
||||||
subMetrics.push(config.subExpressions[i]);
|
subMetrics.push(config.subExpressions[i]);
|
||||||
metricTypes.push(config.typesOfMQE[i]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!metrics.length) {
|
if (!metrics.length) {
|
||||||
@ -236,7 +232,9 @@ export async function useExpressionsQueryPodsMetrics(
|
|||||||
const c: MetricConfigOpt = (config.metricConfig && config.metricConfig[index]) || {};
|
const c: MetricConfigOpt = (config.metricConfig && config.metricConfig[index]) || {};
|
||||||
const k = "expression" + idx + index;
|
const k = "expression" + idx + index;
|
||||||
const sub = "subexpression" + idx + index;
|
const sub = "subexpression" + idx + index;
|
||||||
const results = (resp.data[k] && resp.data[k].results) || [];
|
const obj = resp.data[k] || {};
|
||||||
|
const results = obj.results || [];
|
||||||
|
const typesOfMQE = obj.type || "";
|
||||||
const subResults = (resp.data[sub] && resp.data[sub].results) || [];
|
const subResults = (resp.data[sub] && resp.data[sub].results) || [];
|
||||||
|
|
||||||
if (results.length > 1) {
|
if (results.length > 1) {
|
||||||
@ -263,7 +261,7 @@ export async function useExpressionsQueryPodsMetrics(
|
|||||||
if (!j) {
|
if (!j) {
|
||||||
names.push(name);
|
names.push(name);
|
||||||
metricConfigArr.push({ ...c, index: i });
|
metricConfigArr.push({ ...c, index: i });
|
||||||
metricTypesArr.push(config.typesOfMQE[index]);
|
metricTypesArr.push(typesOfMQE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -287,7 +285,7 @@ export async function useExpressionsQueryPodsMetrics(
|
|||||||
names.push(name);
|
names.push(name);
|
||||||
subNames.push(subName);
|
subNames.push(subName);
|
||||||
metricConfigArr.push(c);
|
metricConfigArr.push(c);
|
||||||
metricTypesArr.push(config.typesOfMQE[index]);
|
metricTypesArr.push(typesOfMQE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,13 +168,12 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
async function queryEndpointExpressions(currentPods: Endpoint[]) {
|
async function queryEndpointExpressions(currentPods: Endpoint[]) {
|
||||||
const expressions = props.config.expressions || [];
|
const expressions = props.config.expressions || [];
|
||||||
const typesOfMQE = props.config.typesOfMQE || [];
|
|
||||||
const subExpressions = props.config.subExpressions || [];
|
const subExpressions = props.config.subExpressions || [];
|
||||||
|
|
||||||
if (expressions.length && expressions[0] && typesOfMQE.length && typesOfMQE[0]) {
|
if (expressions.length && expressions[0]) {
|
||||||
const params = await useExpressionsQueryPodsMetrics(
|
const params = await useExpressionsQueryPodsMetrics(
|
||||||
currentPods,
|
currentPods,
|
||||||
{ ...props.config, metricConfig: metricConfig.value || [], typesOfMQE, expressions, subExpressions },
|
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||||
EntityType[2].value,
|
EntityType[2].value,
|
||||||
);
|
);
|
||||||
endpoints.value = params.data;
|
endpoints.value = params.data;
|
||||||
|
@ -203,13 +203,12 @@ limitations under the License. -->
|
|||||||
|
|
||||||
async function queryInstanceExpressions(currentInstances: Instance[]) {
|
async function queryInstanceExpressions(currentInstances: Instance[]) {
|
||||||
const expressions = props.config.expressions || [];
|
const expressions = props.config.expressions || [];
|
||||||
const typesOfMQE = props.config.typesOfMQE || [];
|
|
||||||
const subExpressions = props.config.subExpressions || [];
|
const subExpressions = props.config.subExpressions || [];
|
||||||
|
|
||||||
if (expressions.length && expressions[0] && typesOfMQE.length && typesOfMQE[0]) {
|
if (expressions.length && expressions[0]) {
|
||||||
const params = await useExpressionsQueryPodsMetrics(
|
const params = await useExpressionsQueryPodsMetrics(
|
||||||
currentInstances,
|
currentInstances,
|
||||||
{ ...props.config, metricConfig: metricConfig.value || [], typesOfMQE, expressions, subExpressions },
|
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||||
EntityType[3].value,
|
EntityType[3].value,
|
||||||
);
|
);
|
||||||
instances.value = params.data;
|
instances.value = params.data;
|
||||||
|
@ -251,13 +251,12 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
async function queryServiceExpressions(currentServices: Service[]) {
|
async function queryServiceExpressions(currentServices: Service[]) {
|
||||||
const expressions = props.config.expressions || [];
|
const expressions = props.config.expressions || [];
|
||||||
const typesOfMQE = props.config.typesOfMQE || [];
|
|
||||||
const subExpressions = props.config.subExpressions || [];
|
const subExpressions = props.config.subExpressions || [];
|
||||||
|
|
||||||
if (expressions.length && expressions[0] && typesOfMQE.length && typesOfMQE[0]) {
|
if (expressions.length && expressions[0]) {
|
||||||
const params = await useExpressionsQueryPodsMetrics(
|
const params = await useExpressionsQueryPodsMetrics(
|
||||||
currentServices,
|
currentServices,
|
||||||
{ ...props.config, metricConfig: metricConfig.value || [], typesOfMQE, expressions, subExpressions },
|
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||||
EntityType[0].value,
|
EntityType[0].value,
|
||||||
);
|
);
|
||||||
services.value = params.data;
|
services.value = params.data;
|
||||||
|
Loading…
Reference in New Issue
Block a user