-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add style element count measure (#1314)
- Loading branch information
1 parent
24626fc
commit 6dc76b3
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
packages/memory-leak-finder/src/parts/GetStyleElementCount/GetStyleElementCount.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as GetObjectCount from '../GetObjectCount/GetObjectCount.js' | ||
import * as PrototypeExpression from '../PrototypeExpression/PrototypeExpression.js' | ||
|
||
/** | ||
* | ||
* @param {any} session | ||
* @returns {Promise<number>} | ||
*/ | ||
export const getCanvasCount = async (session, objectGroup) => { | ||
return GetObjectCount.getObjectCount(session, PrototypeExpression.StyleElement, objectGroup) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/memory-leak-finder/src/parts/MeasureStyleElementCount/MeasureStyleElementCount.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as CompareCount from '../CompareCount/CompareCount.js' | ||
import * as GetStyleElementCount from '../GetStyleElementCount/GetStyleElementCount.js' | ||
import * as IsLeakCount from '../IsLeakCount/IsLeakCount.js' | ||
import * as MeasureId from '../MeasureId/MeasureId.js' | ||
import * as ObjectGroupId from '../ObjectGroupId/ObjectGroupId.js' | ||
import * as ReleaseObjectGroup from '../ReleaseObjectGroup/ReleaseObjectGroup.js' | ||
|
||
export const id = MeasureId.StyleElementCount | ||
|
||
export const create = (session) => { | ||
const objectGroup = ObjectGroupId.create() | ||
return [session, objectGroup] | ||
} | ||
|
||
export const start = (session, objectGroup) => { | ||
return GetStyleElementCount.getCanvasCount(session, objectGroup) | ||
} | ||
|
||
export const stop = async (session, objectGroup) => { | ||
const result = await GetStyleElementCount.getCanvasCount(session, objectGroup) | ||
return result | ||
} | ||
|
||
export const releaseResources = async (session, objectGroup) => { | ||
await ReleaseObjectGroup.releaseObjectGroup(session, objectGroup) | ||
} | ||
|
||
export const compare = CompareCount.compareCount | ||
|
||
export const isLeak = IsLeakCount.isLeakCount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters