Skip to content

Commit

Permalink
chore: add Enabled suffix to PerformanceAutoInstrumentation option
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Nov 8, 2022
1 parent 08aaeec commit 3aecf9c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MonoBehaviour:
<CaptureInEditor>k__BackingField: 1
<EnableLogDebouncing>k__BackingField: 0
<TracesSampleRate>k__BackingField: 0
<PerformanceAutoInstrumentation>k__BackingField: 0
<PerformanceAutoInstrumentationEnabled>k__BackingField: 1
<AutoSessionTracking>k__BackingField: 1
<AutoSessionTrackingInterval>k__BackingField: 30000
<ReleaseOverride>k__BackingField:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void OnPostBuildPlayerScriptDLLs(BuildReport report)
}

var logger = options.DiagnosticLogger ?? new UnityLogger(options);
if (options.TracesSampleRate <= 0.0f || !options.PerformanceAutoInstrumentation)
if (options.TracesSampleRate <= 0.0f || !options.PerformanceAutoInstrumentationEnabled)
{
logger.LogInfo("Performance Auto Instrumentation has been disabled.");
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ internal static void Display(ScriptableSentryUnityOptions options)
EditorGUI.BeginDisabledGroup(options.TracesSampleRate <= 0);

GUILayout.Label("Experimental", EditorStyles.boldLabel);
options.PerformanceAutoInstrumentation = EditorGUILayout.Toggle(
options.PerformanceAutoInstrumentationEnabled = EditorGUILayout.Toggle(
new GUIContent("Auto Instrumentation", "To create transaction and spans automatically, " +
"the SDK will modify the compiled assembly during a post build step."),
options.PerformanceAutoInstrumentation);
options.PerformanceAutoInstrumentationEnabled);

EditorGUI.EndDisabledGroup();
}
Expand Down
5 changes: 2 additions & 3 deletions src/Sentry.Unity/ScriptableSentryUnityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public static string GetConfigPath(string? notDefaultConfigName = null)
[field: SerializeField] public bool EnableLogDebouncing { get; set; } = false;
[field: SerializeField] public double TracesSampleRate { get; set; } = 0;

// TODO rename to PerformanceAutoInstrumentationEnabled to align with the rest of the boolean options below
[field: SerializeField] public bool PerformanceAutoInstrumentation { get; set; } = false;
[field: SerializeField] public bool PerformanceAutoInstrumentationEnabled { get; set; } = false;

[field: SerializeField] public bool AutoSessionTracking { get; set; } = true;

Expand Down Expand Up @@ -136,7 +135,7 @@ internal SentryUnityOptions ToSentryUnityOptions(bool isBuilding, ISentryUnityIn
MacosNativeSupportEnabled = MacosNativeSupportEnabled,
LinuxNativeSupportEnabled = LinuxNativeSupportEnabled,
Il2CppLineNumberSupportEnabled = Il2CppLineNumberSupportEnabled,
PerformanceAutoInstrumentationEnabled = PerformanceAutoInstrumentation,
PerformanceAutoInstrumentationEnabled = PerformanceAutoInstrumentationEnabled,
};

if (!string.IsNullOrWhiteSpace(ReleaseOverride))
Expand Down

0 comments on commit 3aecf9c

Please sign in to comment.