Skip to content

Conversation

@marco-saia-datadog
Copy link
Member

@marco-saia-datadog marco-saia-datadog commented Nov 25, 2025

What and why?

Adds new attributes to the Device Info:

  • logicalCpuCount: Number of logical CPU cores available for scheduling on the device at runtime, as reported by the operating system.
  • totalRam: The total RAM in megabytes

These attributes allow us to classify devices as low-, mid-, or high-tier, which improves our ability to diagnose performance issues.

How?

  • logicalCpuCount is retrieved from ProcessInfo.processInfo.processorCount, which returns the number of processor cores available on the device (ref)
  • totalRam is retrieved from ProcessInfo.processInfo.physicalMemory, which returns the amount of physical memory on the device in bytes (ref)

Additional Notes

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes
  • Add Objective-C interface for public APIs (see our guidelines (internal) and run make api-surface)

@marco-saia-datadog marco-saia-datadog force-pushed the marcosaia/RUM-12199/new-device-capability-metrics branch 2 times, most recently from b619739 to cfa29d7 Compare November 25, 2025 08:41
@marco-saia-datadog marco-saia-datadog force-pushed the marcosaia/RUM-12199/new-device-capability-metrics branch from cfa29d7 to d7c19e0 Compare November 28, 2025 15:42
@marco-saia-datadog marco-saia-datadog marked this pull request as ready for review November 28, 2025 15:43
@marco-saia-datadog marco-saia-datadog requested a review from a team as a code owner November 28, 2025 15:43
@marco-saia-datadog marco-saia-datadog force-pushed the marcosaia/RUM-12199/new-device-capability-metrics branch 4 times, most recently from 46dd08f to 5642bd8 Compare November 28, 2025 16:24
simaoseica-dd
simaoseica-dd previously approved these changes Nov 28, 2025
Copy link
Contributor

@simaoseica-dd simaoseica-dd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Just left a suggestion for improvement.

@marco-saia-datadog marco-saia-datadog force-pushed the marcosaia/RUM-12199/new-device-capability-metrics branch 3 times, most recently from b9ca352 to 200e6ea Compare December 1, 2025 12:02
Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍 Just a little change to make!

Comment on lines 159 to 160
processorCount: Double(ProcessInfo.processInfo.processorCount),
totalRam: Double(ProcessInfo.processInfo.physicalMemory / (1_024 * 1_024))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cr/ Lets use the processInfo provided as argument:

Suggested change
processorCount: Double(ProcessInfo.processInfo.processorCount),
totalRam: Double(ProcessInfo.processInfo.physicalMemory / (1_024 * 1_024))
processorCount: Double(processInfo.processorCount),
totalRam: Double(processInfo.physicalMemory / (1_024 * 1_024))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍 thanks! I have rebased the PR and pushed the new changes

Comment on lines 214 to 215
processorCount: Double(ProcessInfo.processInfo.processorCount),
totalRam: Double(ProcessInfo.processInfo.physicalMemory / (1_024 * 1_024))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cr/ same here

Suggested change
processorCount: Double(ProcessInfo.processInfo.processorCount),
totalRam: Double(ProcessInfo.processInfo.physicalMemory / (1_024 * 1_024))
processorCount: Double(processInfo.processorCount),
totalRam: Double(processInfo.physicalMemory / (1_024 * 1_024))

Comment on lines 174 to 175
processorCount: Double(ProcessInfo.processInfo.processorCount),
totalRam: Double(ProcessInfo.processInfo.physicalMemory / (1_024 * 1_024))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
processorCount: Double(ProcessInfo.processInfo.processorCount),
totalRam: Double(ProcessInfo.processInfo.physicalMemory / (1_024 * 1_024))
processorCount: Double(processInfo.processorCount),
totalRam: Double(processInfo.physicalMemory / (1_024 * 1_024))

@marco-saia-datadog marco-saia-datadog force-pushed the marcosaia/RUM-12199/new-device-capability-metrics branch from 200e6ea to af3aa56 Compare December 11, 2025 13:22
simaoseica-dd
simaoseica-dd previously approved these changes Dec 12, 2025
Copy link
Contributor

@simaoseica-dd simaoseica-dd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

maxep
maxep previously approved these changes Dec 12, 2025
Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@marco-saia-datadog marco-saia-datadog changed the title RUM-12199: Add totalRam and processorCount to DeviceInfo RUM-13469: Add totalRam and processorCount to DeviceInfo Dec 18, 2025
@marco-saia-datadog marco-saia-datadog force-pushed the marcosaia/RUM-12199/new-device-capability-metrics branch from af3aa56 to 3d4afbb Compare January 13, 2026 15:45
@marco-saia-datadog marco-saia-datadog changed the title RUM-13469: Add totalRam and processorCount to DeviceInfo RUM-13469: Add totalRam and logicalCpuCount to DeviceInfo Jan 13, 2026
@marco-saia-datadog
Copy link
Member Author

Following an internal discussion, I have renamed processorCount to logicalCpuCount, as it is more descriptive.

Here are the changes in rum-events-format: DataDog/rum-events-format#337

Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@marco-saia-datadog marco-saia-datadog merged commit f052416 into develop Jan 14, 2026
17 checks passed
@marco-saia-datadog marco-saia-datadog deleted the marcosaia/RUM-12199/new-device-capability-metrics branch January 14, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants