Browse Source
Merge pull request #6682 from dmytro-landiak/fix/slow-query-logging
[3.4] fixing slow queries logging
pull/6690/head
Andrew Shvayka
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultEntityQueryRepository.java
|
|
|
@ -369,7 +369,7 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository { |
|
|
|
try { |
|
|
|
return jdbcTemplate.queryForObject(countQuery, ctx, Long.class); |
|
|
|
} finally { |
|
|
|
queryLog.logQuery(ctx, ctx.getQuery(), System.currentTimeMillis() - startTs); |
|
|
|
queryLog.logQuery(ctx, countQuery, System.currentTimeMillis() - startTs); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -481,7 +481,7 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository { |
|
|
|
try { |
|
|
|
rows = jdbcTemplate.queryForList(dataQuery, ctx); |
|
|
|
} finally { |
|
|
|
queryLog.logQuery(ctx, countQuery, System.currentTimeMillis() - startTs); |
|
|
|
queryLog.logQuery(ctx, dataQuery, System.currentTimeMillis() - startTs); |
|
|
|
} |
|
|
|
return EntityDataAdapter.createEntityData(pageLink, selectionMapping, rows, totalElements); |
|
|
|
}); |
|
|
|
|