Skip to content

Commit 1ec0239

Browse files
committed
Profile schedules UX improvements (#3274)
Bunch of UX improvements: ![image](https://github.com/user-attachments/assets/2eebdf3e-6744-4403-8f54-66da2f396608) ![image](https://github.com/user-attachments/assets/3e170040-24a9-4d2a-8750-96768287d379) ![image](https://github.com/user-attachments/assets/eb44db1f-ddc6-4f08-9337-c9577937d6d8) needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes [AB#567095](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/567095)
1 parent 5ed510e commit 1ec0239

6 files changed

+259
-46
lines changed

src/System Application/App/Performance Profiler/app.json

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
7272
"name": "System Initialization",
7373
"publisher": "Microsoft",
7474
"version": "26.1.0.0"
75+
},
76+
{
77+
"id": "7f850a76-a58c-4ade-a14f-7d7acff97115",
78+
"name": "User Selection",
79+
"publisher": "Microsoft",
80+
"version": "26.1.0.0"
7581
}
7682
],
7783
"internalsVisibleTo": [

src/System Application/App/Performance Profiler/src/PerfProfileActivityType.enum.al

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ enum 1932 "Perf. Profile Activity Type"
1717
/// </summary>
1818
value(0; "Web Client")
1919
{
20-
Caption = 'Activity in the browser';
20+
Caption = 'Activities in the browser';
2121
}
2222

2323
/// <summary>
2424
/// The background activity type
2525
/// </summary>
2626
value(1; "Background")
2727
{
28-
Caption = 'Background Tasks';
28+
Caption = 'Background tasks (incl. job queues)';
2929
}
3030

3131
/// <summary>
3232
/// The web api activity type
3333
/// </summary>
3434
value(2; "Web API Client")
3535
{
36-
Caption = 'Web Service Calls';
36+
Caption = 'Web service calls';
3737
}
3838
}

src/System Application/App/Performance Profiler/src/PerfProfilerScheduleCard.Page.al

+111-19
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace System.Tooling;
88
using System.PerformanceProfile;
99
using System.Security.AccessControl;
1010
using System.DataAdministration;
11+
using System.Security.User;
1112

1213
/// <summary>
1314
/// Card page for schedule based sampling profilers
@@ -30,31 +31,47 @@ page 1932 "Perf. Profiler Schedule Card"
3031
group(General)
3132
{
3233
Caption = 'General';
33-
AboutText = 'General information about the profiler schedule.';
34-
AboutTitle = 'General information';
3534

35+
field(Description; Rec.Description)
36+
{
37+
ApplicationArea = All;
38+
Caption = 'Description';
39+
ToolTip = 'Specifies the description of the schedule.';
40+
41+
trigger OnValidate()
42+
begin
43+
this.ValidateDescription();
44+
end;
45+
}
3646
field("Schedule ID"; Rec."Schedule ID")
3747
{
3848
ApplicationArea = All;
3949
Caption = 'Schedule ID';
4050
ToolTip = 'Specifies the ID of the schedule.';
41-
AboutText = 'The ID of the schedule.';
4251
Editable = false;
43-
Visible = false;
4452
}
53+
#if not CLEAN27
4554
field(Enabled; Rec.Enabled)
4655
{
4756
ApplicationArea = All;
4857
Caption = 'Enabled';
4958
ToolTip = 'Specifies whether the schedule is enabled.';
5059
AboutText = 'Specifies whether the schedule is enabled.';
60+
Visible = false;
61+
ObsoleteReason = 'This field is moved to StatusGroup.';
62+
ObsoleteState = Pending;
63+
ObsoleteTag = '27.0';
5164
}
5265
field("Start Time"; Rec."Starting Date-Time")
5366
{
5467
ApplicationArea = All;
5568
Caption = 'Start Time';
5669
ToolTip = 'Specifies the start time of the schedule.';
5770
AboutText = 'The start time of the schedule.';
71+
Visible = false;
72+
ObsoleteReason = 'This field is moved to StatusGroup.';
73+
ObsoleteState = Pending;
74+
ObsoleteTag = '27.0';
5875

5976
trigger OnValidate()
6077
begin
@@ -67,52 +84,125 @@ page 1932 "Perf. Profiler Schedule Card"
6784
Caption = 'End Time';
6885
ToolTip = 'Specifies the end time of the schedule.';
6986
AboutText = 'The end time of the schedule.';
87+
Visible = false;
88+
ObsoleteReason = 'This field is moved to StatusGroup.';
89+
ObsoleteState = Pending;
90+
ObsoleteTag = '27.0';
7091

7192
trigger OnValidate()
7293
begin
7394
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDatesRelation(Rec);
7495
ScheduledPerfProfiler.ValidatePerformanceProfileEndTime(Rec);
7596
end;
7697
}
77-
field(Description; Rec.Description)
98+
#endif
99+
}
100+
group(StatusGroup)
101+
{
102+
Caption = 'Status';
103+
104+
field(Status; Status)
78105
{
79106
ApplicationArea = All;
80-
Caption = 'Description';
81-
ToolTip = 'Specifies the description of the schedule.';
82-
AboutText = 'The description of the schedule.';
107+
Caption = 'Status';
108+
ToolTip = 'Specifies the status of the schedule.';
109+
Editable = false;
110+
}
111+
field("Is Enabled"; Rec.Enabled)
112+
{
113+
ApplicationArea = All;
114+
Caption = 'Enabled';
115+
ToolTip = 'Specifies whether the schedule is enabled.';
83116

84117
trigger OnValidate()
85118
begin
86-
this.ValidateDescription();
119+
CurrPage.Update();
87120
end;
88121
}
89-
}
122+
field("Starting Date-Time"; Rec."Starting Date-Time")
123+
{
124+
ApplicationArea = All;
125+
Caption = 'Start Time';
126+
ToolTip = 'Specifies the start time of the schedule.';
127+
128+
trigger OnValidate()
129+
begin
130+
if Rec.Enabled then
131+
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDatesRelation(Rec);
132+
CurrPage.Update();
133+
end;
134+
}
135+
field("Ending Date-Time"; Rec."Ending Date-Time")
136+
{
137+
ApplicationArea = All;
138+
Caption = 'End Time';
139+
ToolTip = 'Specifies the end time of the schedule.';
140+
AboutText = 'The time at which the schedule will become automatically inactive.';
90141

142+
trigger OnValidate()
143+
begin
144+
if Rec.Enabled then
145+
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDatesRelation(Rec);
146+
ScheduledPerfProfiler.ValidatePerformanceProfileEndTime(Rec);
147+
CurrPage.Update();
148+
end;
149+
}
150+
}
91151
group(Filtering)
92152
{
93153
Caption = 'Filtering Criteria';
94-
AboutText = 'Filtering criteria for the profiler schedule.';
95-
154+
AboutText = 'Determines which activities will be profiled.';
155+
#if not CLEAN27
96156
field("User ID"; Rec."User ID")
97157
{
98158
ApplicationArea = All;
99159
Caption = 'User ID';
100160
ToolTip = 'Specifies the ID of the user associated with the schedule.';
101-
AboutText = 'The ID of the user associated with the schedule.';
102161
TableRelation = User."User Security ID";
103162
Lookup = true;
163+
Visible = false;
164+
ObsoleteReason = 'This field is obsolete. Use "User Name" instead.';
165+
ObsoleteState = Pending;
166+
ObsoleteTag = '27.0';
104167

105168
trigger OnValidate()
106169
begin
107170
ScheduledPerfProfiler.ValidateScheduleCreationPermissions(UserSecurityId(), Rec."User ID");
108171
end;
109172
}
173+
#endif
174+
field("User Name"; UserName)
175+
{
176+
ApplicationArea = All;
177+
Caption = 'User Name';
178+
ToolTip = 'Specifies the name of the user associated with the schedule.';
179+
AboutText = 'Only this user''s sessions will be profiled.';
180+
181+
trigger OnLookup(var Text: Text): Boolean
182+
var
183+
SelectedUser: Record User;
184+
UserSelection: Codeunit "User Selection";
185+
begin
186+
UserSelection.Open(SelectedUser);
187+
UserName := SelectedUser."User Name";
188+
Rec.Validate("User ID", SelectedUser."User Security ID");
189+
end;
190+
191+
trigger OnValidate()
192+
var
193+
User: Record User;
194+
begin
195+
User.SetRange("User Name", UserName);
196+
if User.FindFirst() then
197+
ScheduledPerfProfiler.ValidateScheduleCreationPermissions(UserSecurityId(), User."User Security ID");
198+
end;
199+
}
110200
field(Activity; Activity)
111201
{
112202
ApplicationArea = All;
113203
Caption = 'Activity Type';
114204
ToolTip = 'Specifies the type of activity for which the schedule is created.';
115-
AboutText = 'The type of activity for which the schedule is created.';
205+
AboutText = 'Only this type of session will be profiled.';
116206

117207
trigger OnValidate()
118208
begin
@@ -123,21 +213,18 @@ page 1932 "Perf. Profiler Schedule Card"
123213
group(Advanced)
124214
{
125215
Caption = 'Advanced Settings';
126-
AboutText = 'Advanced settings for the profiler schedule.';
127216

128217
field(Frequency; Rec.Frequency)
129218
{
130219
ApplicationArea = All;
131220
Caption = 'Sampling Frequency';
132221
ToolTip = 'Specifies the frequency at which the profiler will sample data.';
133-
AboutText = 'The frequency at which the profiler will sample data.';
134222
}
135223
field("Retention Policy"; RetentionPeriod)
136224
{
137225
ApplicationArea = All;
138226
Caption = 'Retention Period';
139227
ToolTip = 'Specifies the retention period of the profile.';
140-
AboutText = 'The retention period the profile will be kept.';
141228
Editable = false;
142229

143230
trigger OnDrillDown()
@@ -159,7 +246,6 @@ page 1932 "Perf. Profiler Schedule Card"
159246
ApplicationArea = All;
160247
Caption = 'Activity Duration Threshold (ms)';
161248
ToolTip = 'Specifies the minimum amount of time an activity must last in order to be recorded in a profile.';
162-
AboutText = 'Limit the amount of sampling profiles that are created by setting a millisecond threshold. Only activities that last longer then the threshold will be created.';
163249

164250
trigger OnValidate()
165251
begin
@@ -211,6 +297,8 @@ page 1932 "Perf. Profiler Schedule Card"
211297
ScheduledPerfProfiler.MapActivityTypeToRecord(Rec, Activity);
212298
RetentionPeriod := ScheduledPerfProfiler.GetRetentionPeriod();
213299
ProfileCreationThreshold := Rec."Profile Creation Threshold";
300+
Status := ScheduledPerfProfilerImpl.GetStatus(Rec);
301+
UserName := ScheduledPerfProfiler.MapRecordToUserName(Rec);
214302
end;
215303

216304
trigger OnModifyRecord(): Boolean
@@ -227,17 +315,21 @@ page 1932 "Perf. Profiler Schedule Card"
227315

228316
var
229317
ScheduledPerfProfiler: Codeunit "Scheduled Perf. Profiler";
318+
ScheduledPerfProfilerImpl: Codeunit "Scheduled Perf. Profiler Impl.";
230319
Activity: Enum "Perf. Profile Activity Type";
231320
ProfileCreationThreshold: BigInteger;
232321
RetentionPeriod: Code[20];
322+
Status: Text;
323+
UserName: Text;
233324
MaxRetentionPeriod: Duration;
234325
NoRetentionPolicySetupErr: Label 'No retention policy setup found for the performance profiles table.';
235326
CreateRetentionPolicySetupTxt: Label 'Create a retention policy setup';
236327
EmptyDescriptionErr: Label 'The description must be filled in.';
237328

238329
local procedure ValidateRecord()
239330
begin
240-
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDates(Rec, MaxRetentionPeriod);
331+
if Rec.Enabled then
332+
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDates(Rec, MaxRetentionPeriod);
241333
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerRecord(Rec, Activity);
242334
end;
243335

0 commit comments

Comments
 (0)