diff --git a/Application.cfc b/Application.cfc index 1fab06b..f090035 100644 --- a/Application.cfc +++ b/Application.cfc @@ -44,7 +44,7 @@ request.adminType = "web"; try { request.singleMode = getConfigSettings().mode == "single"; - if ( request.singleMode) + if (request.singleMode) request.adminType="server"; } catch (e){ // lucee 6.0 only diff --git a/box.json b/box.json index fcadd33..0d95566 100644 --- a/box.json +++ b/box.json @@ -1,7 +1,7 @@ { "name":"Lucee Performance Analyzer", "author":"Zac Spitzer", - "version":"2.1.1.0", + "version":"2.1.1.1", "bugs":"https://github.com/zspitzer/lucee-performance-analyzer/issues", "thumbnail": "https://raw.githubusercontent.com/zspitzer/lucee-performance-analyzer/master/build/images/logo.png", "changelog":"", diff --git a/dist/extension-PerformanceAnalyzer-2.1.1.0.lex b/dist/extension-PerformanceAnalyzer-2.1.1.1.lex similarity index 76% rename from dist/extension-PerformanceAnalyzer-2.1.1.0.lex rename to dist/extension-PerformanceAnalyzer-2.1.1.1.lex index 508e768..c064194 100644 Binary files a/dist/extension-PerformanceAnalyzer-2.1.1.0.lex and b/dist/extension-PerformanceAnalyzer-2.1.1.1.lex differ diff --git a/source/cfml/plugins/css/style.css b/source/cfml/plugins/css/style.css index 215be60..0a37fd9 100644 --- a/source/cfml/plugins/css/style.css +++ b/source/cfml/plugins/css/style.css @@ -16,7 +16,7 @@ td, th { padding: 4 4 4 4; vertical-align:top; } -th {/* like .tblHead */ +th, .maintbl th {/* like .tblHead */ background-color:#39c; /* ABC */ color:#efede5; font-weight:normal; @@ -89,3 +89,15 @@ a { .header { padding-bottom:12px; } + +.statusCode-4, .statusCode-5, .statusCode-6{ + background-color: red; + color: white; +} + +.statusCode-1, .statusCode-2 { + /*normal */ +} +.statusCode-3 { + background-color: yellow; +} \ No newline at end of file diff --git a/source/cfml/plugins/footer.cfm b/source/cfml/plugins/footer.cfm index a3362f7..de3ecf0 100644 --- a/source/cfml/plugins/footer.cfm +++ b/source/cfml/plugins/footer.cfm @@ -8,7 +8,10 @@
-

This report is based on all the debugging logs currently in memory ( #this.perf.getRawLogCount()# logs, #this.perf.getDebugMemUsage()# ) click column headers to sort

+

This report is based on all the debugging logs currently in memory ( #this.perf.getRawLogCount()# logs, #this.perf.getDebugMemUsage()# ) + click column headers to sort + +

select template, lines, min(_min) as minTime, max(_max) as maxTime, avg(_avg) as avgTime, sum(total) as totalTime, sum(_count) as totalCount, - sum(total) as total, count(*) as executions, snippet + sum(total) as total, count(*) as executions, snippet, start, _end from q_parts - group by template, lines, snippet + group by template, lines, snippet, start, _end order by totalTime desc ``` @@ -490,7 +490,7 @@ component { } public struct function getDebugLogs( required array logs ){ - var q = QueryNew( "template,requestUrl,path,total,query,load,app,scope,exceptions,starttime,id,size,isThread" ); + var q = QueryNew( "template,requestUrl,path,total,query,load,app,scope,exceptions,starttime,id,size,isThread,statusCode,ContentType,ContentLength" ); local.totals = { app = 0, query: 0, @@ -539,20 +539,27 @@ component { local.r = QueryAddRow( q ); - QuerySetCell( local.q, "size", log.size, local.r); - QuerySetCell( local.q, "id", log.id, local.r); - QuerySetCell( local.q, "starttime", log.starttime, local.r); - QuerySetCell( local.q, "template", local.cgi.script_name, local.r); - QuerySetCell( local.q, "path", path, local.r); - QuerySetCell( local.q, "total", _total, local.r); - QuerySetCell( local.q, "query", _query, local.r); - QuerySetCell( local.q, "load", _load, local.r); - QuerySetCell( local.q, "app", _app, local.r); - QuerySetCell( local.q, "scope", _scope, local.r); - QuerySetCell( local.q, "exceptions", _exp, local.r); + QuerySetCell( local.q, "size", log.size, local.r ); + QuerySetCell( local.q, "id", log.id, local.r ); + QuerySetCell( local.q, "starttime", log.starttime, local.r ); + QuerySetCell( local.q, "template", local.cgi.script_name, local.r ); + QuerySetCell( local.q, "path", path, local.r ); + QuerySetCell( local.q, "total", _total, local.r ); + QuerySetCell( local.q, "query", _query, local.r ); + QuerySetCell( local.q, "load", _load, local.r ); + QuerySetCell( local.q, "app", _app, local.r ); + QuerySetCell( local.q, "scope", _scope, local.r ); + QuerySetCell( local.q, "exceptions", _exp, local.r ); QuerySetCell( local.q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); QuerySetCell( local.q, "isThread", ( Len( local.log.scope.cgi.HTTP_USER_AGENT ) eq 0 ), local.r ); + if ( StructKeyExists( log, "statusCode" ) ) + QuerySetCell( local.q, "statusCode", log.statusCode, local.r ); + if ( StructKeyExists( log, "ContentType" ) ) + QuerySetCell( local.q, "ContentType", log.ContentType, local.r ); + if ( StructKeyExists( log, "ContentLength" ) ) + QuerySetCell( local.q, "ContentLength", log.ContentLength, local.r ); + local.totals.size += + local.log.size / 1000; local.totals.app += _app; local.totals.query += _query; diff --git a/source/cfml/plugins/requests.cfm b/source/cfml/plugins/requests.cfm index 0431d51..69cfb30 100644 --- a/source/cfml/plugins/requests.cfm +++ b/source/cfml/plugins/requests.cfm @@ -28,6 +28,7 @@ #renderRequestLink( arguments.req, local.q.path, local.q.id )# (thread) + #listFirst(local.q.statusCode," ")# By Url @@ -45,7 +46,7 @@ #prettyTime( local.q.load )# #prettyNum( local.q.scope )# #prettyNum( local.q.exceptions )# - #prettyNum( local.q.size / 1000 )# + #prettyNum( local.q.size / 1000 )#
@@ -54,7 +55,7 @@ - Totals + Totals #prettyTime( local.logs.totals.total )# #prettyTime( local.logs.totals.app )# @@ -62,7 +63,7 @@ #prettyTime( local.logs.totals.load )# #prettyNum( local.logs.totals.scope )# #prettyNum( local.logs.totals.exceptions )# - #prettyNum( local.logs.totals.size )# + #prettyNum( local.logs.totals.size )# @@ -71,6 +72,7 @@ Url + Code Filter Timestamp Total @@ -79,7 +81,7 @@ Load Scope Problems Exceptions - Size (Kb) + Log Size #totals# diff --git a/source/cfml/plugins/settings.cfm b/source/cfml/plugins/settings.cfm index 6eedd28..f6b9009 100644 --- a/source/cfml/plugins/settings.cfm +++ b/source/cfml/plugins/settings.cfm @@ -114,4 +114,8 @@ + +

+ Please consider making a donation / supporting the Lucee project, so we can make Lucee even better! +

\ No newline at end of file diff --git a/source/cfml/plugins/toolbar.cfm b/source/cfml/plugins/toolbar.cfm index b980187..6b07bbe 100644 --- a/source/cfml/plugins/toolbar.cfm +++ b/source/cfml/plugins/toolbar.cfm @@ -5,7 +5,7 @@ variables.template = arguments.req.template; variables.req = arguments.req; - local.reports = ["Requests", "Templates", "Scopes", "Queries", "Timers", "Exceptions", "Dumps", "Aborts", "Traces", "Memory", "Threads", "Settings"]; + local.reports = ["Requests", "Templates", "Scopes", "Queries", "Timers", "Exceptions", "Dumps", "Aborts", "Traces", "Parts", "Memory", "Threads", "Settings"]; //if ( Len( arguments.req.template ) || Len( arguments.req.url ) || Len( arguments.req.log ) ) ArrayPrepend(local.reports, "Analysis"); local.path_reports = ["Requests", "Templates", "Scopes", "Queries", "Timers", "Exceptions", "Dumps", "Aborts", "Traces", "Parts"]; @@ -108,8 +108,41 @@ - Url: #encodeForHtml( singleLog.scope.cgi.request_url )#
- User-Agent: Empty, probably a Lucee thread#encodeForHtml(singleLog.scope.cgi.http_user_agent)#
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Url#encodeForHtml( singleLog.scope.cgi.request_url )#
Http Referer#encodeForHtml( singleLog.scope.cgi.http_referer )#
User-AgentEmpty, probably a Lucee thread#encodeForHtml(singleLog.scope.cgi.http_user_agent)#
Status-Code#listFirst(singleLog.statusCode," ")#
Content-Type#singleLog.contentType#
Content-Length#singleLog.contentLength#
Log not found?