in src/scaler/scaler-core/scaling-methods/base.js [229:240]
function getMaxMemoryUtilization(cluster) {
const MAX_UTILIZATION_METRIC = 'memory_maximum_utilization';
for (const metric of /** @type {MemorystoreClusterMetricValue[]} */ (
cluster.metrics
)) {
if (metric.name === MAX_UTILIZATION_METRIC) {
return metric.value;
}
}
throw new Error(`Cluster metrics had no ${MAX_UTILIZATION_METRIC} field.`);
}