mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
fix: polish pages and validate data (#46)
This commit is contained in:
@@ -26,6 +26,8 @@ export enum MetricQueryTypes {
|
||||
export enum Calculations {
|
||||
Percentage = "percentage",
|
||||
ByteToKB = "byteToKB",
|
||||
ByteToMB = "ByteToMB",
|
||||
ByteToGB = "ByteToGB",
|
||||
Apdex = "apdex",
|
||||
Precision = "precision",
|
||||
ConvertSeconds = "convertSeconds",
|
||||
|
@@ -28,6 +28,9 @@ export function useQueryProcessor(config: any) {
|
||||
if (!(config.metrics && config.metrics[0])) {
|
||||
return;
|
||||
}
|
||||
if (!(config.metricTypes && config.metricTypes[0])) {
|
||||
return;
|
||||
}
|
||||
const appStore = useAppStoreWithOut();
|
||||
const dashboardStore = useDashboardStore();
|
||||
const selectorStore = useSelectorStore();
|
||||
@@ -221,13 +224,19 @@ export function useQueryPodsMetrics(
|
||||
config: { metrics: string[]; metricTypes: string[] },
|
||||
scope: string
|
||||
) {
|
||||
if (!(config.metrics && config.metrics[0])) {
|
||||
return;
|
||||
}
|
||||
if (!(config.metricTypes && config.metricTypes[0])) {
|
||||
return;
|
||||
}
|
||||
const appStore = useAppStoreWithOut();
|
||||
const selectorStore = useSelectorStore();
|
||||
const conditions: { [key: string]: unknown } = {
|
||||
duration: appStore.durationTime,
|
||||
};
|
||||
const variables: string[] = [`$duration: Duration!`];
|
||||
const { currentService } = selectorStore;
|
||||
const currentService = selectorStore.currentService || {};
|
||||
const fragmentList = pods.map(
|
||||
(
|
||||
d: (Instance | Endpoint | Service) & { normal: boolean },
|
||||
@@ -324,6 +333,12 @@ export function aggregation(val: number, config: any): number | string {
|
||||
case Calculations.ByteToKB:
|
||||
data = val / 1024;
|
||||
break;
|
||||
case Calculations.ByteToMB:
|
||||
data = val / 1024 / 1024;
|
||||
break;
|
||||
case Calculations.ByteToGB:
|
||||
data = val / 1024 / 1024 / 1024;
|
||||
break;
|
||||
case Calculations.Apdex:
|
||||
data = val / 10000;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user