# This file is automatically generated. Please don't edit it manually. # To submit a bug report on the content, see # https://devforum.roblox.com/c/bug-reports/documentation-issues/72 name: Stats type: class memory_category: Instances summary: | Performance metrics for a game. description: | `Class.Stats` is a service that provides real-time performance information about the current running game instance. Its primary purpose is to provide an end point to measure where resources are being consumed, as well as how much memory is being consumed overall. The service also stores a tree of `Class.StatsItem` objects which can have their values read by plugins. code_samples: [] inherits: - Instance descendants: [] tags: - NotCreatable - Service deprecation_message: '' properties: - name: Stats.ContactsCount summary: | A measurement of how many parts are currently in contact with one another. description: | This property describes how many parts are currently in contact with each other, such that one of the two parts are being physically simulated, and thus can be recognized by the `Class.BasePart:GetTouchingParts()` method. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.DataReceiveKbps summary: | In a networked game, this describes roughly how many kilobytes of data are being received by the current instance, per second. description: | In a networked game, this property describes roughly how many kilobytes of data are being received by the current instance, per second. If from the server's perspective, this represents the total amount of data being received from the clients connected to the server. If from a client's perspective, this represents the total amount of data being received from the server. code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.DataSendKbps summary: | In a networked game, this describes roughly how many kilobytes of data are being sent by the current instance, per second. description: | In a networked game, this property describes roughly how many kilobytes of data are being sent by the current instance, per second. If from the server's perspective, this represents the total amount of data being sent to the clients connected to the server. If from a client's perspective, this represents the total amount of data being sent to the server. code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.FrameTime summary: | A measurement of how long it takes for the engine to process all tasks required to render a frame. description: | This property is only available in client scripts and is a measurement of how long it took to render the most-recent frame in seconds. Divide `1` by this value to calculate an FPS value for the frame time. High frame times are indicative of performance problems on the device. Consider using the [MicroProfiler](/studio/microprofiler) to troubleshoot. code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.HeartbeatTime summary: | A measurement of the total amount of time it takes for the server to update its task scheduler jobs in seconds. description: | This property is a measurement of the total amount of time it takes for the server to update its task scheduler jobs in seconds. If this value is high, examine [server compute](/performance-optimization/identifying#server-compute). code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.HeartbeatTimeMs summary: | A measurement of the total amount of time it takes long it takes for Roblox to update all of its task scheduler jobs, in milliseconds. description: | The `HeartbeatTimeMs` property is a measurement of the total amount of time it takes long it takes for Roblox to update all of its task scheduler jobs, in milliseconds. If this value is high, then it means one of the tasks are hogging up a lot of resources. code_samples: [] type: float tags: - ReadOnly - NotReplicated - Deprecated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.InstanceCount summary: | A measurement of how many `Class.Instance` are currently in memory. description: | `InstanceCount` is a read-only measurement of how many `Class.Instance` are currently in memory. This includes the `Class.DataModel`, its descendants, as well as any object created with `Datatype.Instance.new()` which is still present in memory. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.MemoryTrackingEnabled summary: | An indication of whether memory tracking is enabled. This is guaranteed to be unchanged until the next time the Client is started. description: | If `MemoryTrackingEnabled` returns `false`, any API that returns category-based memory usage such as `Class.Stats:GetMemoryUsageMbForTag()` or `Class.Stats:GetMemoryUsageMbAllCategories()` will return `0` and emit a warning. Therefore, usage of category-based memory usage API should be conditional on `MemoryTrackingEnabled` returning `true`. The value of `MemoryTrackingEnabled` will not change from one experience to the next; it will only potentially change after restarting the Roblox client application. code_samples: [] type: boolean tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.MovingPrimitivesCount summary: | A measurement of how many physically simulated components are currently moving in the game world. description: | A measurement of how many physically simulated components are currently moving in the game world. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.PhysicsReceiveKbps summary: | In a networked game, this describes roughly how many kilobytes of physics data are being received by the current instance, per second. description: | PhysicsReceiveKbps is a measurement of roughly how many kilobytes of physics data are being received by the current instance, per second.If from the server's perspective, this represents the total amount of physics data being received from the clients connected to the server.If from a client's perspective, this represents the total amount of physics data being received from the server. code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.PhysicsSendKbps summary: | In a networked game, this describes roughly how many kilobytes of physics data are being sent by the current instance, per second. description: | `PhysicsSendKbps` describes roughly how many kilobytes of physics data are being sent by the current instance, per second. If from the server's perspective, this represents the total amount of physics data being sent to the clients connected to the server. If from a client's perspective, this represents the total amount of physics data being sent to the server. code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.PhysicsStepTime summary: | A measurement of how long it takes for the physics engine to update its current state. description: | This property is a measurement of how long it takes for the physics engine to update its current state. If this value is high, it means the game instance is under stress from the physics simulations taking place. code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.PhysicsStepTimeMs summary: | A measurement of how long it takes for the physics engine to update its current state, in milliseconds. If this value is high, then it means the game instance is under stress from the physics simulations taking place. description: | A measurement of how long it takes for the physics engine to update its current state, in milliseconds. If this value is high, then it means the game instance is under stress from the physics simulations taking place. code_samples: [] type: float tags: - ReadOnly - NotReplicated - Deprecated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.PrimitivesCount summary: | A measurement of how many physically simulated components currently exist in the game world. description: | A measurement of how many physically simulated components currently exist in the game world. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.RenderCPUFrameTime summary: | A measurement of how long it takes for the CPU to process all of its rendering tasks for a frame. description: | This property is a measurement of how long it takes for the CPU to process all of its rendering tasks for a frame. code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.RenderGPUFrameTime summary: | A measurement of how long it takes for the GPU to process all of its tasks required to render a frame. description: | This property is a measurement of how long it takes for the GPU to process all of its tasks required to render a frame. code_samples: [] type: float tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.SceneDrawcallCount summary: | A measurement of the number of draw calls made by the game's current scene. description: | This property is a measurement of the number of draw calls made by the game's current scene. A draw call is a single rendering operation, such as drawing a mesh. A high draw call count could mean a scene is too complex or unoptimized, which can lead to performance issues. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.SceneTriangleCount summary: | A measurement of the number of triangles rendered by the game's current scene. description: | This property is a measurement of the number of triangles rendered by the game's current scene. A count of triangles rendered is useful when trying to estimate the complexity and performance of a scene. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.ShadowsDrawcallCount summary: | A measurement of the number of draw calls being made for shadows by the game's current scene. description: | This property is a measurement of the number of draw calls being made for shadows by the game's current scene. A high count means more shadows are being created by the amount of rendered objects in a scene. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.ShadowsTriangleCount summary: | A measurement of the number of triangles rendered as shadows in the game's current scene. description: | This property is a measurement of the number of triangles rendered as shadows in the game's current scene. A high count means there are a lot of triangles used to cast shadows, which can hinder performance. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.UI2DDrawcallCount summary: | A measurement of the number of 2D draw calls made for UI elements in the game's current scene. description: | This property is a measurement of the number of 2D draw calls made for UI elements in the game's current scene. A high count can mean there are a lot of 2D UI elements being used. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.UI2DTriangleCount summary: | A measurement of the number of triangles that are being rendered for 2D UI elements in the game's current scene. description: | This property is a measurement of the number of triangles that are being rendered for 2D UI elements in the game's current scene. A high count can mean there are many or complex 2D UI elements used, which can contribute to performance loss in regards to rendering. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.UI3DDrawcallCount summary: | A measurement of the number of 3D draw calls made for UI elements in the game's current scene. description: | This property is a measurement of the number of 3D draw calls made for UI elements in the game's current scene. A high count could indicate a high amount of 3D objects being used within UI, potentially hurting performance; however, it is very unlikely you would see a significant count since UI elements are typically 2D. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Stats.UI3DTriangleCount summary: | A measurement of the number of triangles being rendered for 3D UI elements in the game's current scene. description: | This property is a measurement of the number of triangles being rendered for 3D UI elements in the game's current scene; however, it is very unlikely you would see a significant count since UI elements are typically 2D. code_samples: [] type: int tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] methods: - name: Stats:GetHarmonyQualityLevel summary: '' description: '' code_samples: [] parameters: [] returns: - type: int summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: - InternalTest - name: Stats:GetMemoryCategoryNames summary: '' description: '' code_samples: [] parameters: [] returns: - type: Array summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: - InternalTest - name: Stats:GetMemoryUsageMbAllCategories summary: | Returns the number of megabytes that are being consumed by all available categories, or an empty array if `Class.Stats.MemoryTrackingEnabled|MemoryTrackingEnabled` is `false`. description: | Returns the number of megabytes that are being consumed by all available categories. If `Class.Stats.MemoryTrackingEnabled|MemoryTrackingEnabled` is `false`, calling `GetMemoryUsageMbAllCategories()` will return an empty array and emit a warning to the console. code_samples: [] parameters: [] returns: - type: Array summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: - InternalTest - name: Stats:GetMemoryUsageMbForTag summary: | Returns the number of megabytes that are being consumed in the specified `Enum.DeveloperMemoryTag` category, or `0` if `Class.Stats.MemoryTrackingEnabled|MemoryTrackingEnabled` is `false`. description: | Returns the number of megabytes that are being consumed in the specified `Enum.DeveloperMemoryTag` category. If `Class.Stats.MemoryTrackingEnabled|MemoryTrackingEnabled` is `false`, calling `GetMemoryUsageMbForTag()` will return `0` and emit a warning to the console. code_samples: [] parameters: - name: tag type: DeveloperMemoryTag default: summary: '' returns: - type: float summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: [] - name: Stats:GetTotalMemoryUsageMb summary: | Returns the total amount of memory being consumed by the current game session, in megabytes. description: | Returns the total amount of memory being consumed by the current game session, in megabytes. This method gets memory usage from the operating system, which may exclude memory that has been paged out to disk. As such, the return value tends to differ significantly from the sum of usage for all `Enum.DeveloperMemoryTag|DeveloperMemoryTags`. The return value should be very similar to memory usage for Roblox in the Windows Task Manager or macOS Activity Monitor. code_samples: [] parameters: [] returns: - type: float summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: [] - name: Stats:ResetHarmonyMemoryTarget summary: '' description: '' code_samples: [] parameters: [] returns: - type: () summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: - InternalTest - name: Stats:SetHarmonyMemoryTarget summary: '' description: '' code_samples: [] parameters: - name: targetMB type: int default: summary: '' returns: - type: () summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: - InternalTest events: [] callbacks: []