Repository: usergrid Updated Branches: refs/heads/debug_logging f25ac99f3 -> 3c285e0c3
Add more Debug logging for per issues Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/433f4ef1 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/433f4ef1 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/433f4ef1 Branch: refs/heads/debug_logging Commit: 433f4ef1d6f8b420409a22b1c38a2f5275b3a6f0 Parents: 76e9e94 Author: Peter Johnson <[email protected]> Authored: Tue Oct 17 11:42:58 2017 -0700 Committer: Peter Johnson <[email protected]> Committed: Tue Oct 17 11:42:58 2017 -0700 ---------------------------------------------------------------------- .../MvccEntitySerializationStrategyV3Impl.java | 7 +++-- .../index/impl/EsEntityIndexImpl.java | 32 +++++++++++++++++++- .../rest/filters/ContentTypeFilter.java | 2 +- 3 files changed, 36 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/433f4ef1/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java index 102e1e3..120068e 100644 --- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java +++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java @@ -186,7 +186,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ } if (DebugUtils.getMessageId() != null) { - log.info("Reading {} keys from entityIds {} ", + log.info("Reading {} keys from entityIds {} {}", rowKeys.size(), entityIds, DebugUtils.getLogMessage()); @@ -239,9 +239,10 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ if (DebugUtils.getMessageId() != null) { - log.info("Read {} rows from Keyspace {} Message-ID={}", + log.info("Read {} rows from keyspace {} entityIds {} {}", entitySetResults.size(), - keyspace.getKeyspaceName(), + keyspace, + entityIds, DebugUtils.getLogMessage()); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/433f4ef1/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java index dfae55a..8124d0c 100644 --- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java +++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java @@ -461,23 +461,43 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData { } + boolean inCache; final String cacheKey = applicationScope.getApplication().getUuid().toString()+"_"+searchEdge.getEdgeName(); final Object totalEdgeSizeFromCache = sizeCache.getIfPresent(cacheKey); long totalEdgeSizeInBytes; if (totalEdgeSizeFromCache == null){ totalEdgeSizeInBytes = getTotalEntitySizeInBytes(searchEdge); sizeCache.put(cacheKey, totalEdgeSizeInBytes); + inCache = false; }else{ totalEdgeSizeInBytes = (long) totalEdgeSizeFromCache; + inCache = true; } + if (logger.isInfoEnabled()) { + logger.info("After size cache key={} inCache={} {} ", + cacheKey, + inCache, + DebugUtils.getLogMessage()); + } + + final Object totalIndexSizeFromCache = sizeCache.getIfPresent(indexLocationStrategy.getIndexRootName()); long totalIndexSizeInBytes; if (totalIndexSizeFromCache == null){ totalIndexSizeInBytes = getIndexSize(); sizeCache.put(indexLocationStrategy.getIndexRootName(), totalIndexSizeInBytes); + inCache = false; }else{ totalIndexSizeInBytes = (long) totalIndexSizeFromCache; + inCache = true; + } + + if (logger.isInfoEnabled()) { + logger.info("After indexLocationStrategy.getIndexRootName() cache key={} inCache={} {} ", + indexLocationStrategy.getIndexRootName(), + inCache, + DebugUtils.getLogMessage()); } List<Map<String, Object>> violations = QueryAnalyzer.analyze(parsedQuery, totalEdgeSizeInBytes, totalIndexSizeInBytes, indexFig); @@ -487,6 +507,13 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData { logger.warn( QueryAnalyzer.violationsAsString(violations, parsedQuery.getOriginalQuery()) ); } + if (logger.isInfoEnabled()) { + logger.info("After QueryAnalyzer violations size={} {} ", + violations.size(), + inCache, + DebugUtils.getLogMessage()); + } + if(analyzeOnly){ throw new QueryAnalyzerException(violations, parsedQuery.getOriginalQuery(), applicationScope.getApplication().getUuid()); } @@ -505,7 +532,10 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData { final Timer.Context timerContext = searchTimer.time(); try { - + if (logger.isInfoEnabled()) { + logger.info("Before Query execute {} ", + DebugUtils.getLogMessage()); + } searchResponse = srb.execute().actionGet(); } catch ( Throwable t ) { http://git-wip-us.apache.org/repos/asf/usergrid/blob/433f4ef1/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java ---------------------------------------------------------------------- diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java index c9ab2a3..7c7f70a 100644 --- a/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java +++ b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java @@ -95,7 +95,7 @@ public class ContentTypeFilter implements Filter { DebugUtils.startRequest(); logger.info("doFilter Start METHOD {} PATH {} Message-ID={}", ((HttpServletRequest) request).getMethod(), - ((HttpServletRequest) request).getPathTranslated(), + ((HttpServletRequest) request).getQueryString(), DebugUtils.getLogMessage()); }
