Skip to content

Commit

Permalink
remove Celery monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Lachish committed Dec 4, 2019
1 parent a96ee82 commit 37a74ea
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 330 deletions.
95 changes: 0 additions & 95 deletions client/app/components/admin/CeleryStatus.jsx

This file was deleted.

3 changes: 0 additions & 3 deletions client/app/components/admin/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export default function Layout({ activeTab, children }) {
<Tabs.TabPane key="system_status" tab={<a href="admin/status">System Status</a>}>
{(activeTab === 'system_status') ? children : null}
</Tabs.TabPane>
<Tabs.TabPane key="tasks" tab={<a href="admin/queries/tasks">Celery Status</a>}>
{(activeTab === 'tasks') ? children : null}
</Tabs.TabPane>
<Tabs.TabPane key="jobs" tab={<a href="admin/queries/jobs">RQ Status</a>}>
{(activeTab === 'jobs') ? children : null}
</Tabs.TabPane>
Expand Down
25 changes: 25 additions & 0 deletions client/app/components/admin/RQStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,34 @@ import React from 'react';
import PropTypes from 'prop-types';

import Badge from 'antd/lib/badge';
import Card from 'antd/lib/card';
import Spin from 'antd/lib/spin';
import Table from 'antd/lib/table';
import { Columns } from '@/components/items-list/components/ItemsTable';

// CounterCard

export function CounterCard({ title, value, loading }) {
return (
<Spin spinning={loading}>
<Card>
{title}
<div className="f-20">{value}</div>
</Card>
</Spin>
);
}

CounterCard.propTypes = {
title: PropTypes.string.isRequired,
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
loading: PropTypes.bool.isRequired,
};

CounterCard.defaultProps = {
value: '',
};

// Tables

const otherJobsColumns = [
Expand Down
3 changes: 1 addition & 2 deletions client/app/pages/admin/Jobs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import Alert from 'antd/lib/alert';
import Tabs from 'antd/lib/tabs';
import * as Grid from 'antd/lib/grid';
import Layout from '@/components/admin/Layout';
import { CounterCard } from '@/components/admin/CeleryStatus';
import { WorkersTable, QueuesTable, OtherJobsTable } from '@/components/admin/RQStatus';
import { CounterCard, WorkersTable, QueuesTable, OtherJobsTable } from '@/components/admin/RQStatus';

import { $http, $location, $rootScope } from '@/services/ng';
import recordEvent from '@/services/recordEvent';
Expand Down
135 changes: 0 additions & 135 deletions client/app/pages/admin/Tasks.jsx

This file was deleted.

18 changes: 1 addition & 17 deletions redash/handlers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from redash.permissions import require_super_admin
from redash.serializers import QuerySerializer
from redash.utils import json_loads
from redash.monitor import celery_tasks, rq_status
from redash.monitor import rq_status


@routes.route('/api/admin/queries/outdated', methods=['GET'])
Expand Down Expand Up @@ -38,22 +38,6 @@ def outdated_queries():
return json_response(response)


@routes.route('/api/admin/queries/tasks', methods=['GET'])
@require_super_admin
@login_required
def queries_tasks():
record_event(current_org, current_user._get_current_object(), {
'action': 'list',
'object_type': 'celery_tasks'
})

response = {
'tasks': celery_tasks(),
}

return json_response(response)


@routes.route('/api/admin/queries/rq_status', methods=['GET'])
@require_super_admin
@login_required
Expand Down
Loading

0 comments on commit 37a74ea

Please sign in to comment.