--- old/src/hotspot/share/utilities/concurrentHashTable.hpp 2019-05-02 12:06:54.000000000 -0500 +++ new/src/hotspot/share/utilities/concurrentHashTable.hpp 2019-05-02 12:06:54.000000000 -0500 @@ -28,6 +28,7 @@ #include "memory/allocation.hpp" #include "utilities/globalCounter.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/tableStatistics.hpp" // A mostly concurrent-hash-table where the read-side is wait-free, inserts are // CAS and deletes mutual exclude each other on per bucket-basis. VALUE is the @@ -380,6 +381,8 @@ ~ConcurrentHashTable(); + TableRateStatistics _stats_rate; + size_t get_size_log2(Thread* thread); size_t get_node_size() const { return sizeof(Node); } bool is_max_size_reached() { return _size_limit_reached; } @@ -454,6 +457,15 @@ template void bulk_delete(Thread* thread, EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f); + // Calcuate statistics. Item sizes are calculated with VALUE_SIZE_FUNC. + template + TableStatistics statistics_calculate(Thread* thread, VALUE_SIZE_FUNC& vs_f); + + // Gets statistics if available, if not return old one. Item sizes are calculated with + // VALUE_SIZE_FUNC. + template + TableStatistics statistics_get(Thread* thread, VALUE_SIZE_FUNC& vs_f, TableStatistics old); + // Writes statistics to the outputStream. Item sizes are calculated with // VALUE_SIZE_FUNC. template