Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace tri-state types with a single type, deprecating their uses in public APIs #380

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

kstenerud
Copy link
Contributor

@kstenerud kstenerud commented Jan 27, 2025

This simplifies the interface and avoids needing yet another tri-state type when CPU metrics are added in the next PR.

This also introduces metrics config and option objects, which will hold all of the different metric types.

Note: There is some CPU configuration stuff in here (but no implementations). It makes it easier to just split by file in this case, even though it doesn't make semantic sense between PRs.

Deprecations:

  • BugsnagPerformanceConfiguration .autoInstrumentRendering has been deprecated. Please use BugsnagPerformanceConfiguration. enabledMetrics. rendering instead.
  • BugsnagPerformanceSpanOptions.instrumentRendering has been deprecated. Please use BugsnagPerformanceSpanOptions.metricsOptions.rendering instead.
  • The BSGFirstClass type has been deprecated. Please use BSGTriState instead.
  • The BSGInstrumentRendering type has been deprecated. Please use BSGTriState instead.

Design

Added new BugsnagPerformanceSpanMetricsOptions object to BugsnagPerformanceSpanOptions which will hold current and future metrics configuration options when creating spans.

Added new BugsnagPerformanceEnabledMetrics object to BugsnagPerformanceConfiguration, which controls overall whether certain metrics are collected or not.

BSGTriState replaces BSGFirstClass and BSGInstrumentRendering types.

@kstenerud kstenerud force-pushed the PLAT-13438-tri-state-type branch from 5394fdf to 27c404c Compare January 27, 2025 10:50
Copy link

BugsnagPerformance.framework binary size increased by 5,480 bytes from 528,368 to 533,848

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +2.6% +2.70Ki  +2.6% +2.70Ki    Symbol Table
  +2.0% +2.52Ki  +2.0% +2.52Ki    String Table
  +1.3% +1.51Ki  +1.3% +1.51Ki    __TEXT,__text
  +5.9% +1.14Ki  +5.9% +1.14Ki    __DATA,__objc_const
  +2.7%    +434  +2.7%    +434    __TEXT,__objc_methname
  +1.9%    +256  +1.9%    +256    __TEXT,__objc_stubs
  +6.7%    +213  +6.7%    +213    __TEXT,__objc_methtype
  +8.7%    +160  +8.7%    +160    __DATA,__objc_data
  +1.0%    +124  +1.0%    +124    __TEXT,__gcc_except_tab
  +2.0%    +104  +2.0%    +104    __TEXT,__unwind_info
  +1.7%     +80  +1.7%     +80    [5 Others]
   +11%     +68   +11%     +68    __TEXT,__objc_classname
  +1.9%     +64  +1.9%     +64    __DATA,__objc_selrefs
   +22%     +48   +22%     +48    Export Info
  +4.5%     +48  +4.5%     +48    Rebase Info
  +1.0%     +48  +1.0%     +48    __DATA_CONST,__const
  +2.6%     +32  +2.6%     +32    Function Start Addresses
  -2.9%     -64  -2.9%     -64    [__DATA_CONST]
 -27.9% -1.41Ki -28.6% -1.41Ki    [__DATA]
  -6.8% -2.68Ki  -6.8% -2.68Ki    [__TEXT]
  [ = ]       0 -44.5% -5.35Ki    [__LINKEDIT]
  +1.0% +5.35Ki  [ = ]       0    TOTAL

Generated by 🚫 Danger

@kstenerud kstenerud merged commit 7cdc1f6 into next Jan 27, 2025
25 checks passed
@kstenerud kstenerud deleted the PLAT-13438-tri-state-type branch January 27, 2025 14:22
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.

2 participants