in projects/alloydb-autoscaler/src/autoscaler-core/poller/monitoring-metrics-reader.ts [163:180]
private getValueFromPoint(
point: monitoring.protos.google.monitoring.v3.IPoint
): number | null {
const value = point?.value;
if (!value) return null;
if (value.doubleValue !== null && value.doubleValue !== undefined) {
return value.doubleValue;
}
if (value.int64Value !== null && value.int64Value !== undefined) {
if (typeof value.int64Value === 'number') {
return value.int64Value;
}
// Handles string and Long cases.
const parsedValue = parseInt(value.int64Value.toString());
return isNaN(parsedValue) ? null : parsedValue;
}
return null;
}