import { createElementBlock, createBaseVNode, createVNode, QBtn, Fragment, openBlock } from './__federation_expose_Modules-a9c6a6fc.js';
import { Highcharts } from './highstock-29a73fef.js';
import { _export_sfc } from './_plugin-vue_export-helper-e9a2c33e.js';

const modelPerformance_vue_vue_type_style_index_0_lang = '';

const _sfc_main = {
  data() {
    return {
      headers: {
        "Authorization": "Bearer " + window.$cookies.get('token'),
        "Content-Type": "application/json"
      }
    };
  },
  methods: {
    getPerformanceMetric(data) {
      window.$http.get('/rest/v1/monitoring/performance?training_id=' + 1 + '&data=' + data).then(res => {
        console.log(res);
      }).catch(error => {
        console.log("create_training_job", error);
      });
    },
    drawCharts() {
      Highcharts.stockChart('container', {
        chart: {
          events: {
            load: function () {
              // set up the updating of the chart each second
              var series = this.series[0];
              setInterval(function () {
                var x = new Date().getTime(),
                  // current time
                  y = Math.round(Math.random() * 100);
                series.addPoint([x, y], true, true);
              }, 1000);
            }
          }
        },
        accessibility: {
          enabled: false
        },
        time: {
          useUTC: false
        },
        rangeSelector: {
          buttons: [{
            count: 1,
            type: 'minute',
            text: '1M'
          }, {
            count: 5,
            type: 'minute',
            text: '5M'
          }, {
            type: 'all',
            text: 'All'
          }],
          inputEnabled: false,
          selected: 0
        },
        title: {
          text: 'Live random data'
        },
        exporting: {
          enabled: false
        },
        series: [{
          name: 'Random data',
          data: function () {
            // generate an array of random data
            var data = [],
              time = new Date().getTime(),
              i;
            for (i = -999; i <= 0; i += 1) {
              data.push([time + i * 1000, Math.round(Math.random() * 100)]);
            }
            return data;
          }()
        }]
      });
    }
  },
  mounted() {
    this.drawCharts();
  }
};
const _hoisted_1 = {
  class: "row home-content"
};
const _hoisted_2 = {
  class: "col-2"
};
const _hoisted_3 = {
  class: "col"
};
const _hoisted_4 = /*#__PURE__*/createBaseVNode("div", {
  class: "row home-content"
}, [/*#__PURE__*/createBaseVNode("div", {
  class: "col"
}, [/*#__PURE__*/createBaseVNode("div", {
  id: "container"
})])], -1);
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("div", _hoisted_1, [createBaseVNode("div", _hoisted_2, [createVNode(QBtn, {
    "no-caps": "",
    label: "Same distribution",
    onClick: _cache[0] || (_cache[0] = $event => $options.getPerformanceMetric('same'))
  })]), createBaseVNode("div", _hoisted_3, [createVNode(QBtn, {
    "no-caps": "",
    label: "Different distribution",
    onClick: _cache[1] || (_cache[1] = $event => $options.getPerformanceMetric('diff'))
  })])]), _hoisted_4], 64);
}
const modelPerformance = /*#__PURE__*/_export_sfc(_sfc_main, [['render', _sfc_render]]);

export { modelPerformance as default };
