import type { KVs } from "../core.js"; import Chart from "../core.js"; import { name, schema } from "./entities/test-grouped.js"; /** * For testing */ export default class TestGroupedChart extends Chart { private total = {} as Record; constructor() { super(name, schema, true); } protected async tickMajor( group: string, ): Promise>> { return { "foo.total": this.total[group], }; } protected async tickMinor(): Promise>> { return {}; } public async increment(group: string): Promise { if (this.total[group] == null) this.total[group] = 0; this.total[group]++; await this.commit( { "foo.total": 1, "foo.inc": 1, }, group, ); } }