Skip to content

Commit

Permalink
Profiling can be enabled by the wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Apr 24, 2024
1 parent a499517 commit 8e7e141
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
4 changes: 2 additions & 2 deletions ideexpert/DMVC.Expert.CodeGen.Commands.pas
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ procedure TUnitMainBeginEndCommand.ExecuteImplementation(Section: TStringBuilder
.AppendLine(' WebRequestHandlerProc.MaxConnections := dotEnv.Env(''dmvc.handler.max_connections'', 1024);')
.AppendLine
.AppendLine('{$IF CompilerVersion >= 34} //SYDNEY+')
.AppendLine(' if dotEnv.Env(''dmvc.profiler.enabled'', false) then')
.AppendLine(' if dotEnv.Env(''dmvc.profiler.enabled'', ' + Model.S[TConfigKey.controller_actions_profiling_generate].ToLower + ') then')
.AppendLine(' begin')
.AppendLine(' Profiler.ProfileLogger := Log;')
.AppendLine(' Profiler.WarningThreshold := dotEnv.Env(''dmvc.profiler.warning_threshold'', 2000);')
Expand Down Expand Up @@ -941,7 +941,7 @@ procedure TUnitRunServerProcBody.ExecuteImplementation(Section: TStringBuilder;
.AppendLine(' try')
.AppendLine(' LServer.OnParseAuthentication := TMVCParseAuthentication.OnParseAuthentication;')
.AppendLine(' LServer.DefaultPort := APort;')
.AppendLine(' LServer.KeepAlive := True;')
.AppendLine(' LServer.KeepAlive := dotEnv.Env(''dmvc.indy.keep_alive'', True);')
.AppendLine(' LServer.MaxConnections := dotEnv.Env(''dmvc.webbroker.max_connections'', 0);')
.AppendLine(' LServer.ListenQueue := dotEnv.Env(''dmvc.indy.listen_queue'', 500);')
.AppendLine(' LServer.Active := True;')
Expand Down
2 changes: 1 addition & 1 deletion ideexpert/DMVC.Expert.Forms.NewProjectWizard.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ object frmDMVCNewProject: TfrmDMVCNewProject
Width = 276
Height = 26
Anchors = [akLeft, akTop, akRight]
Caption = 'Profiling Code (must be enabled system-wide in dpr)'
Caption = 'Actions Profiling'
TabOrder = 4
WordWrap = True
end
Expand Down
12 changes: 6 additions & 6 deletions samples/activerecord_restful_crud/OtherControllerU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ TOtherController = class(TMVCController)
public
[MVCPath]
[MVCHTTPMethods([httpGET])]
procedure GetSomethings;
function GetSomethings: String;
[MVCPath('/else')]
[MVCHTTPMethods([httpGET])]
procedure GetSomethingElse;
function GetSomethingElse: String;
end;

implementation

{ TCustomController }

procedure TOtherController.GetSomethingElse;
function TOtherController.GetSomethingElse: String;
begin
Render('Hello There, it''s "GetSomethingElse" here');
Result := 'Hello There, it''s "GetSomethingElse" here';
end;

procedure TOtherController.GetSomethings;
function TOtherController.GetSomethings: String;
begin
Render('Hello There, it''s "GetSomethings" here');
Result := 'Hello There, it''s "GetSomethings" here';
end;

end.
17 changes: 12 additions & 5 deletions samples/activerecord_restful_crud/activerecord_restful_crud.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<MainSource>activerecord_restful_crud.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>32897</TargetedPlatforms>
<TargetedPlatforms>32769</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>20.1</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<ProjectName Condition="'$(ProjectName)'==''">activerecord_restful_crud</ProjectName>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
Expand Down Expand Up @@ -149,12 +150,9 @@
<DesignClass>TWebModule</DesignClass>
</DCCReference>
<DCCReference Include="Entities.pas"/>
<DCCReference Include="..\..\sources\MVCFramework.ActiveRecordController.pas"/>
<DCCReference Include="..\..\sources\MVCFramework.ActiveRecord.pas"/>
<DCCReference Include="EntitiesProcessors.pas"/>
<DCCReference Include="..\activerecord_showcase\FDConnectionConfigU.pas"/>
<DCCReference Include="OtherControllerU.pas"/>
<DCCReference Include="..\..\sources\MVCFramework.SysControllers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
Expand All @@ -179,7 +177,6 @@
<Platforms>
<Platform value="Android">False</Platform>
<Platform value="Android64">True</Platform>
<Platform value="Linux64">True</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
Expand All @@ -200,6 +197,12 @@
</Platform>
</DeployFile>
<DeployFile LocalName="activerecord_restful_crud.exe" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="activerecord_restful_crud.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>activerecord_restful_crud.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
Expand Down Expand Up @@ -793,6 +796,9 @@
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64x">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
Expand Down Expand Up @@ -1054,6 +1060,7 @@
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64x" Name="$(PROJECTNAME)"/>
</Deployment>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
Expand Down
2 changes: 0 additions & 2 deletions samples/articles_crud_server/articles_crud_server.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@
<DCCReference Include="Services.pas"/>
<DCCReference Include="BusinessObjects.pas"/>
<DCCReference Include="Commons.pas"/>
<DCCReference Include="..\..\sources\MVCFramework.ActiveRecord.pas"/>
<DCCReference Include="..\..\sources\MVCFramework.Serializer.JsonDataObjects.pas"/>
<DCCReference Include="FDConnectionConfigU.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
Expand Down
8 changes: 0 additions & 8 deletions sources/MVCFramework.ActiveRecordController.pas
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ procedure TMVCActiveRecordController.GetEntities(const entityname: string);
lRQL: string;
lInstance: TMVCActiveRecord;
lMapping: TMVCFieldsMapping;
lConnection: TFDConnection;
lRQLBackend: string;
lProcessor: IMVCEntityProcessor;
lHandled: Boolean;
lARResp: TMVCActiveRecordList;
Expand Down Expand Up @@ -142,12 +140,6 @@ procedure TMVCActiveRecordController.GetEntities(const entityname: string);

lRQL := Context.Request.QueryStringParam('rql');
try
// if lRQL.IsEmpty then
// begin
// lRQL := Format('limit(0,%d)', [GetMaxRecordCount]);
// end;
lConnection := ActiveRecordConnectionsRegistry.GetCurrent;
lRQLBackend := GetBackEndByConnection(lConnection);
LogD('[RQL PARSE]: ' + lRQL);
lInstance := lARClassRef.Create(True);
try
Expand Down

0 comments on commit 8e7e141

Please sign in to comment.