ScriptProfilerService¶
A service that captures sampling-based profiles of Luau script execution on the server or on a client.
Not implemented yet
This class exists in the current Roblox API but is not implemented in Nova yet. Scripts that reference it will fail at runtime.
Description¶
ScriptProfilerService provides a scripting interface to Roblox's Luau script
profiler, which periodically samples running Luau threads to attribute CPU
time to the functions that consume it.
Profiling is controlled independently for the server and for individual clients: ServerStart() and ServerStop() govern server-side scripts, while ClientStart() and ClientStop() govern a given player's client. Calling ServerRequestData() or ClientRequestData() collects a snapshot of the profiling results, which is delivered asynchronously through the OnNewData event as a JSON string. That string can be turned into a structured Luau table with DeserializeJSON().
This service powers the Script Profiler in the in-experience Developer Console.
Inheritance¶
Object → Instance → ScriptProfilerService
Methods¶
| Member | Signature | Summary |
|---|---|---|
ClientRequestData |
ScriptProfilerService:ClientRequestData(player: Player): null |
Requests the current script profiling data from the specified player's client. |
ClientStart |
ScriptProfilerService:ClientStart(player: Player, frequency: int?): null |
Begins Luau script profiling for the specified player's client. |
ClientStop |
ScriptProfilerService:ClientStop(player: Player): null |
Stops Luau script profiling for the specified player's client. |
DeserializeJSON |
ScriptProfilerService:DeserializeJSON(jsonString: string?): Dictionary |
Parses a script-profiling JSON string into a structured Luau table. |
SaveScriptProfilingData |
ScriptProfilerService:SaveScriptProfilingData(jsonString: string, filename: string): string |
— |
ServerRequestData |
ScriptProfilerService:ServerRequestData(): null |
Requests the current script profiling data from the server. |
ServerStart |
ScriptProfilerService:ServerStart(frequency: int?): null |
Begins Luau script profiling on the server. |
ServerStop |
ScriptProfilerService:ServerStop(): null |
Stops Luau script profiling on the server. |
Events¶
| Member | Signature | Summary |
|---|---|---|
OnNewData |
OnNewData(player: Player, jsonString: string) |
Fires when a new profiling data snapshot becomes available after a data request. |
RequestData |
RequestData() |
— |
SetProfilingState |
SetProfilingState(start: bool, frequency: int) |
— |
Roblox reference: ScriptProfilerService
Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.