From 39e0ba731d99c12b128182a77a2f060ef694dd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Wed, 25 Jan 2023 13:42:36 +0100 Subject: [PATCH] feature/Rename table MappedMetric => Metric at getTopApisFuture and getTopConsumersFuture --- .../main/scala/code/metrics/MappedMetrics.scala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/obp-api/src/main/scala/code/metrics/MappedMetrics.scala b/obp-api/src/main/scala/code/metrics/MappedMetrics.scala index 2ce3d1b06..ff0429565 100644 --- a/obp-api/src/main/scala/code/metrics/MappedMetrics.scala +++ b/obp-api/src/main/scala/code/metrics/MappedMetrics.scala @@ -295,7 +295,7 @@ object MappedMetrics extends APIMetrics with MdcLoggable{ val result = scalikeDB readOnly { implicit session => val sqlResult = sql"""SELECT count(*), avg(duration), min(duration), max(duration) - FROM mappedmetric + FROM metric WHERE date_c >= ${new Timestamp(fromDate.get.getTime)} AND date_c <= ${new Timestamp(toDate.get.getTime)} AND (${trueOrFalse(consumerId.isEmpty)} or consumerid = ${consumerId.getOrElse("")}) @@ -378,8 +378,8 @@ object MappedMetrics extends APIMetrics with MdcLoggable{ // TODO Make it work in case of Oracle database val otherDbLimit = if (dbUrl.contains("sqlserver")) sqls"" else sqls"LIMIT $limit" val sqlResult = - sql"""SELECT ${msSqlLimit} count(*), mappedmetric.implementedbypartialfunction, mappedmetric.implementedinversion - FROM mappedmetric + sql"""SELECT ${msSqlLimit} count(*), metric.implementedbypartialfunction, metric.implementedinversion + FROM metric WHERE date_c >= ${new Timestamp(fromDate.get.getTime)} AND date_c <= ${new Timestamp(toDate.get.getTime)} @@ -395,7 +395,7 @@ object MappedMetrics extends APIMetrics with MdcLoggable{ AND (${trueOrFalse(excludeUrlPatterns.isEmpty) } or (url NOT LIKE ($excludeUrlPatternsQueries))) AND (${trueOrFalse(excludeAppNames.isEmpty) } or appname not in ($extendedExclueAppNameQueries)) AND (${trueOrFalse(excludeImplementedByPartialFunctions.isEmpty) } or implementedbypartialfunction not in ($extendedExcludeImplementedByPartialFunctionsQueries)) - GROUP BY mappedmetric.implementedbypartialfunction, mappedmetric.implementedinversion + GROUP BY metric.implementedbypartialfunction, metric.implementedinversion ORDER BY count(*) DESC ${otherDbLimit} """.stripMargin @@ -457,10 +457,10 @@ object MappedMetrics extends APIMetrics with MdcLoggable{ val result: List[TopConsumer] = scalikeDB readOnly { implicit session => val sqlResult = - sql"""SELECT ${msSqlLimit} count(*) as count, consumer.id as consumerprimaryid, mappedmetric.appname as appname, + sql"""SELECT ${msSqlLimit} count(*) as count, consumer.id as consumerprimaryid, metric.appname as appname, consumer.developeremail as email, consumer.consumerid as consumerid - FROM mappedmetric, consumer - WHERE mappedmetric.appname = consumer.name + FROM metric, consumer + WHERE metric.appname = consumer.name AND date_c >= ${new Timestamp(fromDate.get.getTime)} AND date_c <= ${new Timestamp(toDate.get.getTime)} AND (${trueOrFalse(consumerId.isEmpty)} or consumer.consumerid = ${consumerId.getOrElse("")})