mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 15:56:57 +00:00
feature/Rename table MappedMetric => Metric at getTopApisFuture and getTopConsumersFuture
This commit is contained in:
parent
4ec0747410
commit
39e0ba731d
@ -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("")})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user