1 /*
2 * Copyright 2015 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
17 package io.netty.buffer;
18
19 import java.util.List;
20
21 /**
22 * Expose metrics for an arena.
23 */
24 public interface PoolArenaMetric extends SizeClassesMetric {
25
26 /**
27 * Returns the number of thread caches backed by this arena.
28 */
29 int numThreadCaches();
30
31 /**
32 * Returns the number of tiny sub-pages for the arena.
33 *
34 * @deprecated Tiny sub-pages have been merged into small sub-pages.
35 */
36 @Deprecated
37 int numTinySubpages();
38
39 /**
40 * Returns the number of small sub-pages for the arena.
41 */
42 int numSmallSubpages();
43
44 /**
45 * Returns the number of chunk lists for the arena.
46 */
47 int numChunkLists();
48
49 /**
50 * Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for tiny sub-pages.
51 *
52 * @deprecated Tiny sub-pages have been merged into small sub-pages.
53 */
54 @Deprecated
55 List<PoolSubpageMetric> tinySubpages();
56
57 /**
58 * Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for small sub-pages.
59 */
60 List<PoolSubpageMetric> smallSubpages();
61
62 /**
63 * Returns an unmodifiable {@link List} which holds {@link PoolChunkListMetric}s.
64 */
65 List<PoolChunkListMetric> chunkLists();
66
67 /**
68 * Return the number of allocations done via the arena. This includes all sizes.
69 */
70 long numAllocations();
71
72 /**
73 * Return the number of tiny allocations done via the arena.
74 *
75 * @deprecated Tiny allocations have been merged into small allocations.
76 */
77 @Deprecated
78 long numTinyAllocations();
79
80 /**
81 * Return the number of small allocations done via the arena.
82 */
83 long numSmallAllocations();
84
85 /**
86 * Return the number of normal allocations done via the arena.
87 */
88 long numNormalAllocations();
89
90 /**
91 * Return the number of huge allocations done via the arena.
92 */
93 long numHugeAllocations();
94
95 /**
96 * Return the number of deallocations done via the arena. This includes all sizes.
97 */
98 long numDeallocations();
99
100 /**
101 * Return the number of tiny deallocations done via the arena.
102 *
103 * @deprecated Tiny deallocations have been merged into small deallocations.
104 */
105 @Deprecated
106 long numTinyDeallocations();
107
108 /**
109 * Return the number of small deallocations done via the arena.
110 */
111 long numSmallDeallocations();
112
113 /**
114 * Return the number of normal deallocations done via the arena.
115 */
116 long numNormalDeallocations();
117
118 /**
119 * Return the number of huge deallocations done via the arena.
120 */
121 long numHugeDeallocations();
122
123 /**
124 * Return the number of currently active allocations.
125 */
126 long numActiveAllocations();
127
128 /**
129 * Return the number of currently active tiny allocations.
130 *
131 * @deprecated Tiny allocations have been merged into small allocations.
132 */
133 @Deprecated
134 long numActiveTinyAllocations();
135
136 /**
137 * Return the number of currently active small allocations.
138 */
139 long numActiveSmallAllocations();
140
141 /**
142 * Return the number of currently active normal allocations.
143 */
144 long numActiveNormalAllocations();
145
146 /**
147 * Return the number of currently active huge allocations.
148 */
149 long numActiveHugeAllocations();
150
151 /**
152 * Return the number of active bytes that are currently allocated by the arena.
153 */
154 long numActiveBytes();
155 }