@@ -104,6 +104,86 @@ export class HeapMetric extends Metric {
104
104
}
105
105
}
106
106
107
+ export class HeapTotalMetric extends Metric {
108
+ public update ( timestamp : number , metrics : IDAMetrics ) : void {
109
+ if ( metrics . memory /* node */ ) {
110
+ this . push ( timestamp , metrics . memory . heapTotal ) ;
111
+ }
112
+ }
113
+
114
+ public format ( metric : number ) : string {
115
+ return formatSize ( metric ) ;
116
+ }
117
+
118
+ public short ( ) : string {
119
+ return 'Heap Total' ;
120
+ }
121
+
122
+ public name ( ) : string {
123
+ return 'Heap Total' ;
124
+ }
125
+ }
126
+
127
+ export class ResidentSetMetric extends Metric {
128
+ public update ( timestamp : number , metrics : IDAMetrics ) : void {
129
+ if ( metrics . memory /* node */ ) {
130
+ this . push ( timestamp , metrics . memory . rss ) ;
131
+ }
132
+ }
133
+
134
+ public format ( metric : number ) : string {
135
+ return formatSize ( metric ) ;
136
+ }
137
+
138
+ public short ( ) : string {
139
+ return 'RSS' ;
140
+ }
141
+
142
+ public name ( ) : string {
143
+ return 'Resident Set Size' ;
144
+ }
145
+ }
146
+
147
+ export class ExternalMetric extends Metric {
148
+ public update ( timestamp : number , metrics : IDAMetrics ) : void {
149
+ if ( metrics . memory /* node */ ) {
150
+ this . push ( timestamp , metrics . memory . external ) ;
151
+ }
152
+ }
153
+
154
+ public format ( metric : number ) : string {
155
+ return formatSize ( metric ) ;
156
+ }
157
+
158
+ public short ( ) : string {
159
+ return 'External' ;
160
+ }
161
+
162
+ public name ( ) : string {
163
+ return 'External Memory' ;
164
+ }
165
+ }
166
+
167
+ export class ArrayBuffersMetric extends Metric {
168
+ public update ( timestamp : number , metrics : IDAMetrics ) : void {
169
+ if ( metrics . memory /* node */ ) {
170
+ this . push ( timestamp , metrics . memory . arrayBuffers ) ;
171
+ }
172
+ }
173
+
174
+ public format ( metric : number ) : string {
175
+ return formatSize ( metric ) ;
176
+ }
177
+
178
+ public short ( ) : string {
179
+ return 'ArrayBuffer' ;
180
+ }
181
+
182
+ public name ( ) : string {
183
+ return 'ArrayBuffer Memory' ;
184
+ }
185
+ }
186
+
107
187
export class DOMNodes extends Metric {
108
188
public update ( timestamp : number , metrics : IDAMetrics ) : void {
109
189
if ( metrics . Nodes ) {
@@ -167,6 +247,10 @@ export class StyleRecalcs extends DerivativeMetric {
167
247
export const createMetrics = ( ) => [
168
248
new CpuMetric ( ) ,
169
249
new HeapMetric ( ) ,
250
+ new HeapTotalMetric ( ) ,
251
+ new ResidentSetMetric ( ) ,
252
+ new ExternalMetric ( ) ,
253
+ new ArrayBuffersMetric ( ) ,
170
254
new DOMNodes ( ) ,
171
255
new LayoutCount ( ) ,
172
256
new StyleRecalcs ( ) ,
0 commit comments