diff --git a/frontend/src/component/app.jsx b/frontend/src/component/app.jsx index c9be520daf..a06ca91b4d 100644 --- a/frontend/src/component/app.jsx +++ b/frontend/src/component/app.jsx @@ -114,9 +114,6 @@ export default class App extends Component { {createListItem('/history', 'Event history', 'history')} {createListItem('/archive', 'Archived toggles', 'archive')} {createListItem('/applications', 'Applications', 'apps')} - {/* createListItem('/metrics', 'Client metrics')*/} - {/* createListItem('/client-strategies', 'Client strategies')*/} - {/* createListItem('/client-instances', 'Client instances')*/} @@ -139,9 +136,6 @@ export default class App extends Component { {createListItem('/applications', 'Applications')} - {/* createListItem('/metrics', 'Client metrics')*/} - {/* createListItem('/client-strategies', 'Client strategies')*/} - {/* createListItem('/client-instances', 'Client instances')*/} diff --git a/frontend/src/component/metrics/metrics-component.js b/frontend/src/component/metrics/metrics-component.js deleted file mode 100644 index b80f193b7c..0000000000 --- a/frontend/src/component/metrics/metrics-component.js +++ /dev/null @@ -1,35 +0,0 @@ -import React, { Component } from 'react'; -import { DataTable, TableHeader } from 'react-mdl'; - -class Metrics extends Component { - - componentDidMount () { - this.props.fetchMetrics(); - } - - render () { - const { globalCount, clientList } = this.props; - - return ( -
-

{`Total of ${globalCount} toggles`}

- - Instance - Application name - (v.toString()) - }>Last seen - Counted - - -
- ); - } -} - - -export default Metrics; diff --git a/frontend/src/component/metrics/metrics-container.js b/frontend/src/component/metrics/metrics-container.js deleted file mode 100644 index e4ab36af79..0000000000 --- a/frontend/src/component/metrics/metrics-container.js +++ /dev/null @@ -1,39 +0,0 @@ -import { connect } from 'react-redux'; -import Metrics from './metrics-component'; -import { fetchMetrics } from '../../store/metrics-actions'; - -const mapStateToProps = (state) => { - const globalCount = state.metrics.get('globalCount'); - const apps = state.metrics.get('apps').toArray(); - const clients = state.metrics.get('clients').toJS(); - - const clientList = Object - .keys(clients) - .map((k) => { - const client = clients[k]; - return { - name: k, - appName: client.appName, - count: client.count, - ping: new Date(client.ping), - }; - }) - .sort((a, b) => (a.ping > b.ping ? -1 : 1)); - - - /* - Possible stuff to ask/answer: - * toggles in use but not in unleash-server - * nr of toggles using fallbackValue - * strategies implemented but not used - */ - return { - globalCount, - apps, - clientList, - }; -}; - -const MetricsContainer = connect(mapStateToProps, { fetchMetrics })(Metrics); - -export default MetricsContainer; diff --git a/frontend/src/data/metrics-api.js b/frontend/src/data/metrics-api.js deleted file mode 100644 index 53d1867894..0000000000 --- a/frontend/src/data/metrics-api.js +++ /dev/null @@ -1,13 +0,0 @@ -import { throwIfNotSuccess } from './helper'; - -const URI = '/api/metrics'; - -function fetchAll () { - return fetch(URI) - .then(throwIfNotSuccess) - .then(response => response.json()); -} - -module.exports = { - fetchAll, -}; diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 7cf269583c..0ca4a4b88f 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -6,7 +6,6 @@ import input from './input-store'; import history from './history-store'; // eslint-disable-line import archive from './archive-store'; import error from './error-store'; -import metrics from './metrics-store'; import clientInstances from './client-instance-store'; import settings from './settings'; import user from './user'; @@ -20,7 +19,6 @@ const unleashStore = combineReducers({ history, archive, error, - metrics, clientInstances, settings, user, diff --git a/frontend/src/store/metrics-actions.js b/frontend/src/store/metrics-actions.js deleted file mode 100644 index 7010d3857d..0000000000 --- a/frontend/src/store/metrics-actions.js +++ /dev/null @@ -1,20 +0,0 @@ -import api from '../data/metrics-api'; - -export const RECEIVE_METRICS = 'RECEIVE_METRICS'; -export const ERROR_RECEIVE_METRICS = 'ERROR_RECEIVE_METRICS'; - -const receiveMetrics = (json) => ({ - type: RECEIVE_METRICS, - value: json, -}); - -const errorReceiveMetrics = (statusCode) => ({ - type: ERROR_RECEIVE_METRICS, - statusCode, -}); - -export function fetchMetrics () { - return dispatch => api.fetchAll() - .then(json => dispatch(receiveMetrics(json))) - .catch(error => dispatch(errorReceiveMetrics(error))); -} diff --git a/frontend/src/store/metrics-store.js b/frontend/src/store/metrics-store.js deleted file mode 100644 index f0b7a4a650..0000000000 --- a/frontend/src/store/metrics-store.js +++ /dev/null @@ -1,21 +0,0 @@ -import { fromJS } from 'immutable'; -import { RECEIVE_METRICS } from './metrics-actions'; - -function getInitState () { - return fromJS({ - totalCount: 0, - apps: [], - clients: {}, - }); -} - -const historyStore = (state = getInitState(), action) => { - switch (action.type) { - case RECEIVE_METRICS: - return fromJS(action.value); - default: - return state; - } -}; - -export default historyStore;