reduce verbosity of performance logging

This commit is contained in:
2022-11-20 16:37:32 +01:00
parent 7a82d4b09e
commit 04c09f6ba4
2 changed files with 5 additions and 5 deletions

View File

@@ -154,7 +154,7 @@ public class DataStore implements AutoCloseable {
final long start = System.nanoTime(); final long start = System.nanoTime();
writer.write(dateAsEpochMilli, value); writer.write(dateAsEpochMilli, value);
final double duration = (System.nanoTime() - start) / 1_000_000.0; final double duration = (System.nanoTime() - start) / 1_000_000.0;
if (duration > 1) { if (duration > 10) {
System.out.println(" write took: " + duration + " ms " + tags); System.out.println(" write took: " + duration + " ms " + tags);
} }
} }
@@ -382,7 +382,7 @@ public class DataStore implements AutoCloseable {
final PartitionedTagsCacheKey cacheKey = new PartitionedTagsCacheKey(tags, partitionId); final PartitionedTagsCacheKey cacheKey = new PartitionedTagsCacheKey(tags, partitionId);
final PdbWriter result = writerCache.putIfAbsent(cacheKey, t -> getWriterInternal(partitionId, tags)); final PdbWriter result = writerCache.putIfAbsent(cacheKey, t -> getWriterInternal(partitionId, tags));
final double duration = (System.nanoTime() - start) / 1_000_000.0; final double duration = (System.nanoTime() - start) / 1_000_000.0;
if (duration > 1) { if (duration > 100) {
System.out.println(" get Writer took: " + duration + " ms " + tags); System.out.println(" get Writer took: " + duration + " ms " + tags);
} }
return result; return result;
@@ -403,7 +403,7 @@ public class DataStore implements AutoCloseable {
final PdbFile pdbFile = new PdbFile(partitionId, doc.getRootBlockNumber(), tags); final PdbFile pdbFile = new PdbFile(partitionId, doc.getRootBlockNumber(), tags);
writer = new PdbWriter(pdbFile, diskStorage.getExisting(partitionId)); writer = new PdbWriter(pdbFile, diskStorage.getExisting(partitionId));
final double duration = (System.nanoTime() - start) / 1_000_000.0; final double duration = (System.nanoTime() - start) / 1_000_000.0;
if (duration > 1) { if (duration > 100) {
System.out.println(" init existing writer took: " + duration + " ms " + tags); System.out.println(" init existing writer took: " + duration + " ms " + tags);
} }
} catch (final RuntimeException e) { } catch (final RuntimeException e) {
@@ -422,7 +422,7 @@ public class DataStore implements AutoCloseable {
final PdbWriter result = new PdbWriter(pdbFile, diskStorage.getExisting(partitionId)); final PdbWriter result = new PdbWriter(pdbFile, diskStorage.getExisting(partitionId));
final double duration = (System.nanoTime() - start) / 1_000_000.0; final double duration = (System.nanoTime() - start) / 1_000_000.0;
if (duration > 1) { if (duration > 10) {
METRICS_LOGGER_NEW_WRITER.info("newPdbWriter took {}ms tags: {}", duration, tags); METRICS_LOGGER_NEW_WRITER.info("newPdbWriter took {}ms tags: {}", duration, tags);
} }
return result; return result;

View File

@@ -334,7 +334,7 @@ public class QueryCompletionIndex implements AutoCloseable {
fieldIndex.putValue(partitionId, stringCompressor.getKeyAsString(tag), Empty.INSTANCE); fieldIndex.putValue(partitionId, stringCompressor.getKeyAsString(tag), Empty.INSTANCE);
} }
final double d = (System.nanoTime() - start) / 1_000_000.0; final double d = (System.nanoTime() - start) / 1_000_000.0;
if (d > 1) { if (d > 10) {
System.out.println(" addTags: " + d + " ms"); System.out.println(" addTags: " + d + " ms");
} }
} }