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