<commit_before>/**
 * Handles metrics import from prseto dashboards
 * @module self-serve/create/import-metric
 * @exports import-metric
 */
import fetch from 'fetch';
import Controller from '@ember/controller';

export default Controller.extend({
  /**
   * Import Defaults
   */
  selectedDatabase: '',
  timeColumn: '',
  selectedTimeFormat: '',
  selectedTimeGranularity: '',
  selectedTimezone: 'UTC',
  response: '',

  init() {
    this._super(...arguments);
    this.aggregationOptions = ['SUM', 'AVG', 'COUNT', 'MAX' ];
    this.timeFormatOptions = ['EPOCH', 'yyyyMMdd', 'yyyy-MM-dd', 'yyyy-MM-dd-HH', 'yyyy-MM-dd HH:mm:ss', 'yyyy-MM-dd HH:mm:ss.S', 'yyyyMMddHHmmss'];
    this.timeGranularityOptions = ['1MILLISECONDS', '1SECONDS', '1MINUTES', '1HOURS', '1DAYS', '1WEEKs', '1MONTHS', '1YEARS'];
    this.timezoneOptions = ["UTC", "Pacific/Midway", "US/Hawaii", "US/Alaska", "US/Pacific", "US/Arizona", "US/Mountain", "US/Central",
      "US/Eastern", "America/Caracas", "America/Manaus", "America/Santiago", "Canada/Newfoundland", "Brazil/East", "America/Buenos_Aires",
      "America/Godthab", "America/Montevideo", "Atlantic/South_Georgia", "Atlantic/Azores", "Atlantic/Cape_Verde", "Africa/Casablanca",
      "Europe/London", "Europe/Berlin", "Europe/Belgrade", "Europe/Brussels", "Europe/Warsaw", "Africa/Algiers", "Asia/Amman", "Europe/Athens",
      "Asia/Beirut", "Africa/Cairo", "Africa/Harare", "Europe/Helsinki", "Asia/Jerusalem", "Europe/Minsk", "Africa/Windhoek",
      "Asia/Baghdad", "Asia/Kuwait", "Europe/Moscow", "Africa/Nairobi", "Asia/Tbilisi", "Asia/Tehran", "Asia/Muscat", "Asia/Baku",
      "Asia/Yerevan", "Asia/Kabul", "Asia/Yekaterinburg", "Asia/Karachi", "Asia/Calcutta", "Asia/Colombo", "Asia/Katmandu",
      "Asia/Novosibirsk", "Asia/Dhaka", "Asia/Rangoon", "Asia/Bangkok", "Asia/Krasnoyarsk", "Asia/Hong_Kong", "Asia/Irkutsk",
      "Asia/Kuala_Lumpur", "Australia/Perth", "Asia/Taipei", "Asia/Tokyo", "Asia/Seoul", "Asia/Yakutsk", "Australia/Adelaide",
      "Australia/Darwin", "Australia/Brisbane", "Australia/Sydney", "Pacific/Guam", "Australia/Hobart", "Asia/Vladivostok", "Asia/Magadan",
      "Pacific/Auckland", "Pacific/Fiji", "Pacific/Tongatapu"];
    this.dimensions = [];
    this.metrics = [];
    this.databaseOptions = [];

    const databaseUrl = '/sql-data-source/databases';
    fetch(databaseUrl).then((res) => {
      var result = res.json();
      result.then((ret) => {
        for (var db in ret) {
          for (var table in ret[db]) {
            this.get('databaseOptions').pushObject(db + '.' + table + '.' + ret[db][table]);
          }
        }
      });
    }).catch(err => {});
  },<commit_msg>Added additional time format option for druid (#6060)<commit_after>/**
 * Handles metrics import from prseto dashboards
 * @module self-serve/create/import-metric
 * @exports import-metric
 */
import fetch from 'fetch';
import Controller from '@ember/controller';

export default Controller.extend({
  /**
   * Import Defaults
   */
  selectedDatabase: '',
  timeColumn: '',
  selectedTimeFormat: '',
  selectedTimeGranularity: '',
  selectedTimezone: 'UTC',
  response: '',

  init() {
    this._super(...arguments);
    this.aggregationOptions = ['SUM', 'AVG', 'COUNT', 'MAX' ];
    this.timeFormatOptions = ['EPOCH', 'yyyyMMdd', 'yyyy-MM-dd', 'yyyy-MM-dd-HH', 'yyyy-MM-dd HH:mm:ss', 'yyyy-MM-dd HH:mm:ss.S', 'yyyyMMddHHmmss', 'yyyy-MM-dd HH:mm:ss.SSS'];
    this.timeGranularityOptions = ['1MILLISECONDS', '1SECONDS', '1MINUTES', '1HOURS', '1DAYS', '1WEEKs', '1MONTHS', '1YEARS'];
    this.timezoneOptions = ["UTC", "Pacific/Midway", "US/Hawaii", "US/Alaska", "US/Pacific", "US/Arizona", "US/Mountain", "US/Central",
      "US/Eastern", "America/Caracas", "America/Manaus", "America/Santiago", "Canada/Newfoundland", "Brazil/East", "America/Buenos_Aires",
      "America/Godthab", "America/Montevideo", "Atlantic/South_Georgia", "Atlantic/Azores", "Atlantic/Cape_Verde", "Africa/Casablanca",
      "Europe/London", "Europe/Berlin", "Europe/Belgrade", "Europe/Brussels", "Europe/Warsaw", "Africa/Algiers", "Asia/Amman", "Europe/Athens",
      "Asia/Beirut", "Africa/Cairo", "Africa/Harare", "Europe/Helsinki", "Asia/Jerusalem", "Europe/Minsk", "Africa/Windhoek",
      "Asia/Baghdad", "Asia/Kuwait", "Europe/Moscow", "Africa/Nairobi", "Asia/Tbilisi", "Asia/Tehran", "Asia/Muscat", "Asia/Baku",
      "Asia/Yerevan", "Asia/Kabul", "Asia/Yekaterinburg", "Asia/Karachi", "Asia/Calcutta", "Asia/Colombo", "Asia/Katmandu",
      "Asia/Novosibirsk", "Asia/Dhaka", "Asia/Rangoon", "Asia/Bangkok", "Asia/Krasnoyarsk", "Asia/Hong_Kong", "Asia/Irkutsk",
      "Asia/Kuala_Lumpur", "Australia/Perth", "Asia/Taipei", "Asia/Tokyo", "Asia/Seoul", "Asia/Yakutsk", "Australia/Adelaide",
      "Australia/Darwin", "Australia/Brisbane", "Australia/Sydney", "Pacific/Guam", "Australia/Hobart", "Asia/Vladivostok", "Asia/Magadan",
      "Pacific/Auckland", "Pacific/Fiji", "Pacific/Tongatapu"];
    this.dimensions = [];
    this.metrics = [];
    this.databaseOptions = [];

    const databaseUrl = '/sql-data-source/databases';
    fetch(databaseUrl).then((res) => {
      var result = res.json();
      result.then((ret) => {
        for (var db in ret) {
          for (var table in ret[db]) {
            this.get('databaseOptions').pushObject(db + '.' + table + '.' + ret[db][table]);
          }
        }
      });
    }).catch(err => {});
  },
{'fraction_non_alphanumeric': 0.20459174226995, 'fraction_numerical': 0.0037030179596371044, 'mean_word_length': 4.130104463437797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5328506', 'n_tokens_mistral': 2156, 'n_tokens_neox': 1965, 'n_words': 325}