Profiling can be enabled by the wizard

This commit is contained in:
Daniele Teti 2024-04-24 17:03:05 +02:00
parent a4995177c6
commit 8e7e14151d
6 changed files with 21 additions and 24 deletions

View File

@ -904,7 +904,7 @@ begin
.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);')
@ -941,7 +941,7 @@ begin
.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;')

View File

@ -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

View File

@ -10,24 +10,24 @@ type
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.

View File

@ -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>
@ -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>
@ -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>
@ -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>
@ -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">
@ -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>

View File

@ -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>

View File

@ -112,8 +112,6 @@ var
lRQL: string;
lInstance: TMVCActiveRecord;
lMapping: TMVCFieldsMapping;
lConnection: TFDConnection;
lRQLBackend: string;
lProcessor: IMVCEntityProcessor;
lHandled: Boolean;
lARResp: TMVCActiveRecordList;
@ -142,12 +140,6 @@ begin
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