Skip to main content

PerformanceUtils

Functions

summarizeConstructionSite

PerformanceUtils.summarizeConstructionSite(tracebackstring) → string

Turns a construction traceback into a short "who created this" label. Skips instrumentation / Maid / BaseObject frames so owners like DamagePartClient or PipToolWheelServiceClient surface.

getLifetimeSiteCounts

PerformanceUtils.getLifetimeSiteCounts(labelstring) → {[string]number}

Returns live construction-site counts for a label previously passed to PerformanceUtils.trackObjectLifetime.

getLifetimeSiteRanking

PerformanceUtils.getLifetimeSiteRanking(
labelstring,
limitnumber?
) → {{
sitestring,
countnumber,
deltanumber
}}

Ranked live construction sites for a tracked label, with deltas since the previous ranking/dump for that label.

trackObjectLifetime

PerformanceUtils.trackObjectLifetime(
labelstring,
objecttable,
cleanupAliases{string}?
) → () → ()

Tracks objects constructed after this method is called, grouped by construction stack. Cleanup aliases such as DoCleaning, Disconnect, or Kill are rebound to the instrumented Destroy method.

Unlike PerformanceUtils.countObject, cleanup of objects constructed before recording does not make the live total negative.

Also classifies live objects by construction site via PerformanceUtils.summarizeConstructionSite for per-owner Maid/object tracking.

printAll

PerformanceUtils.printAll() → ()

Prints all counters to output.

Show raw api
{
    "functions": [
        {
            "name": "summarizeConstructionSite",
            "desc": "Turns a construction traceback into a short \"who created this\" label.\nSkips instrumentation / Maid / BaseObject frames so owners like DamagePartClient\nor PipToolWheelServiceClient surface.",
            "params": [
                {
                    "name": "traceback",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 168,
                "path": "src/performanceutils/src/Shared/PerformanceUtils.lua"
            }
        },
        {
            "name": "getLifetimeSiteCounts",
            "desc": "Returns live construction-site counts for a label previously passed to\n[PerformanceUtils.trackObjectLifetime].",
            "params": [
                {
                    "name": "label",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ [string]: number }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 215,
                "path": "src/performanceutils/src/Shared/PerformanceUtils.lua"
            }
        },
        {
            "name": "getLifetimeSiteRanking",
            "desc": "Ranked live construction sites for a tracked label, with deltas since the\nprevious ranking/dump for that label.",
            "params": [
                {
                    "name": "label",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "limit",
                    "desc": "",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ { site: string, count: number, delta: number } }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 228,
                "path": "src/performanceutils/src/Shared/PerformanceUtils.lua"
            }
        },
        {
            "name": "trackObjectLifetime",
            "desc": "Tracks objects constructed after this method is called, grouped by construction stack.\nCleanup aliases such as `DoCleaning`, `Disconnect`, or `Kill` are rebound to the\ninstrumented `Destroy` method.\n\nUnlike [PerformanceUtils.countObject], cleanup of objects constructed before recording\ndoes not make the live total negative.\n\nAlso classifies live objects by construction site via\n[PerformanceUtils.summarizeConstructionSite] for per-owner Maid/object tracking.",
            "params": [
                {
                    "name": "label",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "object",
                    "desc": "",
                    "lua_type": "table"
                },
                {
                    "name": "cleanupAliases",
                    "desc": "",
                    "lua_type": "{ string }?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 279,
                "path": "src/performanceutils/src/Shared/PerformanceUtils.lua"
            }
        },
        {
            "name": "printAll",
            "desc": "Prints all counters to output.",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 466,
                "path": "src/performanceutils/src/Shared/PerformanceUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PerformanceUtils",
    "desc": "",
    "source": {
        "line": 5,
        "path": "src/performanceutils/src/Shared/PerformanceUtils.lua"
    }
}