mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
feat(core): add more performance metrics
This commit is contained in:
@@ -511,15 +511,17 @@ export class DataStruct {
|
||||
|
||||
async measure(name: string) {
|
||||
const count = debugMarkCount++;
|
||||
performance.mark(`${name}Start(${count})`);
|
||||
performance.mark(`[idb-indexer]${name}Start(${count})`);
|
||||
return {
|
||||
[Symbol.dispose]: () => {
|
||||
performance.mark(`${name}End(${count})`);
|
||||
performance.measure(
|
||||
`${name}`,
|
||||
`${name}Start(${count})`,
|
||||
`${name}End(${count})`
|
||||
);
|
||||
performance.measure(`${name}`, {
|
||||
start: `[idb-indexer]${name}Start(${count})`,
|
||||
detail: {
|
||||
devtools: {
|
||||
track: '[idb-indexer]',
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user