Skip to content

Commit

Permalink
chore(jans-auth-server): added more trace logs to stats
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Mar 21, 2022
1 parent c90950a commit d71cbe8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public StatResponse buildResponse(List<String> months) {
final String cacheKey = months.toString();
final StatResponse cachedResponse = responseCache.getIfPresent(cacheKey);
if (cachedResponse != null) {
if (log.isTraceEnabled()) {
log.trace("Get stat response from cache for: {}", cacheKey);
}
return cachedResponse;
}

Expand All @@ -65,12 +68,14 @@ public StatResponse buildResponse(List<String> months) {
private StatResponseItem buildItem(String month) {
try {
String monthlyDn = String.format("ou=%s,%s", escapeLog(month), statService.getBaseDn());
log.trace("Trying to fetch stat for month: {}", monthlyDn);

final List<StatEntry> entries = entryManager.findEntries(monthlyDn, StatEntry.class, Filter.createPresenceFilter("jansId"));
if (entries == null || entries.isEmpty()) {
log.trace("Can't find stat entries for month: {}", monthlyDn);
return null;
}
log.trace("Fetched stat entries for month {} successfully", monthlyDn);

final StatResponseItem responseItem = new StatResponseItem();
responseItem.setMonthlyActiveUsers(userCardinality(entries));
Expand Down

0 comments on commit d71cbe8

Please sign in to comment.