Improve chart engine (#8253)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update core.ts

* wip

* wip

* #7361

* delete network chart

* federationChart強化 apRequestChart追加

* tweak
This commit is contained in:
syuilo
2022-02-06 00:13:52 +09:00
committed by GitHub
parent 0b462feff6
commit c1b264e4e9
65 changed files with 1616 additions and 1756 deletions

View File

@ -22,7 +22,7 @@ export const meta = {
},
},
res: convertLog(activeUsersChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -1,7 +1,7 @@
import $ from 'cafy';
import define from '../../define';
import { convertLog } from '@/services/chart/core';
import { networkChart } from '@/services/chart/index';
import { apRequestChart } from '@/services/chart/index';
export const meta = {
tags: ['charts'],
@ -22,10 +22,10 @@ export const meta = {
},
},
res: convertLog(networkChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await networkChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
return await apRequestChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View File

@ -22,7 +22,7 @@ export const meta = {
},
},
res: convertLog(driveChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -22,7 +22,7 @@ export const meta = {
},
},
res: convertLog(federationChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -26,7 +26,7 @@ export const meta = {
},
},
res: convertLog(hashtagChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -26,7 +26,7 @@ export const meta = {
},
},
res: convertLog(instanceChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -22,7 +22,7 @@ export const meta = {
},
},
res: convertLog(notesChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -27,7 +27,7 @@ export const meta = {
},
},
res: convertLog(perUserDriveChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -27,7 +27,7 @@ export const meta = {
},
},
res: convertLog(perUserFollowingChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -27,7 +27,7 @@ export const meta = {
},
},
res: convertLog(perUserNotesChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -27,7 +27,7 @@ export const meta = {
},
},
res: convertLog(perUserReactionsChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -22,7 +22,7 @@ export const meta = {
},
},
res: convertLog(usersChart.schema),
// TODO: response definition
} as const;
// eslint-disable-next-line import/no-default-export

View File

@ -66,8 +66,8 @@ export default define(meta, async () => {
NoteReactions.count({ cache: 3600000 }), // 1 hour
//NoteReactions.count({ where: { userHost: null }, cache: 3600000 }),
federationChart.getChart('hour', 1, null).then(chart => chart.instance.total[0]),
driveChart.getChart('hour', 1, null).then(chart => chart.local.totalSize[0]),
driveChart.getChart('hour', 1, null).then(chart => chart.remote.totalSize[0]),
driveChart.getChart('hour', 1, null).then(chart => chart.local.totalSize[0] * 1000),
driveChart.getChart('hour', 1, null).then(chart => chart.remote.totalSize[0] * 1000),
]);
return {