18 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

Stats

Inherits from: Instance → Object

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 StatsItem objects which can have their values read by plugins.

Inherits from: Instance

Memory category: Instances

Tags: NotCreatable, Service

Properties

NameType / ReturnsDescription
Stats.ContactsCountintA measurement of how many parts are currently in contact with one another.
Stats.DataReceiveKbpsfloatIn a networked game, this describes roughly how many kilobytes of data are being received by the current instance, per second.
Stats.DataSendKbpsfloatIn a networked game, this describes roughly how many kilobytes of data are being sent by the current instance, per second.
Stats.FrameTimefloatA measurement of how long it takes for the engine to process all tasks required to render a frame.
Stats.HeartbeatTimefloatA measurement of the total amount of time it takes for the server to update its task scheduler jobs in seconds.
Stats.HeartbeatTimeMsfloatA measurement of the total amount of time it takes long it takes for Roblox to update all of its task scheduler jobs, in milliseconds.
Stats.InstanceCountintA measurement of how many Instance are currently in memory.
Stats.MemoryTrackingEnabledbooleanAn indication of whether memory tracking is enabled. This is guaranteed to be unchanged until the next time the Client is started.
Stats.MovingPrimitivesCountintA measurement of how many physically simulated components are currently moving in the game world.
Stats.PhysicsReceiveKbpsfloatIn a networked game, this describes roughly how many kilobytes of physics data are being received by the current instance, per second.
Stats.PhysicsSendKbpsfloatIn a networked game, this describes roughly how many kilobytes of physics data are being sent by the current instance, per second.
Stats.PhysicsStepTimefloatA measurement of how long it takes for the physics engine to update its current state.
Stats.PhysicsStepTimeMsfloatA 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.
Stats.PrimitivesCountintA measurement of how many physically simulated components currently exist in the game world.
Stats.RenderCPUFrameTimefloatA measurement of how long it takes for the CPU to process all of its rendering tasks for a frame.
Stats.RenderGPUFrameTimefloatA measurement of how long it takes for the GPU to process all of its tasks required to render a frame.
Stats.SceneDrawcallCountintA measurement of the number of draw calls made by the game's current scene.
Stats.SceneTriangleCountintA measurement of the number of triangles rendered by the game's current scene.
Stats.ShadowsDrawcallCountintA measurement of the number of draw calls being made for shadows by the game's current scene.
Stats.ShadowsTriangleCountintA measurement of the number of triangles rendered as shadows in the game's current scene.
Stats.UI2DDrawcallCountintA measurement of the number of 2D draw calls made for UI elements in the game's current scene.
Stats.UI2DTriangleCountintA measurement of the number of triangles that are being rendered for 2D UI elements in the game's current scene.
Stats.UI3DDrawcallCountintA measurement of the number of 3D draw calls made for UI elements in the game's current scene.
Stats.UI3DTriangleCountintA measurement of the number of triangles being rendered for 3D UI elements in the game's current scene.

Inherited from Instance

NameType / ReturnsDescription
Instance.ArchivablebooleanDetermines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published.
Instance.archivableboolean
Instance.CapabilitiesSecurityCapabilitiesThe set of capabilities allowed to be used for scripts inside this container.
Instance.IsInSandboxbooleanIndicates whether the instance is inside a sandboxed container.
Instance.NamestringA non-unique identifier of the Instance.
Instance.ParentInstanceDetermines the hierarchical parent of the Instance.
Instance.PredictionModePredictionModeReflects the client-side prediction mode applied to the instance under server-authoritative physics.
Instance.RobloxLockedbooleanA deprecated property that used to protect CoreGui objects.
Instance.SandboxedbooleanWhen enabled, the instance can only access abilities in its Capabilities list.
Instance.UniqueIdUniqueIdA unique identifier for the instance.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

Stats.ContactsCount

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 BasePart:GetTouchingParts() method.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.DataReceiveKbps

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.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.DataSendKbps

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.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.FrameTime

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 to troubleshoot.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.HeartbeatTime

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.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.HeartbeatTimeMs

Deprecated. Use Stats.HeartbeatTime instead.

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.

FieldValue
typefloat
tags["ReadOnly","NotReplicated","Deprecated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.InstanceCount

InstanceCount is a read-only measurement of how many Instance are currently in memory. This includes the DataModel, its descendants, as well as any object created with Instance.new() which is still present in memory.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.MemoryTrackingEnabled

If MemoryTrackingEnabled returns false, any API that returns category-based memory usage such as Stats:GetMemoryUsageMbForTag() or 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.

FieldValue
typeboolean
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.MovingPrimitivesCount

A measurement of how many physically simulated components are currently moving in the game world.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.PhysicsReceiveKbps

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.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.PhysicsSendKbps

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.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.PhysicsStepTime

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.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.PhysicsStepTimeMs

Deprecated. Use Stats.PhysicsStepTime instead.

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.

FieldValue
typefloat
tags["ReadOnly","NotReplicated","Deprecated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.PrimitivesCount

A measurement of how many physically simulated components currently exist in the game world.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.RenderCPUFrameTime

This property is a measurement of how long it takes for the CPU to process all of its rendering tasks for a frame.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.RenderGPUFrameTime

This property is a measurement of how long it takes for the GPU to process all of its tasks required to render a frame.

FieldValue
typefloat
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.SceneDrawcallCount

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.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.SceneTriangleCount

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.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.ShadowsDrawcallCount

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.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.ShadowsTriangleCount

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.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.UI2DDrawcallCount

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.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.UI2DTriangleCount

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.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.UI3DDrawcallCount

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.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Stats.UI3DTriangleCount

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.

FieldValue
typeint
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":false}

Methods

NameType / ReturnsDescription
Stats:GetHarmonyQualityLevelintInternal-only. Returns the engine's current dynamic-quality level as a score normalized from 0 to 100.
Stats:GetMemoryCategoryNamesArrayInternal-only. Returns an array of the names of every developer memory category the engine tracks.
Stats:GetMemoryUsageMbAllCategoriesArrayReturns the number of megabytes that are being consumed by all available categories, or an empty array if MemoryTrackingEnabled is false.
Stats:GetMemoryUsageMbForTagfloatReturns the number of megabytes that are being consumed in the specified DeveloperMemoryTag category, or 0 if MemoryTrackingEnabled is false.
Stats:GetTotalMemoryUsageMbfloatReturns the total amount of memory being consumed by the current game session, in megabytes.
Stats:ResetHarmonyMemoryTarget()Internal-only. Restores the performance-control system's memory budget to the values in effect before Stats:SetHarmonyMemoryTarget() was called.
Stats:SetHarmonyMemoryTarget()Internal-only. Overrides the performance-control system's memory budget with a target value, in megabytes, for testing.

Inherited from Instance

NameType / ReturnsDescription
Instance:AddTag()Applies a tag to the instance.
Instance:childrenInstancesReturns an array of the object's children.
Instance:ClearAllChildren()This method destroys all of an instance's children.
Instance:CloneInstanceCreate a copy of an instance and all its descendants, ignoring instances that are not Archivable.
Instance:cloneInstance
Instance:Destroy()Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children.
Instance:destroy()
Instance:FindFirstAncestorInstance?Returns the first ancestor of the Instance whose Instance.Name is equal to the given name.
Instance:FindFirstAncestorOfClassInstance?Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className.
Instance:FindFirstAncestorWhichIsAInstance?Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstChildInstance?Returns the first child of the Instance found with the given name.
Instance:findFirstChildInstance
Instance:FindFirstChildOfClassInstance?Returns the first child of the Instance whose ClassName is equal to the given class name.
Instance:FindFirstChildWhichIsAInstance?Returns the first child of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstDescendantInstance?Returns the first descendant found with the given Instance.Name.
Instance:GetActorActor?Returns the Actor associated with the Instance, if any.
Instance:GetAttributeVariantReturns the value which has been assigned to the given attribute name.
Instance:GetAttributeChangedSignalRBXScriptSignalReturns an event that fires when the given attribute changes.
Instance:GetAttributesDictionaryReturns a dictionary of the instance's attributes.
Instance:GetChildrenInstancesReturns an array containing all of the instance's children.
Instance:getChildrenInstances
Instance:GetDebugIdstringReturns a coded string of the debug ID used internally by Roblox.
Instance:GetDescendantsInstancesReturns an array containing all of the descendants of the instance.
Instance:GetFullNamestringReturns a string describing the instance's ancestry.
Instance:GetStyledVariantReturns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
Instance:GetStyledPropertyChangedSignalRBXScriptSignalReturns an event that fires when the given style property changes on the instance.
Instance:GetTagsArrayGets an array of all tags applied to the instance.
Instance:HasTagbooleanCheck whether the instance has a given tag.
Instance:IsAncestorOfbooleanReturns true if an Instance is an ancestor of the given descendant.
Instance:IsDescendantOfbooleanReturns true if an Instance is a descendant of the given ancestor.
Instance:isDescendantOfboolean
Instance:IsPropertyModifiedbooleanReturns true if the value stored in the specified property is not equal to the code-instantiated default.
Instance:QueryDescendantsInstancesReturns an array containing all descendants of the instance that match the selector string.
Instance:Remove()Sets the object's Parent to nil, and does the same for all its descendants.
Instance:remove()
Instance:RemoveTag()Removes a tag from the instance.
Instance:ResetPropertyToDefault()Resets a property to its default value.
Instance:SetAttribute()Sets the attribute with the given name to the given value.
Instance:WaitForChildInstanceReturns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

Inherited from Object

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

Stats:GetHarmonyQualityLevel

Requires the InternalTest security capability; not callable from ordinary scripts. Returns the current quality level selected by the engine's dynamic performance-control system, expressed as a score normalized between 0 (the lowest-quality configuration) and 100 (the highest). The score reflects how the system is currently balancing visual quality against resource usage such as memory and frame time.

Returns

TypeDescription
intThe current dynamic-quality level, normalized from 0 (lowest quality) to 100 (highest quality).
FieldValue
securityNone
thread safetyUnsafe
capabilities["InternalTest"]

Stats:GetMemoryCategoryNames

Requires the InternalTest security capability; not callable from ordinary scripts. Returns an array of strings containing the name of every memory category the engine tracks, in category-index order. The entries correspond one-to-one with the measurements returned by Stats:GetMemoryUsageMbAllCategories(), so the two arrays can be read together to label each per-category memory value.

Returns

TypeDescription
ArrayAn array of strings, one per tracked memory category, ordered to match the values returned by Stats:GetMemoryUsageMbAllCategories().
FieldValue
securityNone
thread safetyUnsafe
capabilities["InternalTest"]

Stats:GetMemoryUsageMbAllCategories

Returns the number of megabytes that are being consumed by all available categories. If MemoryTrackingEnabled is false, calling GetMemoryUsageMbAllCategories() will return an empty array and emit a warning to the console.

Returns

TypeDescription
ArrayAn array of numbers in which each entry is the memory, in megabytes, consumed by one memory category, ordered to match the categories returned by Stats:GetMemoryCategoryNames(). Returns an empty array if MemoryTrackingEnabled is false.
FieldValue
securityNone
thread safetyUnsafe
capabilities["InternalTest"]

Stats:GetMemoryUsageMbForTag

Returns the number of megabytes that are being consumed in the specified DeveloperMemoryTag category. If MemoryTrackingEnabled is false, calling GetMemoryUsageMbForTag() will return 0 and emit a warning to the console.

Parameters

NameTypeDefaultDescription
tagDeveloperMemoryTagThe DeveloperMemoryTag memory category to measure.

Returns

TypeDescription
floatThe memory, in megabytes, consumed by the given DeveloperMemoryTag category, or 0 if MemoryTrackingEnabled is false.
FieldValue
securityNone
thread safetyUnsafe

Stats:GetTotalMemoryUsageMb

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 DeveloperMemoryTags. The return value should be very similar to memory usage for Roblox in the Windows Task Manager or macOS Activity Monitor.

Returns

TypeDescription
floatThe total memory, in megabytes, used by the current game session, as reported by the operating system.
FieldValue
securityNone
thread safetyUnsafe

Stats:ResetHarmonyMemoryTarget

Requires the InternalTest security capability; not callable from ordinary scripts. Reverts the artificial memory budget applied by Stats:SetHarmonyMemoryTarget(), restoring the memory-override enable state and limit that were captured before the first call to SetHarmonyMemoryTarget(). After this call, the performance-control system resumes using the device's real available memory when making dynamic-quality decisions.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["InternalTest"]

Stats:SetHarmonyMemoryTarget

Requires the InternalTest security capability; not callable from ordinary scripts. Forces the engine's dynamic performance-control system to operate against an artificial memory budget of targetMB megabytes instead of the device's real available memory, making it behave as though only that much memory is available. This lets you test how dynamic quality and memory reclamation respond under a chosen level of memory pressure. The first call records the pre-override settings so that a later call to Stats:ResetHarmonyMemoryTarget() can restore them.

Parameters

NameTypeDefaultDescription
targetMBintThe memory budget to impose on the performance-control system, in megabytes.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["InternalTest"]

Events

Inherited from Instance

NameType / ReturnsDescription
Instance.AncestryChangedFires when the Instance.Parent property of this object or one of its ancestors is changed.
Instance.AttributeChangedFires whenever an attribute is changed on the Instance.
Instance.ChildAddedFires after an object is parented to this Instance.
Instance.childAdded
Instance.ChildRemovedFires after a child is removed from this Instance.
Instance.DescendantAddedFires after a descendant is added to the Instance.
Instance.DescendantRemovingFires immediately before a descendant of the Instance is removed.
Instance.DestroyingFires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy().
Instance.StyledPropertiesChangedFires whenever any style property is changed on the instance, including when a property is set to nil.

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.