def aggregate_baseline(enterprise_id, type, ts = Time.now.floor)
      clazz = @baseline_for.constantize
      _ts = ts
      start_calc_time = (_ts.to_datetime - MAX_DURATION.day).to_time
      last_n_days_interval = start_calc_time.ceil.to(_ts, 24.hour)
      last_n_days_interval.each do |hist|
        args = {
            ts: hist,
            type: type,
            enterprise_id: enterprise_id
        }
        counters = @baseline_for.constantize.send(:where, args)
        baseline = baseline_from_counters(counters)
        store_baseline enterprise_id, type, hist, baseline
      end
    end
def aggregate_baseline(enterprise_id, type, ts = Time.now.floor)
      clazz = @baseline_for.constantize
      _ts = ts
      start_calc_time = (_ts.to_datetime - MAX_DURATION.day).to_time
      last_n_days_interval = start_calc_time.ceil.to(_ts, 24.hour)
      last_n_days_interval.each do |hist|
        args = {
            ts: hist,
            type: type,
            enterprise_id: enterprise_id
        }
        counters = @baseline_for.constantize.send(:where, args)
        baseline = baseline_from_counters(counters)
        store_baseline enterprise_id, type, hist, baseline
      end
    end
Aggregates the baseline for a minute