(data_set)
| 46 | } |
| 47 | |
| 48 | finalizeDataSet(data_set) { |
| 49 | // Create a ranked instance type array that sorts instance types by |
| 50 | // memory size (overall). |
| 51 | let data = data_set.instance_type_data; |
| 52 | let ranked_instance_types = |
| 53 | [...data_set.non_empty_instance_types].sort((a, b) => { |
| 54 | return data[a].overall - data[b].overall; |
| 55 | }); |
| 56 | // Reassemble the instance_type list sorted by size. |
| 57 | let sorted_data = Object.create(null); |
| 58 | let max = 0; |
| 59 | ranked_instance_types.forEach((name) => { |
| 60 | let entry = sorted_data[name] = data[name]; |
| 61 | max = Math.max(max, entry.overall); |
| 62 | }); |
| 63 | data_set.instance_type_data = data; |
| 64 | data_set.singleInstancePeakMemory = max; |
| 65 | |
| 66 | Object.entries(data_set.instance_type_data).forEach(([name, entry]) => { |
| 67 | this.checkHistogram( |
| 68 | name, entry, data_set.bucket_sizes, 'histogram', ' overall'); |
| 69 | this.checkHistogram( |
| 70 | name, entry, data_set.bucket_sizes, 'over_allocated_histogram', |
| 71 | ' over_allocated'); |
| 72 | }); |
| 73 | } |
| 74 | |
| 75 | // Check that a lower bound for histogram memory does not exceed the |
| 76 | // overall counter. |
no test coverage detected