You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "Fine0830 (via GitHub)" <gi...@apache.org> on 2024/10/17 11:26:15 UTC
[PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Fine0830 opened a new pull request, #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421
Related https://github.com/apache/skywalking/pull/12696#issuecomment-2413085299
Video
https://github.com/user-attachments/assets/20247225-cdf9-4527-b308-0485cebeb444
Signed-off-by: Qiuxia Fan <qi...@apache.org>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "Fine0830 (via GitHub)" <gi...@apache.org>.
Fine0830 commented on code in PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#discussion_r1804623354
##########
src/views/dashboard/graphs/Card.vue:
##########
@@ -48,18 +48,45 @@ limitations under the License. -->
showUnit: true,
textAlign: "center",
metricConfig: [],
- decorations: {},
+ valueMappings: {},
}),
},
});
const { t } = useI18n();
const metricConfig = computed(() => props.config.metricConfig || []);
- const decorations = computed(() => props.config.decorations || {});
+ const valueMappings = computed(() => props.config.valueMappings || {});
const key = computed(() => Object.keys(props.data)[0]);
const singleVal = computed(() =>
Array.isArray(props.data[key.value]) ? props.data[key.value][0] : props.data[key.value],
);
const unit = computed(() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit || ""));
+
+ function getValue() {
+ if (valueMappings.value[singleVal.value]) {
+ return valueMappings.value[singleVal.value];
+ }
+ const regex = /-?\d+(\.\d+)?/g;
+ const list = Object.keys(valueMappings.value);
+ for (const i of list) {
+ const k = i.replace(/\s+/g, "");
+ let withinRange = false;
+ const ranges = k.match(regex)?.map(Number) || [];
+ if (k.startsWith("[")) {
+ withinRange = k.startsWith("[-∞") || Number(singleVal.value) >= ranges[0];
+ } else {
+ withinRange = k.startsWith("(-∞") || Number(singleVal.value) > ranges[0];
+ }
+ if (k.endsWith("]")) {
+ withinRange = withinRange && (k.endsWith("+∞]") || Number(singleVal.value) <= (ranges[1] || ranges[0]));
Review Comment:
Yep.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#issuecomment-2419276572
<img width="252" alt="image" src="https://github.com/user-attachments/assets/0ddcfc1e-fa14-4352-a87f-a97490e57db1">
Could you we add tips about how to setup the range? The contributors/users will not be able to watch this video and learn how to use this. We need to way to guide them.
Or
If you want to put this in the documents, you should update this doc. https://skywalking.apache.org/docs/main/next/en/ui/readme/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#issuecomment-2419289458
fyi @CodePrometheus
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#discussion_r1804689909
##########
src/views/dashboard/graphs/Card.vue:
##########
@@ -48,18 +48,45 @@ limitations under the License. -->
showUnit: true,
textAlign: "center",
metricConfig: [],
- decorations: {},
+ valueMappings: {},
}),
},
});
const { t } = useI18n();
const metricConfig = computed(() => props.config.metricConfig || []);
- const decorations = computed(() => props.config.decorations || {});
+ const valueMappings = computed(() => props.config.valueMappings || {});
const key = computed(() => Object.keys(props.data)[0]);
const singleVal = computed(() =>
Array.isArray(props.data[key.value]) ? props.data[key.value][0] : props.data[key.value],
);
const unit = computed(() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit || ""));
+
+ function getValue() {
+ if (valueMappings.value[singleVal.value]) {
+ return valueMappings.value[singleVal.value];
+ }
+ const regex = /-?\d+(\.\d+)?/g;
+ const list = Object.keys(valueMappings.value);
+ for (const i of list) {
+ const k = i.replace(/\s+/g, "");
+ let withinRange = false;
+ const ranges = k.match(regex)?.map(Number) || [];
+ if (k.startsWith("[")) {
+ withinRange = k.startsWith("[-∞") || Number(singleVal.value) >= ranges[0];
+ } else {
+ withinRange = k.startsWith("(-∞") || Number(singleVal.value) > ranges[0];
+ }
+ if (k.endsWith("]")) {
+ withinRange = withinRange && (k.endsWith("+∞]") || Number(singleVal.value) <= (ranges[1] || ranges[0]));
Review Comment:
If this supports writing regular expressions directly, how about that. For example, ^(10|[0-9])$ matches 0-10.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#discussion_r1804628977
##########
src/views/dashboard/graphs/Card.vue:
##########
@@ -48,18 +48,45 @@ limitations under the License. -->
showUnit: true,
textAlign: "center",
metricConfig: [],
- decorations: {},
+ valueMappings: {},
}),
},
});
const { t } = useI18n();
const metricConfig = computed(() => props.config.metricConfig || []);
- const decorations = computed(() => props.config.decorations || {});
+ const valueMappings = computed(() => props.config.valueMappings || {});
const key = computed(() => Object.keys(props.data)[0]);
const singleVal = computed(() =>
Array.isArray(props.data[key.value]) ? props.data[key.value][0] : props.data[key.value],
);
const unit = computed(() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit || ""));
+
+ function getValue() {
+ if (valueMappings.value[singleVal.value]) {
+ return valueMappings.value[singleVal.value];
+ }
+ const regex = /-?\d+(\.\d+)?/g;
+ const list = Object.keys(valueMappings.value);
+ for (const i of list) {
+ const k = i.replace(/\s+/g, "");
+ let withinRange = false;
+ const ranges = k.match(regex)?.map(Number) || [];
+ if (k.startsWith("[")) {
+ withinRange = k.startsWith("[-∞") || Number(singleVal.value) >= ranges[0];
+ } else {
+ withinRange = k.startsWith("(-∞") || Number(singleVal.value) > ranges[0];
+ }
+ if (k.endsWith("]")) {
+ withinRange = withinRange && (k.endsWith("+∞]") || Number(singleVal.value) <= (ranges[1] || ranges[0]));
Review Comment:
I have a little concern of `∞`, it is hard to input from the keyboard. How about `infinite+` and `infinite-`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#discussion_r1804740593
##########
src/views/dashboard/graphs/Card.vue:
##########
@@ -48,18 +48,45 @@ limitations under the License. -->
showUnit: true,
textAlign: "center",
metricConfig: [],
- decorations: {},
+ valueMappings: {},
}),
},
});
const { t } = useI18n();
const metricConfig = computed(() => props.config.metricConfig || []);
- const decorations = computed(() => props.config.decorations || {});
+ const valueMappings = computed(() => props.config.valueMappings || {});
const key = computed(() => Object.keys(props.data)[0]);
const singleVal = computed(() =>
Array.isArray(props.data[key.value]) ? props.data[key.value][0] : props.data[key.value],
);
const unit = computed(() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit || ""));
+
+ function getValue() {
+ if (valueMappings.value[singleVal.value]) {
+ return valueMappings.value[singleVal.value];
+ }
+ const regex = /-?\d+(\.\d+)?/g;
+ const list = Object.keys(valueMappings.value);
+ for (const i of list) {
+ const k = i.replace(/\s+/g, "");
+ let withinRange = false;
+ const ranges = k.match(regex)?.map(Number) || [];
+ if (k.startsWith("[")) {
+ withinRange = k.startsWith("[-∞") || Number(singleVal.value) >= ranges[0];
+ } else {
+ withinRange = k.startsWith("(-∞") || Number(singleVal.value) > ranges[0];
+ }
+ if (k.endsWith("]")) {
+ withinRange = withinRange && (k.endsWith("+∞]") || Number(singleVal.value) <= (ranges[1] || ranges[0]));
Review Comment:
`\b(2[5-9]|3[0-4])\b` could catch up, regex may not be as intuitive as the current method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#discussion_r1804597581
##########
src/views/dashboard/graphs/Card.vue:
##########
@@ -48,18 +48,45 @@ limitations under the License. -->
showUnit: true,
textAlign: "center",
metricConfig: [],
- decorations: {},
+ valueMappings: {},
}),
},
});
const { t } = useI18n();
const metricConfig = computed(() => props.config.metricConfig || []);
- const decorations = computed(() => props.config.decorations || {});
+ const valueMappings = computed(() => props.config.valueMappings || {});
const key = computed(() => Object.keys(props.data)[0]);
const singleVal = computed(() =>
Array.isArray(props.data[key.value]) ? props.data[key.value][0] : props.data[key.value],
);
const unit = computed(() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit || ""));
+
+ function getValue() {
+ if (valueMappings.value[singleVal.value]) {
+ return valueMappings.value[singleVal.value];
+ }
+ const regex = /-?\d+(\.\d+)?/g;
+ const list = Object.keys(valueMappings.value);
+ for (const i of list) {
+ const k = i.replace(/\s+/g, "");
+ let withinRange = false;
+ const ranges = k.match(regex)?.map(Number) || [];
+ if (k.startsWith("[")) {
+ withinRange = k.startsWith("[-∞") || Number(singleVal.value) >= ranges[0];
+ } else {
+ withinRange = k.startsWith("(-∞") || Number(singleVal.value) > ranges[0];
+ }
+ if (k.endsWith("]")) {
+ withinRange = withinRange && (k.endsWith("+∞]") || Number(singleVal.value) <= (ranges[1] || ranges[0]));
Review Comment:
So, `+∞` and `-∞` are supported if we need no upper or lower boundary?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#discussion_r1804747486
##########
src/views/dashboard/graphs/Card.vue:
##########
@@ -48,18 +48,45 @@ limitations under the License. -->
showUnit: true,
textAlign: "center",
metricConfig: [],
- decorations: {},
+ valueMappings: {},
}),
},
});
const { t } = useI18n();
const metricConfig = computed(() => props.config.metricConfig || []);
- const decorations = computed(() => props.config.decorations || {});
+ const valueMappings = computed(() => props.config.valueMappings || {});
const key = computed(() => Object.keys(props.data)[0]);
const singleVal = computed(() =>
Array.isArray(props.data[key.value]) ? props.data[key.value][0] : props.data[key.value],
);
const unit = computed(() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit || ""));
+
+ function getValue() {
+ if (valueMappings.value[singleVal.value]) {
+ return valueMappings.value[singleVal.value];
+ }
+ const regex = /-?\d+(\.\d+)?/g;
+ const list = Object.keys(valueMappings.value);
+ for (const i of list) {
+ const k = i.replace(/\s+/g, "");
+ let withinRange = false;
+ const ranges = k.match(regex)?.map(Number) || [];
+ if (k.startsWith("[")) {
+ withinRange = k.startsWith("[-∞") || Number(singleVal.value) >= ranges[0];
+ } else {
+ withinRange = k.startsWith("(-∞") || Number(singleVal.value) > ranges[0];
+ }
+ if (k.endsWith("]")) {
+ withinRange = withinRange && (k.endsWith("+∞]") || Number(singleVal.value) <= (ranges[1] || ranges[0]));
Review Comment:
@Fine0830 Could you try to change the format to include a regex?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#issuecomment-2421140869
> @CodePrometheus I think we need to update your dashboard to adopt this change. Could you do that soon? I could merge this when you are ready to follow.
>
> FYI, the config key is changed, so you need to remove the old one and add the new config.
Let me sync ui later, thanks @Fine0830
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#issuecomment-2421138980
@CodePrometheus I think we need to update your dashboard to adopt this change. Could you do that soon? I could merge this when you are ready to follow.
FYI, the config key is changed, so you need to remove the old one and add the new config.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support ranges for Value Mappings [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #421:
URL: https://github.com/apache/skywalking-booster-ui/pull/421#discussion_r1804706719
##########
src/views/dashboard/graphs/Card.vue:
##########
@@ -48,18 +48,45 @@ limitations under the License. -->
showUnit: true,
textAlign: "center",
metricConfig: [],
- decorations: {},
+ valueMappings: {},
}),
},
});
const { t } = useI18n();
const metricConfig = computed(() => props.config.metricConfig || []);
- const decorations = computed(() => props.config.decorations || {});
+ const valueMappings = computed(() => props.config.valueMappings || {});
const key = computed(() => Object.keys(props.data)[0]);
const singleVal = computed(() =>
Array.isArray(props.data[key.value]) ? props.data[key.value][0] : props.data[key.value],
);
const unit = computed(() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit || ""));
+
+ function getValue() {
+ if (valueMappings.value[singleVal.value]) {
+ return valueMappings.value[singleVal.value];
+ }
+ const regex = /-?\d+(\.\d+)?/g;
+ const list = Object.keys(valueMappings.value);
+ for (const i of list) {
+ const k = i.replace(/\s+/g, "");
+ let withinRange = false;
+ const ranges = k.match(regex)?.map(Number) || [];
+ if (k.startsWith("[")) {
+ withinRange = k.startsWith("[-∞") || Number(singleVal.value) >= ranges[0];
+ } else {
+ withinRange = k.startsWith("(-∞") || Number(singleVal.value) > ranges[0];
+ }
+ if (k.endsWith("]")) {
+ withinRange = withinRange && (k.endsWith("+∞]") || Number(singleVal.value) <= (ranges[1] || ranges[0]));
Review Comment:
How to write 25-34 in regex? Regex is better in string pattern match I think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org