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

@@ -0,0 +1,39 @@
import autobind from 'autobind-decorator';
import Chart, { KVs } from '../core';
import { name, schema } from './entities/ap-request';
/**
* Chart about ActivityPub requests
*/
// eslint-disable-next-line import/no-default-export
export default class ApRequestChart extends Chart<typeof schema> {
constructor() {
super(name, schema);
}
@autobind
protected async queryCurrentState(): Promise<Partial<KVs<typeof schema>>> {
return {};
}
@autobind
public async deliverSucc(): Promise<void> {
await this.commit({
'deliverSucceeded': 1,
});
}
@autobind
public async deliverFail(): Promise<void> {
await this.commit({
'deliverFailed': 1,
});
}
@autobind
public async inbox(): Promise<void> {
await this.commit({
'inboxReceived': 1,
});
}
}