async function publishDownstreamEvent()

in src/scaler/scaler-core/index.js [164:180]


async function publishDownstreamEvent(eventName, cluster, suggestedSize) {
  const message = {
    projectId: cluster.projectId,
    regionId: cluster.regionId,
    clusterId: cluster.clusterId,
    currentSize: cluster.currentSize,
    suggestedSize: suggestedSize,
    units: cluster.units,
    metrics: cluster.metrics,
  };

  return publishProtoMsgDownstream(
    eventName,
    message,
    cluster.downstreamPubSubTopic,
  );
}