const HEARTBEAT_INTERVAL_MS = 5e3;
const STALE_JOB_TIMEOUT_SECONDS = 60;
function calculateEta(processedCount, totalCount, startedAt) {
  if (processedCount === 0 || totalCount === 0) return null;
  const elapsedMs = Date.now() - startedAt.getTime();
  const rate = processedCount / elapsedMs;
  const remaining = totalCount - processedCount;
  if (rate <= 0) return null;
  return Math.ceil(remaining / rate / 1e3);
}
function calculateProgressPercent(processedCount, totalCount) {
  if (!totalCount || totalCount <= 0) return 0;
  return Math.min(100, Math.round(processedCount / totalCount * 100));
}
export {
  HEARTBEAT_INTERVAL_MS,
  STALE_JOB_TIMEOUT_SECONDS,
  calculateEta,
  calculateProgressPercent
};
//# sourceMappingURL=progressService.js.map
