mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 11:21:29 +00:00
feat: add Avg calculations (#66)
This commit is contained in:
@@ -263,10 +263,12 @@ export const TextColors: { [key: string]: string } = {
|
||||
export const CalculationOpts = [
|
||||
{ label: "Percentage", value: "percentage" },
|
||||
{ label: "Apdex", value: "apdex" },
|
||||
{ label: "Avg-preview", value: "average" },
|
||||
{ label: "Percentage + Avg-preview", value: "percentageAvg" },
|
||||
{ label: "Apdex + Avg-preview", value: "apdexAvg" },
|
||||
{ label: "Byte to KB", value: "byteToKB" },
|
||||
{ label: "Byte to MB", value: "byteToMB" },
|
||||
{ label: "Byte to GB", value: "byteToGB" },
|
||||
{ label: "Average", value: "average" },
|
||||
{
|
||||
label: "Milliseconds to YYYY-MM-DD HH:mm:ss",
|
||||
value: "convertMilliseconds",
|
||||
|
@@ -23,7 +23,7 @@ limitations under the License. -->
|
||||
}"
|
||||
>
|
||||
{{ singleVal.toFixed(2) }}
|
||||
<span class="unit" v-show="config.showUnit">
|
||||
<span class="unit" v-show="config.showUnit && unit">
|
||||
{{ decodeURIComponent(unit) }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -55,7 +55,9 @@ const metricConfig = computed(() => props.config.metricConfig || []);
|
||||
const key = computed(() => Object.keys(props.data)[0]);
|
||||
const singleVal = computed(() => Number(props.data[key.value]));
|
||||
const unit = computed(
|
||||
() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit)
|
||||
() =>
|
||||
metricConfig.value[0] &&
|
||||
encodeURIComponent(metricConfig.value[0].unit || "")
|
||||
);
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
Reference in New Issue
Block a user