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

Profile schedules UX improvements #3274

Merged
merged 4 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/System Application/App/Performance Profiler/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
"name": "System Initialization",
"publisher": "Microsoft",
"version": "27.0.0.0"
},
{
"id": "7f850a76-a58c-4ade-a14f-7d7acff97115",
"name": "User Selection",
"publisher": "Microsoft",
"version": "27.0.0.0"
}
],
"internalsVisibleTo": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ enum 1932 "Perf. Profile Activity Type"
/// </summary>
value(0; "Web Client")
{
Caption = 'Activity in the browser';
Caption = 'Activities in the browser';
}

/// <summary>
/// The background activity type
/// </summary>
value(1; "Background")
{
Caption = 'Background Tasks';
Caption = 'Background tasks (incl. job queues)';
}

/// <summary>
/// The web api activity type
/// </summary>
value(2; "Web API Client")
{
Caption = 'Web Service Calls';
Caption = 'Web service calls';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace System.Tooling;
using System.PerformanceProfile;
using System.Security.AccessControl;
using System.DataAdministration;
using System.Security.User;

/// <summary>
/// Card page for schedule based sampling profilers
Expand All @@ -30,31 +31,47 @@ page 1932 "Perf. Profiler Schedule Card"
group(General)
{
Caption = 'General';
AboutText = 'General information about the profiler schedule.';
AboutTitle = 'General information';

field(Description; Rec.Description)
{
ApplicationArea = All;
Caption = 'Description';
ToolTip = 'Specifies the description of the schedule.';

trigger OnValidate()
begin
this.ValidateDescription();
end;
}
field("Schedule ID"; Rec."Schedule ID")
{
ApplicationArea = All;
Caption = 'Schedule ID';
ToolTip = 'Specifies the ID of the schedule.';
AboutText = 'The ID of the schedule.';
Editable = false;
Visible = false;
}
#if not CLEAN27
field(Enabled; Rec.Enabled)
{
ApplicationArea = All;
Caption = 'Enabled';
ToolTip = 'Specifies whether the schedule is enabled.';
AboutText = 'Specifies whether the schedule is enabled.';
Visible = false;
ObsoleteReason = 'This field is moved to StatusGroup.';
ObsoleteState = Pending;
ObsoleteTag = '27.0';
}
field("Start Time"; Rec."Starting Date-Time")
{
ApplicationArea = All;
Caption = 'Start Time';
ToolTip = 'Specifies the start time of the schedule.';
AboutText = 'The start time of the schedule.';
Visible = false;
ObsoleteReason = 'This field is moved to StatusGroup.';
ObsoleteState = Pending;
ObsoleteTag = '27.0';

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

trigger OnValidate()
begin
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDatesRelation(Rec);
ScheduledPerfProfiler.ValidatePerformanceProfileEndTime(Rec);
end;
}
field(Description; Rec.Description)
#endif
}
group(StatusGroup)
{
Caption = 'Status';

field(Status; Status)
{
ApplicationArea = All;
Caption = 'Description';
ToolTip = 'Specifies the description of the schedule.';
AboutText = 'The description of the schedule.';
Caption = 'Status';
ToolTip = 'Specifies the status of the schedule.';
Editable = false;
}
field("Is Enabled"; Rec.Enabled)
{
ApplicationArea = All;
Caption = 'Enabled';
ToolTip = 'Specifies whether the schedule is enabled.';

trigger OnValidate()
begin
this.ValidateDescription();
CurrPage.Update();
end;
}
}
field("Starting Date-Time"; Rec."Starting Date-Time")
{
ApplicationArea = All;
Caption = 'Start Time';
ToolTip = 'Specifies the start time of the schedule.';

trigger OnValidate()
begin
if Rec.Enabled then
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDatesRelation(Rec);
CurrPage.Update();
end;
}
field("Ending Date-Time"; Rec."Ending Date-Time")
{
ApplicationArea = All;
Caption = 'End Time';
ToolTip = 'Specifies the end time of the schedule.';
AboutText = 'The time at which the schedule will become automatically inactive.';

trigger OnValidate()
begin
if Rec.Enabled then
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDatesRelation(Rec);
ScheduledPerfProfiler.ValidatePerformanceProfileEndTime(Rec);
CurrPage.Update();
end;
}
}
group(Filtering)
{
Caption = 'Filtering Criteria';
AboutText = 'Filtering criteria for the profiler schedule.';

AboutText = 'Determines which activities will be profiled.';
#if not CLEAN27
field("User ID"; Rec."User ID")
{
ApplicationArea = All;
Caption = 'User ID';
ToolTip = 'Specifies the ID of the user associated with the schedule.';
AboutText = 'The ID of the user associated with the schedule.';
TableRelation = User."User Security ID";
Lookup = true;
Visible = false;
ObsoleteReason = 'This field is obsolete. Use "User Name" instead.';
ObsoleteState = Pending;
ObsoleteTag = '27.0';

trigger OnValidate()
begin
ScheduledPerfProfiler.ValidateScheduleCreationPermissions(UserSecurityId(), Rec."User ID");
end;
}
#endif
field("User Name"; UserName)
{
ApplicationArea = All;
Caption = 'User Name';
ToolTip = 'Specifies the name of the user associated with the schedule.';
AboutText = 'Only this user''s sessions will be profiled.';

trigger OnLookup(var Text: Text): Boolean
var
SelectedUser: Record User;
UserSelection: Codeunit "User Selection";
begin
UserSelection.Open(SelectedUser);
UserName := SelectedUser."User Name";
Rec.Validate("User ID", SelectedUser."User Security ID");
end;

trigger OnValidate()
var
User: Record User;
begin
User.SetRange("User Name", UserName);
if User.FindFirst() then
ScheduledPerfProfiler.ValidateScheduleCreationPermissions(UserSecurityId(), User."User Security ID");
end;
}
field(Activity; Activity)
{
ApplicationArea = All;
Caption = 'Activity Type';
ToolTip = 'Specifies the type of activity for which the schedule is created.';
AboutText = 'The type of activity for which the schedule is created.';
AboutText = 'Only this type of session will be profiled.';

trigger OnValidate()
begin
Expand All @@ -123,21 +213,18 @@ page 1932 "Perf. Profiler Schedule Card"
group(Advanced)
{
Caption = 'Advanced Settings';
AboutText = 'Advanced settings for the profiler schedule.';

field(Frequency; Rec.Frequency)
{
ApplicationArea = All;
Caption = 'Sampling Frequency';
ToolTip = 'Specifies the frequency at which the profiler will sample data.';
AboutText = 'The frequency at which the profiler will sample data.';
}
field("Retention Policy"; RetentionPeriod)
{
ApplicationArea = All;
Caption = 'Retention Period';
ToolTip = 'Specifies the retention period of the profile.';
AboutText = 'The retention period the profile will be kept.';
Editable = false;

trigger OnDrillDown()
Expand All @@ -159,7 +246,6 @@ page 1932 "Perf. Profiler Schedule Card"
ApplicationArea = All;
Caption = 'Activity Duration Threshold (ms)';
ToolTip = 'Specifies the minimum amount of time an activity must last in order to be recorded in a profile.';
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.';

trigger OnValidate()
begin
Expand Down Expand Up @@ -211,6 +297,8 @@ page 1932 "Perf. Profiler Schedule Card"
ScheduledPerfProfiler.MapActivityTypeToRecord(Rec, Activity);
RetentionPeriod := ScheduledPerfProfiler.GetRetentionPeriod();
ProfileCreationThreshold := Rec."Profile Creation Threshold";
Status := ScheduledPerfProfilerImpl.GetStatus(Rec);
UserName := ScheduledPerfProfiler.MapRecordToUserName(Rec);
end;

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

var
ScheduledPerfProfiler: Codeunit "Scheduled Perf. Profiler";
ScheduledPerfProfilerImpl: Codeunit "Scheduled Perf. Profiler Impl.";
Activity: Enum "Perf. Profile Activity Type";
ProfileCreationThreshold: BigInteger;
RetentionPeriod: Code[20];
Status: Text;
UserName: Text;
MaxRetentionPeriod: Duration;
NoRetentionPolicySetupErr: Label 'No retention policy setup found for the performance profiles table.';
CreateRetentionPolicySetupTxt: Label 'Create a retention policy setup';
EmptyDescriptionErr: Label 'The description must be filled in.';

local procedure ValidateRecord()
begin
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDates(Rec, MaxRetentionPeriod);
if Rec.Enabled then
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerDates(Rec, MaxRetentionPeriod);
ScheduledPerfProfiler.ValidatePerformanceProfileSchedulerRecord(Rec, Activity);
end;

Expand Down
Loading
Loading