diff --git a/src/hooks/data.ts b/src/hooks/data.ts index 3d45a00d..f7c2b2db 100644 --- a/src/hooks/data.ts +++ b/src/hooks/data.ts @@ -14,32 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export enum MetricQueryTypes { - ReadMetricsValue = "readMetricsValue", - ReadMetricsValues = "readMetricsValues", - SortMetrics = "sortMetrics", - ReadLabeledMetricsValues = "readLabeledMetricsValues", - READHEATMAP = "readHeatMap", - ReadSampledRecords = "readSampledRecords", - ReadRecords = "readRecords", - ReadNullableMetricsValue = "readNullableMetricsValue", -} -export enum Calculations { - Percentage = "percentage", - ByteToKB = "byteToKB", - ByteToMB = "byteToMB", - ByteToGB = "byteToGB", - Apdex = "apdex", - ConvertSeconds = "convertSeconds", - ConvertMilliseconds = "convertMilliseconds", - MsToS = "msTos", - Average = "average", - PercentageAvg = "percentageAvg", - ApdexAvg = "apdexAvg", - SecondToDay = "secondToDay", - NanosecondToMillisecond = "nanosecondToMillisecond", -} export enum sizeEnum { XS = "XS", SM = "SM", @@ -68,50 +43,6 @@ screenMap.set(sizeEnum.XL, screenEnum.XL); screenMap.set(sizeEnum.XXL, screenEnum.XXL); export const RespFields: Indexable = { - readMetricsValues: `{ - label - values { - values {value isEmptyValue} - } - }`, - readMetricsValue: ``, - readNullableMetricsValue: `{ - value - isEmptyValue - }`, - sortMetrics: `{ - name - id - value - refId - }`, - readLabeledMetricsValues: `{ - label - values { - values {value isEmptyValue} - } - }`, - readHeatMap: `{ - values { - id - values - } - buckets { - min - max - } - }`, - readSampledRecords: `{ - name - value - refId - }`, - readRecords: `{ - id - name - value - refId - }`, execExpression: `{ type results { diff --git a/src/hooks/useExpressionsProcessor.ts b/src/hooks/useExpressionsProcessor.ts index 60c66abe..080469ae 100644 --- a/src/hooks/useExpressionsProcessor.ts +++ b/src/hooks/useExpressionsProcessor.ts @@ -129,9 +129,9 @@ export async function useExpressionsQueryProcessor(config: Indexable) { } if (type === ExpressionResultType.SINGLE_VALUE) { for (const item of results) { - const label = item.metric.labels - .map((d: { key: string; value: string }) => `${d.key}=${d.value}`) - .join(","); + const label = + item.metric && + item.metric.labels.map((d: { key: string; value: string }) => `${d.key}=${d.value}`).join(","); const values = item.values.map((d: { value: unknown }) => d.value) || []; if (results.length === 1) { source[label || c.label || name] = values; diff --git a/src/views/dashboard/graphs/Table.vue b/src/views/dashboard/graphs/Table.vue index 2ab46c05..80417b44 100644 --- a/src/views/dashboard/graphs/Table.vue +++ b/src/views/dashboard/graphs/Table.vue @@ -66,10 +66,6 @@ limitations under the License. --> const { t } = useI18n(); const nameWidth = computed(() => (props.config.showTableValues ? 80 : 100)); const dataKeys = computed(() => { - if (props.config.metricTypes && props.config.metricTypes[0] === "readMetricsValue") { - const keys = Object.keys(props.data || {}); - return keys; - } const keys = Object.keys(props.data || {}).filter( (i: string) => Array.isArray(props.data[i]) && props.data[i].length, );