Skip to content

Commit d22ca6e

Browse files
committed
v4.0 Release
2 parents 2fd4e1a + a7a91af commit d22ca6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1425
-799
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ jobs:
4444
node-version: 12.x
4545

4646
- name: Setup CommandBox
47-
uses: Ortus-Solutions/setup-commandbox@main
47+
uses: Ortus-Solutions/setup-commandbox@v2.0.1
4848
with:
4949
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
50-
version: 5.4.2
5150

5251
- name: Setup Environment Variables For Build Process
5352
id: current_version

.github/workflows/pr.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
name: Pull Requests
22

33
on:
4+
push:
5+
branches-ignore:
6+
- "main"
7+
- "master"
8+
- "development"
49
pull_request:
510
branches:
611
- development
712

813
jobs:
914
tests:
10-
uses: coldbox-modules/cbdebugger/.github/workflows/tests.yml@development
15+
uses: ./.github/workflows/tests.yml
1116

1217
# Format PR
1318
format:

.github/workflows/tests.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
workflow_call:
66
secrets:
77
SLACK_WEBHOOK_URL:
8-
required: true
8+
required: false
99

1010
jobs:
1111
tests:
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
cfengine: [ "lucee@5", "adobe@2016", "adobe@2018", "adobe@2021" ]
20+
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ]
2121
steps:
2222
- name: Checkout Repository
2323
uses: actions/checkout@v2
@@ -50,9 +50,7 @@ jobs:
5050
printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
5151
5252
- name: Setup CommandBox CLI
53-
uses: Ortus-Solutions/setup-commandbox@main
54-
with:
55-
version: 5.4.2
53+
uses: Ortus-Solutions/[email protected]
5654

5755
- name: Install Dependencies
5856
run: |
@@ -62,10 +60,6 @@ jobs:
6260
- name: Start ${{ matrix.cfengine }} Server
6361
run: |
6462
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
65-
# Install Adobe 2021 cfpm modules
66-
if [[ "${{ matrix.cfengine }}" == "adobe@2021" ]] ; then
67-
box run-script install:2021
68-
fi
6963
curl http://127.0.0.1:60299
7064
7165
- name: Run Tests

ModuleConfig.cfc

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ component {
77

88
// Module Properties
99
this.title = "ColdBox Debugger";
10-
this.author = "Curt Gratz - Ortus Solutions";
10+
this.author = "Ortus Solutions";
1111
this.version = "@build.version@[email protected]@";
1212
this.webURL = "https://www.ortussolutions.com";
1313
this.description = "The ColdBox Debugger Module";
@@ -45,8 +45,8 @@ component {
4545
requestPanelDock : true,
4646
// Request Tracker Options
4747
requestTracker : {
48-
// Store the request profilers in heap memory or in cachebox, default is cachebox
49-
storage : "cachebox",
48+
// Store the request profilers in heap memory or in cachebox, default is memory
49+
storage : "memory",
5050
// Which cache region to store the profilers in
5151
cacheName : "template",
5252
// Track all cbdebugger events, by default this is off, turn on, when actually profiling yourself :) How Meta!
@@ -140,6 +140,10 @@ component {
140140
"beforeProfilerReportPanels",
141141
// After any individual profiler report panels are rendered
142142
"afterProfilerReportPanels",
143+
// Fires after the module has fully loaded and been configured with all runtime settings
144+
"onDebuggerLoad",
145+
// Fires after the module is unloaded
146+
"onDebuggerUnload",
143147
// When the request tracker has been created and placed in request scope
144148
"onDebuggerRequestTrackerCreation",
145149
// Before the request tracker is saved in the profiler, last chance to influence the recording
@@ -161,16 +165,16 @@ component {
161165
function onLoad(){
162166
// Only activate interceptions and collectors if master switch is on or in test mode disable it
163167
if ( variables.settings.enabled ) {
168+
var interceptorService = controller.getInterceptorService();
169+
164170
/******************** REQUEST COLLECTOR ************************************/
165171

166-
controller
167-
.getInterceptorService()
168-
.registerInterceptor(
169-
interceptorClass = "#moduleMapping#.interceptors.RequestCollector",
170-
interceptorName = "RequestCollector@cbdebugger"
171-
);
172+
interceptorService.registerInterceptor(
173+
interceptorClass = "#moduleMapping#.interceptors.RequestCollector",
174+
interceptorName = "RequestCollector@cbdebugger"
175+
);
172176

173-
/******************** PROFILE OBJECTS ************************************/
177+
/******************** OBJECT PROFILING ************************************/
174178

175179
if ( variables.settings.requestTracker.profileObjects ) {
176180
// Object Profiler Aspect
@@ -192,6 +196,15 @@ component {
192196
);
193197
}
194198

199+
/******************** WIREBOX COLLECTOR ************************************/
200+
201+
if ( variables.settings.requestTracker.profileWireBoxObjectCreation ) {
202+
interceptorService.registerInterceptor(
203+
interceptorClass = "#moduleMapping#.interceptors.WireBoxCollector",
204+
interceptorName = "WireBoxCollector@cbdebugger"
205+
);
206+
}
207+
195208
/******************** PROFILE INTERCEPTIONS ************************************/
196209

197210
if ( variables.settings.requestTracker.profileInterceptions ) {
@@ -223,51 +236,43 @@ component {
223236
/******************** QB COLLECTOR ************************************/
224237

225238
if ( variables.settings.qb.enabled && controller.getModuleService().isModuleRegistered( "qb" ) ) {
226-
controller
227-
.getInterceptorService()
228-
.registerInterceptor(
229-
interceptorClass = "#moduleMapping#.interceptors.QBCollector",
230-
interceptorName = "QBCollector@cbdebugger"
231-
);
239+
interceptorService.registerInterceptor(
240+
interceptorClass = "#moduleMapping#.interceptors.QBCollector",
241+
interceptorName = "QBCollector@cbdebugger"
242+
);
232243
}
233244

234245
/******************** QUICK COLLECTOR ************************************/
235246

236247
if ( variables.settings.qb.enabled && controller.getModuleService().isModuleRegistered( "quick" ) ) {
237-
controller
238-
.getInterceptorService()
239-
.registerInterceptor(
240-
interceptorClass = "#moduleMapping#.interceptors.QuickCollector",
241-
interceptorName = "QuickCollector@cbdebugger"
242-
);
248+
interceptorService.registerInterceptor(
249+
interceptorClass = "#moduleMapping#.interceptors.QuickCollector",
250+
interceptorName = "QuickCollector@cbdebugger"
251+
);
243252
}
244253

245254
/******************** CBORM COLLECTOR ************************************/
246255

247256
if ( variables.settings.cborm.enabled && controller.getModuleService().isModuleRegistered( "cborm" ) ) {
248-
controller
249-
.getInterceptorService()
250-
.registerInterceptor(
251-
interceptorClass = "#moduleMapping#.interceptors.CBOrmCollector",
252-
interceptorName = "CBOrmCollector@cbdebugger"
253-
);
257+
interceptorService.registerInterceptor(
258+
interceptorClass = "#moduleMapping#.interceptors.CBOrmCollector",
259+
interceptorName = "CBOrmCollector@cbdebugger"
260+
);
254261
}
255262

256263
/******************** ACFSQL COLLECTOR ************************************/
257264

258-
// Do not load on lucee or ACF 2016
259-
if (
260-
variables.settings.acfSql.enabled && !server.keyExists( "lucee" ) && server.coldfusion.productVersion.listFirst() gt "2016"
261-
) {
262-
controller
263-
.getInterceptorService()
264-
.registerInterceptor(
265-
interceptorClass = "#moduleMapping#.interceptors.ACFSqlCollector",
266-
interceptorName = "ACFSqlCollector@cbdebugger"
267-
);
265+
if ( variables.settings.acfSql.enabled && !server.keyExists( "lucee" ) ) {
266+
interceptorService.registerInterceptor(
267+
interceptorClass = "#moduleMapping#.interceptors.ACFSqlCollector",
268+
interceptorName = "ACFSqlCollector@cbdebugger"
269+
);
268270
} else {
269271
variables.settings.acfSql.enabled = false;
270272
}
273+
274+
// Announce debugger loaded
275+
interceptorService.announce( "onDebuggerLoad" );
271276
}
272277
// end master switch
273278
}
@@ -278,11 +283,15 @@ component {
278283
function onUnload(){
279284
// Only if we are enabled
280285
if ( variables.settings.enabled ) {
281-
controller.getInterceptorService().unregister( "RequestCollector@cbdebugger" );
282-
controller.getInterceptorService().unregister( "QBCollector@cbdebugger" );
283-
controller.getInterceptorService().unregister( "QuickCollector@cbdebugger" );
284-
controller.getInterceptorService().unregister( "CBOrmCollector@cbdebugger" );
285-
controller.getInterceptorService().unregister( "ACFSqlCollector@cbdebugger" );
286+
var interceptorService = controller.getInterceptorService();
287+
288+
interceptorService.announce( "onDebuggerUnload" );
289+
interceptorService.unregister( "RequestCollector@cbdebugger" );
290+
interceptorService.unregister( "WireBoxCollector@cbdebugger" );
291+
interceptorService.unregister( "QBCollector@cbdebugger" );
292+
interceptorService.unregister( "QuickCollector@cbdebugger" );
293+
interceptorService.unregister( "CBOrmCollector@cbdebugger" );
294+
interceptorService.unregister( "ACFSqlCollector@cbdebugger" );
286295
}
287296
}
288297

aspects/InterceptorProfiler.cfc

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ component implements="coldbox.system.aop.MethodInterceptor" accessors="true" {
1313
/**
1414
* Constructor
1515
*/
16-
function init(
17-
required excludedInterceptions,
18-
required includedInterceptions
19-
){
16+
function init( required excludedInterceptions, required includedInterceptions ){
2017
variables.excludedInterceptions = arguments.excludedInterceptions;
2118
variables.includedInterceptions = arguments.includedInterceptions;
2219
return this;
@@ -26,9 +23,8 @@ component implements="coldbox.system.aop.MethodInterceptor" accessors="true" {
2623
* The AOP method invocation
2724
*/
2825
any function invokeMethod( required invocation ){
29-
3026
// Quick exit check: If no included interceptions, just bail
31-
if( !arrayLen( variables.includedInterceptions ) ){
27+
if ( !arrayLen( variables.includedInterceptions ) ) {
3228
return arguments.invocation.proceed();
3329
}
3430

@@ -44,10 +40,7 @@ component implements="coldbox.system.aop.MethodInterceptor" accessors="true" {
4440

4541
// Do we need to profile it or not?
4642
if (
47-
arrayContainsNoCase(
48-
variables.excludedInterceptions,
49-
state
50-
) && !arrayContainsNoCase(
43+
arrayContainsNoCase( variables.excludedInterceptions, state ) && !arrayContainsNoCase(
5144
variables.includedInterceptions,
5245
state
5346
)
@@ -66,16 +59,16 @@ component implements="coldbox.system.aop.MethodInterceptor" accessors="true" {
6659
}
6760

6861
// Is this an entity interception? If so, log it to assist
69-
if( data.keyExists( "entity" ) ){
70-
txName &= "( #getEntityName( data )# )";
62+
if ( data.keyExists( "entity" ) ) {
63+
txName &= "( #getEntityName( data )# ) @ #getTickCount()#";
7164
}
7265

7366
// create FR tx with method name
74-
var labelHash = variables.timerService.start( txName );
67+
variables.timerService.start( label: txName, type: "interceptor" );
7568
// proceed invocation
76-
var results = arguments.invocation.proceed();
69+
var results = arguments.invocation.proceed();
7770
// close tx
78-
variables.timerService.stop( labelhash );
71+
variables.timerService.stop( txName );
7972
// return results
8073
if ( !isNull( results ) ) {
8174
return results;
@@ -87,12 +80,12 @@ component implements="coldbox.system.aop.MethodInterceptor" accessors="true" {
8780
*/
8881
private string function getEntityName( required data ){
8982
// If passed, just relay it back
90-
if( arguments.data.keyExists( "entityName" ) ){
83+
if ( arguments.data.keyExists( "entityName" ) ) {
9184
return arguments.data.entityName;
9285
}
9386

9487
// Check if we have a quick entity
95-
if( structKeyExists( arguments.data.entity, "mappingName" ) ){
88+
if ( structKeyExists( arguments.data.entity, "mappingName" ) ) {
9689
return arguments.data.entity.mappingName();
9790
}
9891

aspects/ObjectProfiler.cfc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ component implements="coldbox.system.aop.MethodInterceptor" accessors="true" {
2424
*/
2525
any function invokeMethod( required invocation ) output=false{
2626
// default tx name
27-
var txName = "[Object Profiler] #arguments.invocation.getTargetName()#.#arguments.invocation.getMethod()#()";
27+
var txName = "[Object Profiler] #arguments.invocation.getTargetName()#.#arguments.invocation.getMethod()#()";
28+
var targetMapping = arguments.invocation.getTargetMapping();
2829

2930
// check metadata for tx name if they desire to influence the label
3031
var methodMD = arguments.invocation.getMethodMetadata();
@@ -33,13 +34,22 @@ component implements="coldbox.system.aop.MethodInterceptor" accessors="true" {
3334
}
3435

3536
// create with method name
36-
var labelhash = variables.timerService.start( txName );
37+
variables.timerService.start(
38+
label : txName,
39+
metadata: {
40+
path : targetMapping.getObjectMetadata()?.path ?: targetMapping.getPath(),
41+
name : targetMapping.getName(),
42+
type : targetMapping.getType(),
43+
line : methodMD.keyExists( "position" ) ? methodMD.position.start : 1
44+
},
45+
type: "object-profiler"
46+
);
3747

3848
// proceed invocation
3949
var results = arguments.invocation.proceed();
4050

4151
// Stop the timer
42-
variables.timerService.stop( labelhash );
52+
variables.timerService.stop( txName );
4353

4454
// return results
4555
if ( !isNull( results ) ) {

box.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name":"ColdBox Debugger",
33
"author":"Ortus Solutions <[email protected]",
44
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbdebugger/@build.version@/[email protected]@.zip",
5-
"version":"3.5.0",
5+
"version":"3.6.0",
66
"slug":"cbdebugger",
77
"type":"modules",
88
"homepage":"https://github.com/coldbox-modules/cbdebugger",
@@ -55,20 +55,14 @@
5555
"format":"cfformat run appenders,aspects,handlers,interceptors,models,test-harness/tests/**.cfc,ModuleConfig.cfc --overwrite",
5656
"format:watch":"cfformat watch appenders,aspects,handlers,interceptors,models,test-harness/tests/**.cfc,ModuleConfig.cfc ./.cfformat.json",
5757
"format:check":"cfformat check appenders,aspects,handlers,interceptors,models,test-harness/tests/**.cfc,ModuleConfig.cfc",
58-
"cfpm":"echo '\".engine/adobe2021/WEB-INF/cfusion/bin/cfpm.sh\"' | run",
59-
"cfpm:install":"echo '\".engine/adobe2021/WEB-INF/cfusion/bin/cfpm.sh\" install ${1}' | run",
60-
"install:2021":"run-script cfpm:install zip,debugger,orm,mysql,postgresql,sqlserver,feed",
6158
"install:dependencies":"install && cd test-harness && install",
6259
"start:lucee":"server start [email protected]",
63-
"start:2016":"server start [email protected]",
6460
"start:2018":"server start [email protected]",
6561
"start:2021":"server start [email protected]",
6662
"stop:lucee":"server stop name=cbdebugger-lucee@5",
67-
"stop:2016":"server stop name=cbdebugger-adobe@2016",
6863
"stop:2018":"server stop name=cbdebugger-adobe@2018",
6964
"stop:2021":"server stop name=cbdebugger-adobe@2021",
7065
"logs:lucee":"server log name=cbdebugger-lucee@5 --follow",
71-
"logs:2016":"server log name=cbdebugger-adobe@2016 --follow",
7266
"logs:2018":"server log name=cbdebugger-adobe@2018 --follow",
7367
"logs:2021":"server log name=cbdebugger-adobe@2021 --follow"
7468
},

build/.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ env:
1010
- MODULE_ID=cbdebugger
1111
matrix:
1212
- ENGINE=lucee@5
13-
- ENGINE=adobe@2016
1413
- ENGINE=adobe@2018
1514

1615
branches:

0 commit comments

Comments
 (0)