1 /* 2 * Copyright 2021 The Netty Project 3 * 4 * The Netty Project licenses this file to you under the Apache License, 5 * version 2.0 (the "License"); you may not use this file except in compliance 6 * with the License. You may obtain a copy of the License at: 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations 14 * under the License. 15 */ 16 package io.netty5.buffer.api.pool; 17 18 import java.util.List; 19 20 /** 21 * Expose metrics for an arena. 22 */ 23 public interface PoolArenaMetric extends SizeClassesMetric { 24 25 /** 26 * Returns the number of thread caches backed by this arena. 27 */ 28 int numThreadCaches(); 29 30 /** 31 * Returns the number of small sub-pages for the arena. 32 */ 33 int numSmallSubpages(); 34 35 /** 36 * Returns the number of chunk lists for the arena. 37 */ 38 int numChunkLists(); 39 40 /** 41 * Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for small sub-pages. 42 */ 43 List<PoolSubpageMetric> smallSubpages(); 44 45 /** 46 * Returns an unmodifiable {@link List} which holds {@link PoolChunkListMetric}s. 47 */ 48 List<PoolChunkListMetric> chunkLists(); 49 50 /** 51 * Return the number of allocations done via the arena. This includes all sizes. 52 */ 53 long numAllocations(); 54 55 /** 56 * Return the number of small allocations done via the arena. 57 */ 58 long numSmallAllocations(); 59 60 /** 61 * Return the number of normal allocations done via the arena. 62 */ 63 long numNormalAllocations(); 64 65 /** 66 * Return the number of huge allocations done via the arena. 67 */ 68 long numHugeAllocations(); 69 70 /** 71 * Return the number of deallocations done via the arena. This includes all sizes. 72 */ 73 long numDeallocations(); 74 75 /** 76 * Return the number of small deallocations done via the arena. 77 */ 78 long numSmallDeallocations(); 79 80 /** 81 * Return the number of normal deallocations done via the arena. 82 */ 83 long numNormalDeallocations(); 84 85 /** 86 * Return the number of huge deallocations done via the arena. 87 */ 88 long numHugeDeallocations(); 89 90 /** 91 * Return the number of currently active allocations. 92 */ 93 long numActiveAllocations(); 94 95 /** 96 * Return the number of currently active small allocations. 97 */ 98 long numActiveSmallAllocations(); 99 100 /** 101 * Return the number of currently active normal allocations. 102 */ 103 long numActiveNormalAllocations(); 104 105 /** 106 * Return the number of currently active huge allocations. 107 */ 108 long numActiveHugeAllocations(); 109 110 /** 111 * Return the number of active bytes that are currently allocated by the arena. 112 */ 113 long numActiveBytes(); 114 115 /** 116 * Return the number of bytes that are currently pinned to buffer instances, by the arena. 117 */ 118 long numPinnedBytes(); 119 }