Metrix - Performance Tracker For Frames

Metrix
Download

A module for measuring and visualizing frame-based performance metrics.
Tracks 1% low FPS, 0.1% low FPS, average FPS, current FPS, and frametimes out of the box.

MetrixGIF1.1


Features
  • Highly customizable.
  • Supports custom UIs.
  • Supports custom metrics with easy integration.
  • Real-time graph visualization.
  • No external dependencies.
  • Strictly typed.

Config
[FrameBufferCapacity] - The maximum number of frames stored for calculating interval-based metrics, such as average FPS and low-percentile FPS.
[UpdateInterval] - Time (in seconds) between updates of interval-based metrics and labels.
[ScreenGui] - The ScreenGui used by Metrix.

[Metric] - The metric a graph or label will display.
[Format] - A string.format() pattern used to format label text.

[MaxValue] - The maximum value a graph can show.
[HistorySize] - The maximum number of data points a graph can display at once (capped at 100).
[Thickness] - Thickness of the graph.
[Color] - Color of the graph.

Documentation
-- Starts Metrix.
Metrix:Start(): ()
-- Stops Metrix.
Metrix:Stop(): ()
-- Toggles Metrix ON or OFF.
-- Intended for convenient input-based usage.
Metrix:Toggle(): ()

How to Customize
  • To add a Custom UI, replace the default ScreenGui in the Config and ensure the UI element names match.
    WARNING: When making a Custom UI, use offset instead of scale as graphs don’t scale properly.
    Graphs are also quite performance-heavy, especially when adding a large number of them with high HistorySize values.

  • To add Custom Metrics, insert your logic into UpdateFrameMetrics() or UpdateIntervalMetrics() functions, depending on how often the metric should update:

if CurrentMetrics.CustomMetric then
	CurrentMetrics.CustomMetric = math.random(1, 100)
end
  • New metrics work like any other. For type checking, add them to the Types sub-module.

Inspired by RivaTuner

Versions

1.0

  • Initial Release.

1.01

  • Changed HistorySize of the default graph from 240 to 60.
  • Changed a few descriptions.

1.1

  • Switched to Path2D for drawing graphs, improving graph performance by around 2–3x.
  • Graphs are now capped at 100 HistorySize and will error if exceeded (Path2D limit).
  • Fixed Toogle() typo. Thanks to @jellolemo
  • Renamed LineThickness setting to Thickness.
  • Renamed LineColor setting to Color.
  • Changed a few descriptions.
10 Likes


Any alternatives to the roblox marketplace?

I added an rbxm at the top, that should do for now.
Waiting for approval is very frustrating.

1 Like

i lose almost 80 fps when i use this module :sob:

1 Like

Try setting the HistorySize of the graph to a lower amount.
Updating 240 frames every frame is quite performance-heavy.
Ill look into it and see what i can do, thanks.

1 Like

Toogle instead of Toggle?