View Javadoc
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    *   http://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 {
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      int numTinySubpages();
35  
36      /**
37       * Returns the number of small sub-pages for the arena.
38       */
39      int numSmallSubpages();
40  
41      /**
42       * Returns the number of chunk lists for the arena.
43       */
44      int numChunkLists();
45  
46      /**
47       * Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for tiny sub-pages.
48       */
49      List<PoolSubpageMetric> tinySubpages();
50  
51      /**
52       * Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for small sub-pages.
53       */
54      List<PoolSubpageMetric> smallSubpages();
55  
56      /**
57       * Returns an unmodifiable {@link List} which holds {@link PoolChunkListMetric}s.
58       */
59      List<PoolChunkListMetric> chunkLists();
60  
61      /**
62       * Return the number of allocations done via the arena. This includes all sizes.
63       */
64      long numAllocations();
65  
66      /**
67       * Return the number of tiny allocations done via the arena.
68       */
69      long numTinyAllocations();
70  
71      /**
72       * Return the number of small allocations done via the arena.
73       */
74      long numSmallAllocations();
75  
76      /**
77       * Return the number of normal allocations done via the arena.
78       */
79      long numNormalAllocations();
80  
81      /**
82       * Return the number of huge allocations done via the arena.
83       */
84      long numHugeAllocations();
85  
86      /**
87       * Return the number of deallocations done via the arena. This includes all sizes.
88       */
89      long numDeallocations();
90  
91      /**
92       * Return the number of tiny deallocations done via the arena.
93       */
94      long numTinyDeallocations();
95  
96      /**
97       * Return the number of small deallocations done via the arena.
98       */
99      long numSmallDeallocations();
100 
101     /**
102      * Return the number of normal deallocations done via the arena.
103      */
104     long numNormalDeallocations();
105 
106     /**
107      * Return the number of huge deallocations done via the arena.
108      */
109     long numHugeDeallocations();
110 
111     /**
112      * Return the number of currently active allocations.
113      */
114     long numActiveAllocations();
115 
116     /**
117      * Return the number of currently active tiny allocations.
118      */
119     long numActiveTinyAllocations();
120 
121     /**
122      * Return the number of currently active small allocations.
123      */
124     long numActiveSmallAllocations();
125 
126     /**
127      * Return the number of currently active normal allocations.
128      */
129     long numActiveNormalAllocations();
130 
131     /**
132      * Return the number of currently active huge allocations.
133      */
134     long numActiveHugeAllocations();
135 
136     /**
137      * Return the number of active bytes that are currently allocated by the arena.
138      */
139     long numActiveBytes();
140 }