47 * <li>End time</li>
48 * <li>Duration</li>
49 * <li>Memory usage before the collection starts</li>
50 * <li>Memory usage after the collection ends</li>
51 * </ul>
52 * </blockquote>
53 *
54 * <p>
55 * <tt>GcInfo</tt> is a {@link CompositeData CompositeData}
56 * The GC-specific attributes can be obtained via the CompositeData
57 * interface. This is a historical relic, and other classes should
58 * not copy this pattern. Use {@link CompositeDataView} instead.
59 *
60 * <h4>MXBean Mapping</h4>
61 * <tt>GcInfo</tt> is mapped to a {@link CompositeData CompositeData}
62 * with attributes as specified in the {@link #from from} method.
63 *
64 * @author Mandy Chung
65 * @since 1.5
66 */
67 public class GcInfo implements CompositeData, CompositeDataView {
68 private final long index;
69 private final long startTime;
70 private final long endTime;
71 private final Map<String, MemoryUsage> usageBeforeGc;
72 private final Map<String, MemoryUsage> usageAfterGc;
73 private final Object[] extAttributes;
74 private final CompositeData cdata;
75 private final GcInfoBuilder builder;
76
77 private GcInfo(GcInfoBuilder builder,
78 long index, long startTime, long endTime,
79 MemoryUsage[] muBeforeGc,
80 MemoryUsage[] muAfterGc,
81 Object[] extAttributes) {
82 this.builder = builder;
83 this.index = index;
84 this.startTime = startTime;
85 this.endTime = endTime;
86 String[] poolNames = builder.getPoolNames();
|
47 * <li>End time</li>
48 * <li>Duration</li>
49 * <li>Memory usage before the collection starts</li>
50 * <li>Memory usage after the collection ends</li>
51 * </ul>
52 * </blockquote>
53 *
54 * <p>
55 * <tt>GcInfo</tt> is a {@link CompositeData CompositeData}
56 * The GC-specific attributes can be obtained via the CompositeData
57 * interface. This is a historical relic, and other classes should
58 * not copy this pattern. Use {@link CompositeDataView} instead.
59 *
60 * <h4>MXBean Mapping</h4>
61 * <tt>GcInfo</tt> is mapped to a {@link CompositeData CompositeData}
62 * with attributes as specified in the {@link #from from} method.
63 *
64 * @author Mandy Chung
65 * @since 1.5
66 */
67 @jdk.Supported
68 public class GcInfo implements CompositeData, CompositeDataView {
69 private final long index;
70 private final long startTime;
71 private final long endTime;
72 private final Map<String, MemoryUsage> usageBeforeGc;
73 private final Map<String, MemoryUsage> usageAfterGc;
74 private final Object[] extAttributes;
75 private final CompositeData cdata;
76 private final GcInfoBuilder builder;
77
78 private GcInfo(GcInfoBuilder builder,
79 long index, long startTime, long endTime,
80 MemoryUsage[] muBeforeGc,
81 MemoryUsage[] muAfterGc,
82 Object[] extAttributes) {
83 this.builder = builder;
84 this.index = index;
85 this.startTime = startTime;
86 this.endTime = endTime;
87 String[] poolNames = builder.getPoolNames();
|