Skip to content

Commit 00655a0

Browse files
committed
[native] Remove memory related counters
1 parent d9114d3 commit 00655a0

File tree

2 files changed

+3
-298
lines changed

2 files changed

+3
-298
lines changed

presto-native-execution/presto_cpp/main/common/Counters.cpp

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ void registerPrestoMetrics() {
9090
kCounterNumBlockedWaitForSpillDrivers, facebook::velox::StatType::AVG);
9191
DEFINE_METRIC(kCounterNumBlockedYieldDrivers, facebook::velox::StatType::AVG);
9292
DEFINE_METRIC(kCounterNumStuckDrivers, facebook::velox::StatType::AVG);
93-
DEFINE_METRIC(kCounterMappedMemoryBytes, facebook::velox::StatType::AVG);
94-
DEFINE_METRIC(kCounterAllocatedMemoryBytes, facebook::velox::StatType::AVG);
95-
DEFINE_METRIC(kCounterMmapRawAllocBytesSmall, facebook::velox::StatType::AVG);
96-
DEFINE_METRIC(
97-
kCounterMmapExternalMappedBytes, facebook::velox::StatType::AVG);
9893
DEFINE_METRIC(
9994
kCounterTotalPartitionedOutputBuffer, facebook::velox::StatType::AVG);
10095
DEFINE_METRIC(
@@ -115,111 +110,6 @@ void registerPrestoMetrics() {
115110
62l * 1024 * 1024 * 1024, // max bucket value: 62GB
116111
100);
117112

118-
/// ================== AsyncDataCache Counters ==================
119-
120-
DEFINE_METRIC(kCounterCacheMaxAgeSecs, facebook::velox::StatType::AVG);
121-
122-
DEFINE_METRIC(kCounterMemoryCacheNumEntries, facebook::velox::StatType::AVG);
123-
DEFINE_METRIC(
124-
kCounterMemoryCacheNumEmptyEntries, facebook::velox::StatType::AVG);
125-
DEFINE_METRIC(
126-
kCounterMemoryCacheNumSharedEntries, facebook::velox::StatType::AVG);
127-
DEFINE_METRIC(
128-
kCounterMemoryCacheNumExclusiveEntries, facebook::velox::StatType::AVG);
129-
DEFINE_METRIC(
130-
kCounterMemoryCacheNumPrefetchedEntries, facebook::velox::StatType::AVG);
131-
DEFINE_METRIC(
132-
kCounterMemoryCacheTotalTinyBytes, facebook::velox::StatType::AVG);
133-
DEFINE_METRIC(
134-
kCounterMemoryCacheTotalLargeBytes, facebook::velox::StatType::AVG);
135-
DEFINE_METRIC(
136-
kCounterMemoryCacheTotalTinyPaddingBytes, facebook::velox::StatType::AVG);
137-
DEFINE_METRIC(
138-
kCounterMemoryCacheTotalLargePaddingBytes,
139-
facebook::velox::StatType::AVG);
140-
DEFINE_METRIC(
141-
kCounterMemoryCacheTotalPrefetchBytes, facebook::velox::StatType::AVG);
142-
DEFINE_METRIC(
143-
kCounterMemoryCacheSumEvictScore, facebook::velox::StatType::AVG);
144-
DEFINE_METRIC(
145-
kCounterMemoryCacheNumCumulativeHit, facebook::velox::StatType::AVG);
146-
DEFINE_METRIC(kCounterMemoryCacheNumHit, facebook::velox::StatType::AVG);
147-
DEFINE_METRIC(
148-
kCounterMemoryCacheCumulativeHitBytes, facebook::velox::StatType::AVG);
149-
DEFINE_METRIC(kCounterMemoryCacheHitBytes, facebook::velox::StatType::AVG);
150-
DEFINE_METRIC(
151-
kCounterMemoryCacheNumCumulativeNew, facebook::velox::StatType::AVG);
152-
DEFINE_METRIC(kCounterMemoryCacheNumNew, facebook::velox::StatType::AVG);
153-
DEFINE_METRIC(
154-
kCounterMemoryCacheNumCumulativeEvict, facebook::velox::StatType::AVG);
155-
DEFINE_METRIC(kCounterMemoryCacheNumEvict, facebook::velox::StatType::AVG);
156-
DEFINE_METRIC(
157-
kCounterMemoryCacheNumCumulativeEvictChecks,
158-
facebook::velox::StatType::AVG);
159-
DEFINE_METRIC(
160-
kCounterMemoryCacheNumEvictChecks, facebook::velox::StatType::AVG);
161-
DEFINE_METRIC(
162-
kCounterMemoryCacheNumCumulativeWaitExclusive,
163-
facebook::velox::StatType::AVG);
164-
DEFINE_METRIC(
165-
kCounterMemoryCacheNumWaitExclusive, facebook::velox::StatType::AVG);
166-
DEFINE_METRIC(
167-
kCounterMemoryCacheNumCumulativeAllocClocks,
168-
facebook::velox::StatType::AVG);
169-
DEFINE_METRIC(
170-
kCounterMemoryCacheNumAllocClocks, facebook::velox::StatType::AVG);
171-
DEFINE_METRIC(
172-
kCounterMemoryCacheNumCumulativeAgedOutEntries,
173-
facebook::velox::StatType::AVG);
174-
DEFINE_METRIC(
175-
kCounterMemoryCacheNumAgedOutEntries, facebook::velox::StatType::AVG);
176-
177-
/// ================== SsdCache Counters ==================
178-
179-
DEFINE_METRIC(kCounterSsdCacheCachedEntries, facebook::velox::StatType::AVG);
180-
DEFINE_METRIC(kCounterSsdCacheCachedRegions, facebook::velox::StatType::AVG);
181-
DEFINE_METRIC(kCounterSsdCacheCachedBytes, facebook::velox::StatType::AVG);
182-
DEFINE_METRIC(
183-
kCounterSsdCacheCumulativeReadEntries, facebook::velox::StatType::AVG);
184-
DEFINE_METRIC(
185-
kCounterSsdCacheCumulativeReadBytes, facebook::velox::StatType::AVG);
186-
DEFINE_METRIC(
187-
kCounterSsdCacheCumulativeWrittenEntries, facebook::velox::StatType::AVG);
188-
DEFINE_METRIC(
189-
kCounterSsdCacheCumulativeWrittenBytes, facebook::velox::StatType::AVG);
190-
DEFINE_METRIC(
191-
kCounterSsdCacheCumulativeAgedOutEntries, facebook::velox::StatType::AVG);
192-
DEFINE_METRIC(
193-
kCounterSsdCacheCumulativeAgedOutRegions, facebook::velox::StatType::AVG);
194-
DEFINE_METRIC(
195-
kCounterSsdCacheCumulativeOpenSsdErrors, facebook::velox::StatType::AVG);
196-
DEFINE_METRIC(
197-
kCounterSsdCacheCumulativeOpenCheckpointErrors,
198-
facebook::velox::StatType::AVG);
199-
DEFINE_METRIC(
200-
kCounterSsdCacheCumulativeOpenLogErrors, facebook::velox::StatType::AVG);
201-
DEFINE_METRIC(
202-
kCounterSsdCacheCumulativeDeleteCheckpointErrors,
203-
facebook::velox::StatType::AVG);
204-
DEFINE_METRIC(
205-
kCounterSsdCacheCumulativeGrowFileErrors, facebook::velox::StatType::AVG);
206-
DEFINE_METRIC(
207-
kCounterSsdCacheCumulativeWriteSsdErrors, facebook::velox::StatType::AVG);
208-
DEFINE_METRIC(
209-
kCounterSsdCacheCumulativeWriteCheckpointErrors,
210-
facebook::velox::StatType::AVG);
211-
DEFINE_METRIC(
212-
kCounterSsdCacheCumulativeReadSsdErrors, facebook::velox::StatType::AVG);
213-
DEFINE_METRIC(
214-
kCounterSsdCacheCumulativeReadCheckpointErrors,
215-
facebook::velox::StatType::AVG);
216-
217-
DEFINE_METRIC(
218-
kCounterSsdCacheCheckpointsRead, facebook::velox::StatType::SUM);
219-
DEFINE_METRIC(
220-
kCounterSsdCacheCheckpointsWritten, facebook::velox::StatType::SUM);
221-
DEFINE_METRIC(kCounterSsdCacheRegionsEvicted, facebook::velox::StatType::SUM);
222-
223113
/// ================== Disk Spilling Counters =================
224114

225115
DEFINE_METRIC(kCounterSpillRuns, facebook::velox::StatType::SUM);

presto-native-execution/presto_cpp/main/common/Counters.h

Lines changed: 3 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ constexpr folly::StringPiece kCounterHttpClientPrestoExchangeNumOnBody{
4343
/// PrestoExchangeSource.
4444
constexpr folly::StringPiece kCounterHttpClientPrestoExchangeOnBodyBytes{
4545
"presto_cpp.http.client.presto_exchange_source.on_body_bytes"};
46-
4746
/// SerializedPage size in bytes from PrestoExchangeSource.
4847
constexpr folly::StringPiece kCounterPrestoExchangeSerializedPageSize{
4948
"presto_cpp.presto_exchange_source.serialized_page_size"};
49+
/// Peak number of bytes queued in PrestoExchangeSource waiting for consume.
50+
constexpr folly::StringPiece kCounterExchangeSourcePeakQueuedBytes{
51+
"presto_cpp.exchange_source_peak_queued_bytes"};
5052

5153
constexpr folly::StringPiece kCounterNumQueryContexts{
5254
"presto_cpp.num_query_contexts"};
@@ -136,35 +138,6 @@ constexpr folly::StringPiece kCounterOsNumVoluntaryContextSwitches{
136138
constexpr folly::StringPiece kCounterOsNumForcedContextSwitches{
137139
"presto_cpp.os_num_forced_context_switches"};
138140

139-
/// ================== Memory Counters =================
140-
141-
/// Number of bytes currently mapped in MemoryAllocator. These bytes represent
142-
/// the bytes that are either currently being allocated or were in the past
143-
/// allocated, not yet been returned back to the operating system, in the
144-
/// form of 'Allocation' or 'ContiguousAllocation'.
145-
constexpr folly::StringPiece kCounterMappedMemoryBytes{
146-
"presto_cpp.mapped_memory_bytes"};
147-
/// Number of bytes currently allocated (used) from MemoryAllocator in the form
148-
/// of 'Allocation' or 'ContiguousAllocation'.
149-
constexpr folly::StringPiece kCounterAllocatedMemoryBytes{
150-
"presto_cpp.allocated_memory_bytes"};
151-
/// Number of bytes currently mapped in MmapAllocator, in the form of
152-
/// 'ContiguousAllocation'.
153-
///
154-
/// NOTE: This applies only to MmapAllocator
155-
constexpr folly::StringPiece kCounterMmapExternalMappedBytes{
156-
"presto_cpp.mmap_external_mapped_bytes"};
157-
/// Number of bytes currently allocated from MmapAllocator directly from raw
158-
/// allocateBytes() interface, and internally allocated by malloc. Only small
159-
/// chunks of memory are delegated to malloc
160-
///
161-
/// NOTE: This applies only to MmapAllocator
162-
constexpr folly::StringPiece kCounterMmapRawAllocBytesSmall{
163-
"presto_cpp.mmap_raw_alloc_bytes_small"};
164-
/// Peak number of bytes queued in PrestoExchangeSource waiting for consume.
165-
constexpr folly::StringPiece kCounterExchangeSourcePeakQueuedBytes{
166-
"presto_cpp.exchange_source_peak_queued_bytes"};
167-
168141
/// ================== Disk Spilling Counters =================
169142

170143
/// The number of times that spilling runs on a velox operator.
@@ -209,164 +182,6 @@ constexpr folly::StringPiece kCounterSpillMemoryBytes{
209182
constexpr folly::StringPiece kCounterSpillPeakMemoryBytes{
210183
"presto_cpp.spill_peak_memory_bytes"};
211184

212-
/// ================== AsyncDataCache Counters ==================
213-
214-
/// Max possible age of AsyncDataCache and SsdCache entries since the raw file
215-
/// was opened to load the cache.
216-
constexpr folly::StringPiece kCounterCacheMaxAgeSecs{
217-
"presto_cpp.cache_max_age_secs"};
218-
219-
/// Total number of cache entries.
220-
constexpr folly::StringPiece kCounterMemoryCacheNumEntries{
221-
"presto_cpp.memory_cache_num_entries"};
222-
/// Total number of cache entries that do not cache anything.
223-
constexpr folly::StringPiece kCounterMemoryCacheNumEmptyEntries{
224-
"presto_cpp.memory_cache_num_empty_entries"};
225-
/// Total number of cache entries that are pinned for shared access.
226-
constexpr folly::StringPiece kCounterMemoryCacheNumSharedEntries{
227-
"presto_cpp.memory_cache_num_shared_entries"};
228-
/// Total number of cache entries that are pinned for exclusive access.
229-
constexpr folly::StringPiece kCounterMemoryCacheNumExclusiveEntries{
230-
"presto_cpp.memory_cache_num_exclusive_entries"};
231-
/// Total number of cache entries that are being or have been prefetched but
232-
/// have not been hit.
233-
constexpr folly::StringPiece kCounterMemoryCacheNumPrefetchedEntries{
234-
"presto_cpp.memory_cache_num_prefetched_entries"};
235-
/// Total number of bytes of the cached data that is much smaller than a
236-
/// 'MappedMemory' page (AsyncDataCacheEntry::kTinyDataSize).
237-
constexpr folly::StringPiece kCounterMemoryCacheTotalTinyBytes{
238-
"presto_cpp.memory_cache_total_tiny_bytes"};
239-
/// Total number of bytes of the cached data excluding
240-
/// 'kCounterMemoryCacheTotalTinyBytes'.
241-
constexpr folly::StringPiece kCounterMemoryCacheTotalLargeBytes{
242-
"presto_cpp.memory_cache_total_large_bytes"};
243-
/// Total unused capacity bytes in 'kCounterMemoryCacheTotalTinyBytes'.
244-
constexpr folly::StringPiece kCounterMemoryCacheTotalTinyPaddingBytes{
245-
"presto_cpp.memory_cache_total_tiny_padding_bytes"};
246-
/// Total unused capacity bytes in 'kCounterMemoryCacheTotalLargeBytes'.
247-
constexpr folly::StringPiece kCounterMemoryCacheTotalLargePaddingBytes{
248-
"presto_cpp.memory_cache_total_large_padding_bytes"};
249-
/// Total bytes of cache entries in prefetch state.
250-
constexpr folly::StringPiece kCounterMemoryCacheTotalPrefetchBytes{
251-
"presto_cpp.memory_cache_total_prefetched_bytes"};
252-
/// Sum of scores of evicted entries. This serves to infer an average lifetime
253-
/// for entries in cache.
254-
constexpr folly::StringPiece kCounterMemoryCacheSumEvictScore{
255-
"presto_cpp.memory_cache_sum_evict_score"};
256-
/// Cumulative number of hits (saved IO). The first hit to a prefetched entry
257-
/// does not count.
258-
constexpr folly::StringPiece kCounterMemoryCacheNumCumulativeHit{
259-
"presto_cpp.memory_cache_num_cumulative_hit"};
260-
/// Number of hits (saved IO) since last counter retrieval. The first hit to a
261-
/// prefetched entry does not count.
262-
constexpr folly::StringPiece kCounterMemoryCacheNumHit{
263-
"presto_cpp.memory_cache_num_hit"};
264-
/// Cumulative amount of hit bytes (saved IO). The first hit to a prefetched
265-
/// entry does not count.
266-
constexpr folly::StringPiece kCounterMemoryCacheCumulativeHitBytes{
267-
"presto_cpp.memory_cache_cumulative_hit_bytes"};
268-
/// Amount of hit bytes (saved IO) since last counter retrieval. The first hit
269-
/// to a prefetched entry does not count.
270-
constexpr folly::StringPiece kCounterMemoryCacheHitBytes{
271-
"presto_cpp.memory_cache_hit_bytes"};
272-
/// Cumulative number of new entries created.
273-
constexpr folly::StringPiece kCounterMemoryCacheNumCumulativeNew{
274-
"presto_cpp.memory_cache_num_cumulative_new"};
275-
/// Number of new entries created since last counter retrieval.
276-
constexpr folly::StringPiece kCounterMemoryCacheNumNew{
277-
"presto_cpp.memory_cache_num_new"};
278-
/// Cumulative number of times a valid entry was removed in order to make space.
279-
constexpr folly::StringPiece kCounterMemoryCacheNumCumulativeEvict{
280-
"presto_cpp.memory_cache_num_cumulative_evict"};
281-
/// Number of times a valid entry was removed in order to make space, since last
282-
/// counter retrieval.
283-
constexpr folly::StringPiece kCounterMemoryCacheNumEvict{
284-
"presto_cpp.memory_cache_num_evict"};
285-
/// Cumulative number of entries considered for evicting.
286-
constexpr folly::StringPiece kCounterMemoryCacheNumCumulativeEvictChecks{
287-
"presto_cpp.memory_cache_num_cumulative_evict_checks"};
288-
/// Number of entries considered for evicting, since last counter retrieval.
289-
constexpr folly::StringPiece kCounterMemoryCacheNumEvictChecks{
290-
"presto_cpp.memory_cache_num_evict_checks"};
291-
/// Cumulative number of times a user waited for an entry to transit from
292-
/// exclusive to shared mode.
293-
constexpr folly::StringPiece kCounterMemoryCacheNumCumulativeWaitExclusive{
294-
"presto_cpp.memory_cache_num_cumulative_wait_exclusive"};
295-
/// Number of times a user waited for an entry to transit from exclusive to
296-
/// shared mode, since last counter retrieval.
297-
constexpr folly::StringPiece kCounterMemoryCacheNumWaitExclusive{
298-
"presto_cpp.memory_cache_num_wait_exclusive"};
299-
/// Cumulative clocks spent in allocating or freeing memory for backing cache
300-
/// entries.
301-
constexpr folly::StringPiece kCounterMemoryCacheNumCumulativeAllocClocks{
302-
"presto_cpp.memory_cache_num_cumulative_alloc_clocks"};
303-
/// Clocks spent in allocating or freeing memory for backing cache entries,
304-
/// since last counter retrieval
305-
constexpr folly::StringPiece kCounterMemoryCacheNumAllocClocks{
306-
"presto_cpp.memory_cache_num_alloc_clocks"};
307-
/// Cumulative number of AsyncDataCache entries that are aged out and evicted
308-
/// given configured TTL.
309-
constexpr folly::StringPiece kCounterMemoryCacheNumCumulativeAgedOutEntries{
310-
"presto_cpp.memory_cache_num_cumulative_aged_out_entries"};
311-
/// Number of AsyncDataCache entries that are aged out and evicted
312-
/// given configured TTL.
313-
constexpr folly::StringPiece kCounterMemoryCacheNumAgedOutEntries{
314-
"presto_cpp.memory_cache_num_aged_out_entries"};
315-
316-
/// ================== SsdCache Counters ==================
317-
318-
/// Number of regions currently cached by SSD.
319-
constexpr folly::StringPiece kCounterSsdCacheCachedRegions{
320-
"presto_cpp.ssd_cache_cached_regions"};
321-
/// Number of entries currently cached by SSD.
322-
constexpr folly::StringPiece kCounterSsdCacheCachedEntries{
323-
"presto_cpp.ssd_cache_cached_entries"};
324-
/// Total bytes currently cached by SSD.
325-
constexpr folly::StringPiece kCounterSsdCacheCachedBytes{
326-
"presto_cpp.ssd_cache_cached_bytes"};
327-
constexpr folly::StringPiece kCounterSsdCacheCumulativeReadEntries{
328-
"presto_cpp.ssd_cache_cumulative_read_entries"};
329-
constexpr folly::StringPiece kCounterSsdCacheCumulativeReadBytes{
330-
"presto_cpp.ssd_cache_cumulative_read_bytes"};
331-
constexpr folly::StringPiece kCounterSsdCacheCumulativeWrittenEntries{
332-
"presto_cpp.ssd_cache_cumulative_written_entries"};
333-
constexpr folly::StringPiece kCounterSsdCacheCumulativeWrittenBytes{
334-
"presto_cpp.ssd_cache_cumulative_written_bytes"};
335-
/// Cumulative number of SsdCache entries that are aged out and evicted given
336-
/// configured TTL.
337-
constexpr folly::StringPiece kCounterSsdCacheCumulativeAgedOutEntries{
338-
"presto_cpp.ssd_cache_cumulative_aged_out_entries"};
339-
/// Cumulative number of SsdCache regions that are aged out and evicted given
340-
/// configured TTL.
341-
constexpr folly::StringPiece kCounterSsdCacheCumulativeAgedOutRegions{
342-
"presto_cpp.ssd_cache_cumulative_aged_out_regions"};
343-
344-
constexpr folly::StringPiece kCounterSsdCacheCumulativeOpenSsdErrors{
345-
"presto_cpp.ssd_cache_cumulative_open_ssd_errors"};
346-
constexpr folly::StringPiece kCounterSsdCacheCumulativeOpenCheckpointErrors{
347-
"presto_cpp.ssd_cache_cumulative_open_checkpoint_errors"};
348-
constexpr folly::StringPiece kCounterSsdCacheCumulativeOpenLogErrors{
349-
"presto_cpp.ssd_cache_cumulative_open_log_errors"};
350-
constexpr folly::StringPiece kCounterSsdCacheCumulativeDeleteCheckpointErrors{
351-
"presto_cpp.ssd_cache_cumulative_delete_checkpoint_errors"};
352-
constexpr folly::StringPiece kCounterSsdCacheCumulativeGrowFileErrors{
353-
"presto_cpp.ssd_cache_cumulative_grow_file_errors"};
354-
constexpr folly::StringPiece kCounterSsdCacheCumulativeWriteSsdErrors{
355-
"presto_cpp.ssd_cache_cumulative_write_ssd_errors"};
356-
constexpr folly::StringPiece kCounterSsdCacheCumulativeWriteCheckpointErrors{
357-
"presto_cpp.ssd_cache_cumulative_write_checkpoint_errors"};
358-
constexpr folly::StringPiece kCounterSsdCacheCumulativeReadSsdErrors{
359-
"presto_cpp.ssd_cache_cumulative_read_ssd_errors"};
360-
constexpr folly::StringPiece kCounterSsdCacheCumulativeReadCheckpointErrors{
361-
"presto_cpp.ssd_cache_cumulative_read_checkpoint_errors"};
362-
363-
constexpr folly::StringPiece kCounterSsdCacheCheckpointsRead{
364-
"presto_cpp.ssd_cache_checkpoints_read"};
365-
constexpr folly::StringPiece kCounterSsdCacheCheckpointsWritten{
366-
"presto_cpp.ssd_cache_checkpoints_written"};
367-
constexpr folly::StringPiece kCounterSsdCacheRegionsEvicted{
368-
"presto_cpp.ssd_cache_regions_evicted"};
369-
370185
/// ================== HiveConnector Counters ==================
371186
/// Format template strings use 'constexpr std::string_view' to be 'fmt::format'
372187
/// compatible.

0 commit comments

Comments
 (0)