Improve chart performance (#7360)
* wip * wip * wip * wip * wip * Update chart.ts * wip * Improve server performance * wip * wip
This commit is contained in:
parent
0d19c2d42e
commit
4f249159d3
32 changed files with 889 additions and 161 deletions
|
|
@ -15,6 +15,13 @@ export default class TestUniqueChart extends Chart<TestUniqueLog> {
|
|||
return {};
|
||||
}
|
||||
|
||||
@autobind
|
||||
protected aggregate(logs: TestUniqueLog[]): TestUniqueLog {
|
||||
return {
|
||||
foo: logs.reduce((a, b) => a.concat(b.foo), [] as TestUniqueLog['foo']),
|
||||
};
|
||||
}
|
||||
|
||||
@autobind
|
||||
protected async fetchActual(): Promise<DeepPartial<TestUniqueLog>> {
|
||||
return {};
|
||||
|
|
@ -22,8 +29,8 @@ export default class TestUniqueChart extends Chart<TestUniqueLog> {
|
|||
|
||||
@autobind
|
||||
public async uniqueIncrement(key: string) {
|
||||
await this.incIfUnique({
|
||||
foo: 1
|
||||
}, 'foos', key);
|
||||
await this.inc({
|
||||
foo: [key]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue