From 4a92961e095257c5b5cff6e2ec943d1dc639132b Mon Sep 17 00:00:00 2001 From: yashashk Date: Wed, 15 Jan 2025 13:10:10 +0530 Subject: [PATCH] feat: #OBS-I321 : Removed volume_by_days from request schema --- .../src/controllers/DatasetMetrics/DatasetMetrics.json | 4 ---- .../controllers/DatasetMetrics/DatasetMetricsController.ts | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/api-service/src/controllers/DatasetMetrics/DatasetMetrics.json b/api-service/src/controllers/DatasetMetrics/DatasetMetrics.json index 3238d1b3..70f14029 100644 --- a/api-service/src/controllers/DatasetMetrics/DatasetMetrics.json +++ b/api-service/src/controllers/DatasetMetrics/DatasetMetrics.json @@ -46,10 +46,6 @@ }, "minItems": 1 }, - "volume_by_days": { - "type": "integer", - "minimum": 1 - }, "query_time_period":{ "type": "integer", "minimum": 1 diff --git a/api-service/src/controllers/DatasetMetrics/DatasetMetricsController.ts b/api-service/src/controllers/DatasetMetrics/DatasetMetricsController.ts index 41d7a051..f84d0b43 100644 --- a/api-service/src/controllers/DatasetMetrics/DatasetMetricsController.ts +++ b/api-service/src/controllers/DatasetMetrics/DatasetMetricsController.ts @@ -16,7 +16,7 @@ const datasetMetrics = async (req: Request, res: Response) => { const dataset_id = _.get(req, "body.request.dataset_id"); const timePeriod = _.get(req, "body.request.query_time_period") || config?.data_observability?.default_query_time_period; - const { category, volume_by_days = 10 }: any = req.body.request; + const { category }: any = req.body.request; const defaultThreshold = (typeof config?.data_observability?.default_freshness_threshold === 'number' ? config?.data_observability?.default_freshness_threshold : 5) * 60 * 1000; // 5 minutes in milliseconds const dateFormat = 'YYYY-MM-DDTHH:mm:ss'; const endDate = dayjs().add(1, 'day').format(dateFormat); @@ -48,7 +48,7 @@ const datasetMetrics = async (req: Request, res: Response) => { } if (!category || category.includes("data_volume")) { - const dataVolumeResult = await getDataVolume(dataset_id, volume_by_days, dateFormat); + const dataVolumeResult = await getDataVolume(dataset_id, timePeriod, dateFormat); results.push(dataVolumeResult); }