TTL: dateToEpoch()

in packages/core/lib/middleware/sampling/service_connector.js [163:192]


      TTL: dateToEpoch(doc['ReservoirQuotaTTL']),
      interval: doc['Interval']
    };
    targetsMapping[doc['RuleName']] = newTarget;
  });

  return targetsMapping;
};

var isRuleValid = function isRuleValid(record) {
  return record['Version'] === 1
    && record['ResourceARN'] === '*'
    && record['Attributes'] && Object.keys(record['Attributes']).length === 0
    && record['ServiceType']
    && record['RuleName']
    && record['Priority']
    && typeof record['FixedRate'] == 'number';
};

var dateToEpoch = function dateToEpoch(date) {
  return new Date(date).getTime() / 1000;
};

var getOptions = function getOptions(path, contentLength) {
  const options = {
    hostname: DaemonConfig.tcp_ip,
    port: DaemonConfig.tcp_port,
    method: 'POST',
    path: path,
    headers: {