Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ int initOrInvalidate(final String[] measurements, final boolean isInvalidate) {
}
if (Objects.isNull(tvPair)) {
diff.addAndGet(
(int) RamUsageEstimator.sizeOf(measurement)
+ (int) RamUsageEstimator.HASHTABLE_RAM_BYTES_PER_ENTRY);
(int) RamUsageEstimator.sizeOf(measurement) + getTVPairEntrySize(newPair));
return newPair;
}
return tvPair;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ private int putEntry(
final SchemaCacheEntry putEntry = new SchemaCacheEntry(schema, tagMap);
final SchemaCacheEntry cachedEntry = measurementMap.put(measurement, putEntry);
return Objects.isNull(cachedEntry)
? (int) (RamUsageEstimator.sizeOf(measurement) + SchemaCacheEntry.estimateSize(putEntry))
? (int)
(RamUsageEstimator.sizeOf(measurement)
+ SchemaCacheEntry.estimateSize(putEntry)
+ RamUsageEstimator.HASHTABLE_RAM_BYTES_PER_ENTRY)
: SchemaCacheEntry.estimateSize(putEntry) - SchemaCacheEntry.estimateSize(cachedEntry);
}

Expand All @@ -101,7 +104,8 @@ public int estimateSize() {
entry ->
Math.toIntExact(
RamUsageEstimator.sizeOf(entry.getKey())
+ SchemaCacheEntry.estimateSize(entry.getValue())))
+ SchemaCacheEntry.estimateSize(entry.getValue())
+ RamUsageEstimator.HASHTABLE_RAM_BYTES_PER_ENTRY))
.reduce(0, Integer::sum);
}
}
Loading