ꘇ dat.monitor:
GeneretiPerformanceMonitor turns a supplied browser performance report into values you can inspect or connect to other nodes in a workflow. It extracts six named measurements, makes them available as individual metric channels, and preserves the original report as JSON. This helps you compare reported browser performance alongside your creative workflow. The node reads a report when the workflow executes; the provided implementation does not measure performance itself or establish that a browser measurement has occurred.
ꘇ dat.monitor Input Parameters:
report
An optional JSON string containing the performance measurements to read. The default is {}, an empty JSON object; no minimum, maximum, or predefined options are specified. You can include the keys fps, meanMs, p95Ms, worstMs, slowFrames, and longTasks. The node converts each present measurement to a number and uses 0 for any missing key. For example, {"fps": 48, "meanMs": 20} supplies two measurements and leaves the other four at zero. Each supplied measurement must be convertible to a finite number. The report must be valid JSON representing an object for the node to read it successfully; additional fields are retained in the JSON output but do not become metric channels.
ꘇ dat.monitor Output Parameters:
browser fps
A FLOAT containing the report’s fps measurement, or 0 when that key is absent. Read it as the browser frame-rate figure supplied in the report, not as a fresh frame-rate measurement made by this node. Its meaning depends on the report you provide.
metrics
A GENERETI_CHOP value with six channels named fps, meanMs, p95Ms, worstMs, slowFrames, and longTasks. Each channel contains one numeric value taken from the report, or zero if its key is missing. The node converts those values to 32-bit floating-point numbers and sets the channel data’s sample_rate to 1.0 and start to 0.0. This is a single set of reported measurements, not a recorded performance history; the node does not calculate averages, percentiles, or task counts from raw events.
json
A STRING containing the parsed report serialized back to JSON. It preserves fields beyond the six extracted measurements, making it useful when you need to pass on or inspect the supplied report. Missing measurements are not added to this output: an empty report produces {} here even though the other outputs use zero for missing values.
ꘇ dat.monitor Usage Tips:
- Supply a JSON object from a source that actually records browser performance. Leaving
reportat{}is useful for checking connections, but its zero values do not indicate that performance was measured at zero. - Use the exact metric keys
fps,meanMs,p95Ms,worstMs,slowFrames, andlongTasks. A differently spelled key remains in the JSON output but will not populate its intended metric channel. - Send
browser fpsto a connection that needs one frame-rate value. Usemetricswhen you want access to all six extracted values, andjsonwhen you need the supplied report, including any additional fields. - When comparing reports, keep their measurement methods and units consistent. The node copies the supplied figures; it does not make reports from different sources comparable.
ꘇ dat.monitor Common Errors and Solutions:
json.decoder.JSONDecodeError: Invalid JSON in report
- Explanation: The report cannot be parsed as JSON. Common causes include missing quotes around keys, trailing commas, or an empty string.
- Solution: Enter a valid JSON object, such as
{"fps": 48}, or use the default{}when you have no report yet.
AttributeError: The parsed report has no get method
- Explanation: Valid JSON can still contain the wrong kind of value. An array, number, string, or
nulldoes not provide the object keys this node expects. - Solution: Make the outermost JSON value an object enclosed in braces, such as
{"fps": 48}.
ValueError: Monitor metrics must be finite
- Explanation: At least one extracted measurement converts to a non-finite number, such as infinity or NaN. The node rejects the report instead of returning that value.
- Solution: Replace the affected measurement with a finite numeric value, or remove its key so the node uses zero.
ValueError or TypeError: A metric cannot be converted to a number
- Explanation: A supplied measurement contains something the node cannot convert with
float(), such as"fast",null, or an object. - Solution: Use numeric values for the six recognized keys, for example
{"fps": 48, "slowFrames": 2}. Omit a measurement if it is unavailable.
A metric unexpectedly reads 0 without an error
- Explanation: The corresponding key is missing, misspelled, or uses different capitalization. The node substitutes zero for absent keys.
- Solution: Check the report against the exact key names listed under
metrics. Do not interpret a default zero as a measured result.
