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>,
|
||||
config: {
|
||||
expressions: string[];
|
||||
typesOfMQE: string[];
|
||||
subExpressions: string[];
|
||||
metricConfig: MetricConfigOpt[];
|
||||
},
|
||||
@ -168,16 +167,13 @@ export async function useExpressionsQueryPodsMetrics(
|
||||
function expressionsGraphqlPods() {
|
||||
const metrics: string[] = [];
|
||||
const subMetrics: string[] = [];
|
||||
const metricTypes: string[] = [];
|
||||
config.expressions = config.expressions || [];
|
||||
config.subExpressions = config.subExpressions || [];
|
||||
config.typesOfMQE = config.typesOfMQE || [];
|
||||
|
||||
for (let i = 0; i < config.expressions.length; i++) {
|
||||
if (config.expressions[i]) {
|
||||
metrics.push(config.expressions[i]);
|
||||
subMetrics.push(config.subExpressions[i]);
|
||||
metricTypes.push(config.typesOfMQE[i]);
|
||||
}
|
||||
}
|
||||
if (!metrics.length) {
|
||||
@ -236,7 +232,9 @@ export async function useExpressionsQueryPodsMetrics(
|
||||
const c: MetricConfigOpt = (config.metricConfig && config.metricConfig[index]) || {};
|
||||
const k = "expression" + 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) || [];
|
||||
|
||||
if (results.length > 1) {
|
||||
@ -263,7 +261,7 @@ export async function useExpressionsQueryPodsMetrics(
|
||||
if (!j) {
|
||||
names.push(name);
|
||||
metricConfigArr.push({ ...c, index: i });
|
||||
metricTypesArr.push(config.typesOfMQE[index]);
|
||||
metricTypesArr.push(typesOfMQE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -287,7 +285,7 @@ export async function useExpressionsQueryPodsMetrics(
|
||||
names.push(name);
|
||||
subNames.push(subName);
|
||||
metricConfigArr.push(c);
|
||||
metricTypesArr.push(config.typesOfMQE[index]);
|
||||
metricTypesArr.push(typesOfMQE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -168,13 +168,12 @@ limitations under the License. -->
|
||||
}
|
||||
async function queryEndpointExpressions(currentPods: Endpoint[]) {
|
||||
const expressions = props.config.expressions || [];
|
||||
const typesOfMQE = props.config.typesOfMQE || [];
|
||||
const subExpressions = props.config.subExpressions || [];
|
||||
|
||||
if (expressions.length && expressions[0] && typesOfMQE.length && typesOfMQE[0]) {
|
||||
if (expressions.length && expressions[0]) {
|
||||
const params = await useExpressionsQueryPodsMetrics(
|
||||
currentPods,
|
||||
{ ...props.config, metricConfig: metricConfig.value || [], typesOfMQE, expressions, subExpressions },
|
||||
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||
EntityType[2].value,
|
||||
);
|
||||
endpoints.value = params.data;
|
||||
|
@ -203,13 +203,12 @@ limitations under the License. -->
|
||||
|
||||
async function queryInstanceExpressions(currentInstances: Instance[]) {
|
||||
const expressions = props.config.expressions || [];
|
||||
const typesOfMQE = props.config.typesOfMQE || [];
|
||||
const subExpressions = props.config.subExpressions || [];
|
||||
|
||||
if (expressions.length && expressions[0] && typesOfMQE.length && typesOfMQE[0]) {
|
||||
if (expressions.length && expressions[0]) {
|
||||
const params = await useExpressionsQueryPodsMetrics(
|
||||
currentInstances,
|
||||
{ ...props.config, metricConfig: metricConfig.value || [], typesOfMQE, expressions, subExpressions },
|
||||
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||
EntityType[3].value,
|
||||
);
|
||||
instances.value = params.data;
|
||||
|
@ -251,13 +251,12 @@ limitations under the License. -->
|
||||
}
|
||||
async function queryServiceExpressions(currentServices: Service[]) {
|
||||
const expressions = props.config.expressions || [];
|
||||
const typesOfMQE = props.config.typesOfMQE || [];
|
||||
const subExpressions = props.config.subExpressions || [];
|
||||
|
||||
if (expressions.length && expressions[0] && typesOfMQE.length && typesOfMQE[0]) {
|
||||
if (expressions.length && expressions[0]) {
|
||||
const params = await useExpressionsQueryPodsMetrics(
|
||||
currentServices,
|
||||
{ ...props.config, metricConfig: metricConfig.value || [], typesOfMQE, expressions, subExpressions },
|
||||
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||
EntityType[0].value,
|
||||
);
|
||||
services.value = params.data;
|
||||
|
Loading…
Reference in New Issue
Block a user