├── .gitignore ├── source └── cfml │ └── plugins │ ├── overview.cfm │ ├── analysis.cfm │ ├── language.xml │ ├── getLang.cfm │ ├── .vscode │ └── settings.json │ ├── scopes.cfm │ ├── related.cfm │ ├── footer.cfm │ ├── queries.cfm │ ├── aborts.cfm │ ├── dumps.cfm │ ├── parts.cfm │ ├── exceptions.cfm │ ├── traces.cfm │ ├── contextSelector.cfm │ ├── timers.cfm │ ├── css │ └── style.css │ ├── Action.cfc │ ├── applications.cfm │ ├── memory.cfm │ ├── templates.cfm │ ├── settings.cfm │ ├── requests.cfm │ ├── threads.cfm │ ├── renderUtils.cfc │ ├── js │ ├── perf.js │ └── jquery-3.6.0.slim.min.js │ ├── toolbar.cfm │ └── perf.cfc ├── dist └── extension-PerformanceAnalyzer-2.1.1.1.lex ├── server.json ├── .vscode └── settings.json ├── login.cfm ├── box.json ├── index.cfm ├── Application.cfc ├── README.md ├── add-lgpl-header.xml └── License.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | *.iml 3 | -------------------------------------------------------------------------------- /source/cfml/plugins/overview.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/cfml/plugins/analysis.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | setTitle( "Analysis" ); 4 | cfinclude(template="related.cfm"); 5 | 6 | -------------------------------------------------------------------------------- /dist/extension-PerformanceAnalyzer-2.1.1.1.lex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zspitzer/lucee-performance-analyzer/HEAD/dist/extension-PerformanceAnalyzer-2.1.1.1.lex -------------------------------------------------------------------------------- /source/cfml/plugins/language.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Performance 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/cfml/plugins/getLang.cfm: -------------------------------------------------------------------------------- 1 | 2 | var pluginLanguage = { 3 | strings: arguments.lang, 4 | locale: session.LUCEE_ADMIN_LANG 5 | }; 6 | setting showdebugoutput="false"; 7 | content type="text/javascript" reset="yes"; 8 | echo ('var pluginLanguage = #serializeJson( pluginLanguage )#;'); 9 | abort; 10 | -------------------------------------------------------------------------------- /server.json: -------------------------------------------------------------------------------- 1 | { 2 | "jvm":{ 3 | "args":"-Djava.net.useSystemProxies=true" 4 | }, 5 | "app":{ 6 | "cfengine":"lucee@5.3.8-SNAPSHOT+162", 7 | "serverHomeDirectory":"../lucee-perf-analzyer-server" 8 | }, 9 | "http":{ 10 | "port":49215 11 | }, 12 | "openBrowserURL":"http://perf-analyzer.localhost:49215/index.cfm" 13 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "Gert", 4 | "Klinkenberg" 5 | ], 6 | "workbench.colorCustomizations": { 7 | "activityBar.background": "#28301F", 8 | "titleBar.activeBackground": "#38432B", 9 | "titleBar.activeForeground": "#F9FAF8" 10 | }, 11 | "files.trimTrailingWhitespace": true, 12 | "editor.detectIndentation": false, 13 | "editor.insertSpaces": false 14 | } -------------------------------------------------------------------------------- /source/cfml/plugins/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.renderWhitespace": "boundary", 3 | "files.trimFinalNewlines": true, 4 | "files.trimTrailingWhitespace": true, 5 | "editor.detectIndentation": false, 6 | "editor.insertSpaces": false, 7 | "eslint.enable": true, 8 | "workbench.colorCustomizations": { 9 | "activityBar.background": "#173320", 10 | "titleBar.activeBackground": "#20482D", 11 | "titleBar.activeForeground": "#F8FCF9" 12 | } 13 | } -------------------------------------------------------------------------------- /source/cfml/plugins/scopes.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default ="100"; 3 | local.scopes = this.Perf.getLogs(arguments.req, "scopes"); 4 | local.q = local.scopes.q; 5 | local.src_rows = local.q.recordcount 6 | setTitle( "Variable Scoping Problems"); 7 | 8 | 9 | 10 | 11 | 12 | 13 | #renderTemplateHead()# 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | #renderTemplateLink( arguments.req, local.q.template )# 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
LineVariableResolved ScopeTotal
#NumberFormat( local.q.line )##local.q.name##local.q.resolvedScope##NumberFormat( local.q.total )#
-------------------------------------------------------------------------------- /source/cfml/plugins/related.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.template" default =""; 3 | param name="arguments.req.url" default =""; 4 | param name="arguments.req.log" default =""; 5 | param name="request.subtitle" default=""; 6 | local.subTitle = request.subtitle; //stash 7 | local.timer = getTickCount(); 8 | local.related = 0; 9 | arguments.req.maxrows = (Len(arguments.req.log) eq 0 ? 25 : 100); 10 | 11 | loop array="#path_reports#" item="local.report"{ 12 | if ( report neq arguments.req.pLuginAction ){ 13 | timer label="Related: #report#" { 14 | saveContent variable="local.html" { 15 | cfinclude( template=report & ".cfm" ); 16 | } 17 | if ( local.q.recordcount gt 0 ){ 18 | echo( "

#request.subtitle#

#local.html#" ); 19 | related++; 20 | } 21 | } 22 | } 23 | } 24 | local.reqType = (Len(arguments.req.log) eq 0 ? "Path" : "Log" ); 25 | request.subtitle = ( related gt 0 ) ? ( variables.exactTemplatePath ? "Template" : local.reqType) & " Analysis" : local.subTitle; //pop 26 |
27 | -------------------------------------------------------------------------------- /source/cfml/plugins/footer.cfm: -------------------------------------------------------------------------------- 1 | 2 | function hasJavaMethod( obj, name ) { 3 | loop array=arguments.obj.getClass().getMethods() item="local.m" { 4 | if( m.getName() == arguments.name ) return true; 5 | } 6 | return false; 7 | } 8 | 9 | 10 |
11 |

This report is based on all the debugging logs currently in memory ( #this.perf.getRawLogCount()# logs, #this.perf.getDebugMemUsage()# ) 12 | (note #request.hiddenPerfAnalyzerOwnLogs# logs from Performance Analzyer hidden) 13 |

14 | click column headers to sort 15 |

16 | 17 |

18 | 19 | 20 | 22 | 23 | 24 | #variables.renderUtils.includeLang()# 25 | #variables.renderUtils.includeJavascript( "perf" )# 26 | 27 |

28 | Lucee Performance Analyzer 29 |

30 |
31 | -------------------------------------------------------------------------------- /source/cfml/plugins/queries.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default ="1000"; 3 | local.queries = this.Perf.getLogs(arguments.req, "queries"); 4 | local.q = queries.q 5 | setTitle("Slowest Queries"); 6 | 7 | 8 | 9 | 10 | 11 | 12 | #renderTemplateHead()# 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | #renderTemplateLink(arguments.req, local.q.template)# 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
LineNameDatasourceTotal timeMinMaxAvgExecutions
#NumberFormat(local.q.line)##local.q.name##local.q.datasource##DecimalFormat(local.q.totalTime/(1000*1000))##DecimalFormat(local.q.minTime/(1000*1000))##DecimalFormat(local.q.maxTime/(1000*1000))##DecimalFormat(local.q.avgTime/(1000*1000))##NumberFormat(local.q.executions)#
40 | -------------------------------------------------------------------------------- /source/cfml/plugins/aborts.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default="1000"; 3 | local._total_aborts = 0; 4 | local.aborts = this.Perf.getLogs(arguments.req, "aborts"); 5 | local.q = local.aborts.q 6 | setTitle( "Aborts" ); 7 | 8 | 9 | 10 | 11 | 12 | 13 | #renderTemplateLink( arguments.req, local.q.template )# 14 | #local.q.line# 15 | #NumberFormat( local.q.executions )# 16 | 17 | 18 | local._total_aborts += local.q.executions; 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Totals 28 | #numberFormat( local._total_aborts )# 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | #renderTemplateHead()# 38 | 39 | 40 | 41 | 42 | 43 | #totals# 44 | 45 | 46 | #body# 47 |
LineCount
-------------------------------------------------------------------------------- /source/cfml/plugins/dumps.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default="1000"; 3 | local._total_dumps = 0; 4 | local.dumps = this.Perf.getLogs(arguments.req, "dumps"); 5 | local.q = local.dumps.q 6 | setTitle( "Dumps" ); 7 | 8 | 9 | 10 | 11 | 12 | 13 | #dump(local.q.output)# 14 | #renderTemplateLink( arguments.req, local.q.template )# 15 | #local.q.line# 16 | #NumberFormat( local.q.dumps )# 17 | 18 | 19 | local._total_dumps += local.q.dumps; 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | Totals 29 | #numberFormat( local._total_dumps )# 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | #renderTemplateHead()# 40 | 41 | 42 | 43 | 44 | 45 | #totals# 46 | 47 | 48 | #body# 49 |
OutputLineCount
-------------------------------------------------------------------------------- /login.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="form.password" default=""; 3 | variables.login_error = ""; 4 | 5 | if (len(form.password) gt 0){ 6 | admin action="checkPassword" 7 | type="#request.adminType#"; 8 | admin action="hashPassword" 9 | type="#request.adminType#" 10 | pw="#form.password#" 11 | returnVariable="hashedPassword"; 12 | try { 13 | admin action="connect" 14 | type="#request.adminType#" 15 | password="#hashedPassword#"; 16 | session["password" & request.adminType] = hashedPassword; 17 | session.LUCEE_ADMIN_LANG = "EN"; 18 | location url="index.cfm?action=plugin" addtoken="false"; 19 | 20 | } catch(e){ 21 | variables.login_error = cfcatch.message; 22 | } 23 | } 24 | variables.style=FileRead("source\cfml\plugins\css\style.css"); // assets require a login 25 | 26 | 27 | 30 | 41 | 44 | -------------------------------------------------------------------------------- /source/cfml/plugins/parts.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.template" default =""; 3 | param name="arguments.req.maxrows" default ="100"; 4 | setTitle("Page Parts"); 5 | local.parts = this.Perf.getLogs(arguments.req, "parts"); 6 | local.q = local.parts.q; 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | #renderTemplateHead()# 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | #renderTemplateLink( arguments.req, local.q.template )# 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
LinesTotal timeCountMinMaxAvgRequests
#local.q.lines##NumberFormat( local.q.totalTime / ( 1000 * 1000 ) )##NumberFormat( local.q.totalCount)##NumberFormat( local.q.minTime / ( 1000 * 1000 ) )##NumberFormat( local.q.maxTime / ( 1000 * 1000 ) )##NumberFormat( local.q.avgTime / ( 1000 * 1000 ) )##NumberFormat( local.q.executions )#
42 | -------------------------------------------------------------------------------- /source/cfml/plugins/exceptions.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default="1000"; 3 | local._total_executions = 0; 4 | local.exceptions = this.Perf.getLogs(arguments.req, "exceptions"); 5 | local.q = local.exceptions.q 6 | setTitle( "Exceptions" ); 7 | 8 | 9 | 10 | 11 | 12 | 13 | #local.q._type# 14 | #local.q.message# 15 | #local.q.detail# 16 | #renderTemplateLink( arguments.req, local.q.template )# 17 | #local.q.line# 18 | #NumberFormat( local.q.executions )# 19 | 20 | 21 | local._total_executions += local.q.executions; 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Totals 31 | #numberFormat( local._total_executions )# 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | #renderTemplateHead()# 44 | 45 | 46 | 47 | 48 | 49 | #totals# 50 | 51 | 52 | #body# 53 |
TypeMessageDetailLineCount
-------------------------------------------------------------------------------- /source/cfml/plugins/traces.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default="1000"; 3 | local._total_aborts = 0; 4 | local.traces = this.Perf.getLogs(arguments.req, "traces"); 5 | local.q = local.traces.q 6 | setTitle( "Traces" ); 7 | 8 | 9 | 10 | 11 | 12 | 13 | #renderTemplateLink( arguments.req, local.q.template )# 14 | #local.q.line# 15 | #local.q.text# 16 | #local.q.type# 17 | #local.q.action# 18 | #local.q.category# 19 | #prettyTime (local.q.time * 1000 * 1000 )# 20 | 21 | #local.q.var# 22 | =#local.q.varValue# 23 | 24 | 25 | #NumberFormat( local.q.executions )# 26 | 27 | 28 | local._total_aborts += local.q.executions; 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Totals 38 | #numberFormat( local._total_aborts )# 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | #renderTemplateHead()# 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | #totals# 60 | 61 | 62 | #body# 63 |
LineTextTypeActionCategoryTimeVarCount
-------------------------------------------------------------------------------- /source/cfml/plugins/contextSelector.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | Warning: request.admintype is "#request.admintype#", should be either web or server?? 10 |
11 |
12 | 13 | 14 | 15 | 16 |
17 | #i18n('chooseLogLocation')# 18 | 32 | 33 | 34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 |
-------------------------------------------------------------------------------- /source/cfml/plugins/timers.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default="1000"; 3 | local.timers = this.Perf.getLogs(arguments.req, "timers"); 4 | local.q = timers.q; 5 | local._total_time = 0; 6 | local._total_executions = 0; 7 | setTitle( "Timers" ); 8 | 9 | 10 | 11 | 12 | 13 | 14 | #local.q.label# 15 | #renderTemplateLink( arguments.req, local.q.template )# 16 | #local.q.line# 17 | #prettyTime (local.q.totalTime * 1000 * 1000 )# 18 | #DecimalFormat(local.q.minTime/(1000*1000))# 19 | #DecimalFormat(local.q.maxTime/(1000*1000))# 20 | #DecimalFormat(local.q.avgTime/(1000*1000))# 21 | #NumberFormat( local.q.executions )# 22 | 23 | 24 | local._total_time += local.q.totalTime; 25 | local._total_executions += local.q.executions; 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Totals 35 | #prettyTime( local._total_time * 1000 * 1000 )# 36 | 37 | #prettyNum( local._total_executions )# 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | #renderTemplateHead()# 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | #totals# 58 | 59 | 60 | #body# 61 |
LabelLineTotal timeMinMaxAvgCount
62 | -------------------------------------------------------------------------------- /box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"Lucee Performance Analyzer", 3 | "author":"Zac Spitzer", 4 | "version":"2.1.1.1", 5 | "bugs":"https://github.com/zspitzer/lucee-performance-analyzer/issues", 6 | "thumbnail": "https://raw.githubusercontent.com/zspitzer/lucee-performance-analyzer/master/build/images/logo.png", 7 | "changelog":"", 8 | "contributors":[], 9 | "dependencies":{}, 10 | "description":"", 11 | "devDependencies":{}, 12 | "documentation":"", 13 | "homepage":"https://github.com/zspitzer/lucee-performance-analyzer", 14 | "ignore":[], 15 | "installPaths":{}, 16 | "instructions":"", 17 | "keywords":"logs lucee admin plugin performance", 18 | "license":[ 19 | { 20 | "type":"", 21 | "URL":"" 22 | } 23 | ], 24 | "location":"ForgeboxStorage", 25 | "private":false, 26 | "projectURL":"", 27 | "repository":{ 28 | "type":"git", 29 | "URL":"https://github.com/zspitzer/lucee-performance-analyzer" 30 | }, 31 | "scripts":{}, 32 | "shortDescription":"A Lucee Admin plugin to analyze debug logs for performance problems, via aggregate reports from all the debug logs available", 33 | "slug":"A345C8CB-04CC-4D2B-93D50471D5105D83", 34 | "testbox":{ 35 | "bundles":"", 36 | "directory":"tests.specs", 37 | "labels":"", 38 | "options":{}, 39 | "recurse":true, 40 | "reporter":"", 41 | "runner":[ 42 | { 43 | "default":"" 44 | } 45 | ], 46 | "testBundles":"", 47 | "testSpecs":"", 48 | "testSuites":"", 49 | "verbose":true, 50 | "watchDelay":500, 51 | "watchPaths":"**.cfc" 52 | }, 53 | "type":"lucee-extensions", 54 | "lucee-extension-releasetype": "all", 55 | "lucee-extension-mincoreversion": "5.2.8.50", 56 | "lucee-extension-category": "performance", 57 | 58 | "engines" : [ 59 | { "type" : "lucee", "version" : ">=5.2.8" } 60 | ] 61 | } 62 | -------------------------------------------------------------------------------- /source/cfml/plugins/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | .maintbl td, .maintbl th { 3 | font-weight: normal; 4 | empty-cells: show; 5 | border: 1px solid #fff; 6 | } 7 | 8 | body, td, th { 9 | font-family:Arial, Helvetica, sans-serif; 10 | font-size : 12px; 11 | color:#333; 12 | } 13 | 14 | table {empty-cells:show; border-collapse: collapse;} 15 | td, th { 16 | padding: 4 4 4 4; 17 | vertical-align:top; 18 | } 19 | th, .maintbl th {/* like .tblHead */ 20 | background-color:#39c; /* ABC */ 21 | color:#efede5; 22 | font-weight:normal; 23 | text-align:left; 24 | } 25 | 26 | th a { 27 | color: inherit; 28 | text-decoration: underline; 29 | } 30 | 31 | .toolbar-filter, .toolbar-filter a { 32 | padding-right: 12px; 33 | text-decoration: none; 34 | } 35 | 36 | .toolbar-file-filter, .toolbar-file-filter a { 37 | padding-right: 3px; 38 | text-decoration: none; 39 | } 40 | 41 | .toolbar-file-filter H3, .toolbar-file-filter H1 { 42 | margin: 2 0; 43 | } 44 | 45 | hr { 46 | margin: 2; 47 | } 48 | 49 | .log-totals TD { 50 | font-weight: bolder; 51 | } 52 | 53 | table pre { 54 | margin: 0; 55 | font: unset; 56 | } 57 | 58 | .maintbl { 59 | width:auto; 60 | } 61 | 62 | #innercontent { 63 | margin-top: 10px; 64 | margin-left: 3px; 65 | } 66 | 67 | .unused-template, .unused-template TD { 68 | background-color:rgb(223 186 186); 69 | color:black; 70 | } 71 | 72 | a { 73 | color:black; 74 | } 75 | 76 | .no-wrap { 77 | white-space: nowrap; 78 | } 79 | 80 | .alt-row { 81 | background-color: #DFDFDF; 82 | } 83 | 84 | .header H1 { 85 | margin-bottom:2px; 86 | font-size: 1.5em; 87 | } 88 | 89 | .header { 90 | padding-bottom:12px; 91 | } 92 | 93 | .statusCode-4, .statusCode-5, .statusCode-6{ 94 | background-color: red; 95 | color: white; 96 | } 97 | 98 | .statusCode-1, .statusCode-2 { 99 | /*normal */ 100 | } 101 | .statusCode-3 { 102 | background-color: yellow; 103 | } 104 | 105 | .filter { 106 | padding-left: 10px;; 107 | } 108 | 109 | .filterSelected { 110 | font-weight: bolder; 111 | } -------------------------------------------------------------------------------- /index.cfm: -------------------------------------------------------------------------------- 1 | 2 | request.self = ListFirst(cgi.REQUEST_URL,"?") &"?action=Plugin"; 3 | url.action = "Plugin"; 4 | url.plugin = "PerformanceAnalyzer"; 5 | request.version = DeserializeJson(FileRead(ExpandPath(".\box.json"))).version; 6 | request.subtitle = ""; 7 | request.title = "Lucee Performance Analyzer - #request.version#"; 8 | param name="url.pluginAction" default="analysis"; 9 | param name="url.xhr" default="false"; 10 | variables.plugin = new source.cfml.plugins.Action(lang={},app={}); 11 | 12 | request.action = ListLast( url.pluginAction, "/\/" ); 13 | savecontent variable="body"{ 14 | switch ( request.action ){ 15 | case "logout": 16 | sessionInvalidate(); 17 | location url="index.cfm" addtoken="false"; 18 | case "login": 19 | if ( cgi.REQUEST_URL does not contain "/index.cfm" ) 20 | location url="index.cfm" addtoken="false"; 21 | cfinclude( template="login.cfm" ); 22 | break; 23 | default: 24 | if ( StructKeyExists( variables.plugin, request.action ) ) 25 | variables.plugin[ request.action ]( lang={}, app={}, req=url ); 26 | if ( !url.xhr ) 27 | variables.plugin.getRenderUtils().includeJavascript( "jquery-3.6.0.slim.min" ); 28 | variables.plugin._display( template=request.action & ".cfm", lang={}, app={}, req=url ); 29 | } 30 | } 31 | 32 | 33 | 34 | 35 | 36 | #request.subtitle# <cfif len(request.subtitle)>-</cfif> #request.title# 37 | 38 | 39 | 40 | 41 | 42 | 43 |
44 |

Lucee Performance Analyzer (standalone) #request.version#

45 | Lucee #server.lucee.version# / #UCFirst( request.adminType )# / Lucee Admin 46 | 47 | / Logout 48 | 49 |
50 |
51 | #variables.plugin.getRenderUtils().cleanHtml(body)# 52 |
53 |
54 | 55 | -------------------------------------------------------------------------------- /source/cfml/plugins/Action.cfc: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2016, Paul Klinkenberg, Utrecht, The Netherlands. 4 | * Originally written by Gert Franz, Switzerland. 5 | * All rights reserved. 6 | * 7 | * Date: 2016-02-11 13:45:05 8 | * Revision: 2.3.1. 9 | * Project info: http://www.lucee.nl/post.cfm/railo-admin-log-analyzer 10 | * 11 | * This library is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This library is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library. If not, see . 23 | * 24 | */ 25 | component extends="lucee.admin.plugin.Plugin" { 26 | 27 | public void function init( required struct lang, required struct app ) { 28 | variables.renderUtils = new RenderUtils( arguments.lang, action( "asset" ), this.action ); 29 | variables._lang = arguments.lang; 30 | setting showdebugoutput = "true"; 31 | } 32 | 33 | RenderUtils public function getRenderUtils(){ 34 | return variables.renderUtils; 35 | } 36 | 37 | public void function _display( required string template, required struct lang, required struct app, required struct req ) { 38 | param name="url.xhr" default="false"; 39 | request._missing_lang = {}; 40 | var cfquery = ""; // var scoping 41 | request.title = "Perf Analyzer"; 42 | if ( not url.xhr) 43 | variables.renderUtils.includeCSS( "style" ); 44 | this.perf = new Perf(adminType=request.adminType, password=session["password"&request.adminType]); 45 | cfinclude( template="toolbar.cfm" ); 46 | 47 | cfinclude( template=arguments.template ); 48 | 49 | cfinclude( template="footer.cfm" ); 50 | //variables.renderUtils.warnMissingLang(request._missing_lang); 51 | } 52 | 53 | public void function asset(struct lang, struct app, struct req) output=false { 54 | param name="arguments.req.asset"; 55 | // dunno why, sometimes this doesn't exist and throws an error 56 | if (not structKeyExists(variables, "renderUtils") ) 57 | variables.renderUtils = new RenderUtils( arguments.lang, action( "asset" ), this.action ); 58 | variables.renderUtils.returnAsset( arguments.req.asset ); 59 | } 60 | 61 | public void function getLang( struct lang, struct app, struct req ) output=false { 62 | url.xhr = true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Application.cfc: -------------------------------------------------------------------------------- 1 | 18 | 19 | // copied from the the lucee admin 20 | 21 | this.name="lucee-performance-analzyer"; 22 | this.clientmanagement="no"; 23 | this.clientstorage="file"; 24 | this.scriptprotect="all"; 25 | this.sessionmanagement="yes"; 26 | this.sessionStorage="memory"; 27 | this.sessiontimeout="#createTimeSpan(0,0,30,0)#"; 28 | this.setclientcookies="yes"; 29 | this.setdomaincookies="no"; 30 | this.applicationtimeout="#createTimeSpan(1,0,0,0)#"; 31 | this.localmode="update"; 32 | this.web.charset="utf-8"; 33 | this.sessionCookie.httpOnly = true; // prevent access to session cookies from javascript 34 | this.sessionCookie.sameSite = "strict"; 35 | this.sessionCookie.path = "/#listFirst(cgi.script_name,"/")#"; 36 | this.tag.cookie.sameSite = "strict"; 37 | 38 | this.xmlFeatures = { 39 | externalGeneralEntities: false, 40 | secure: true, 41 | disallowDoctypeDecl: true 42 | }; 43 | 44 | request.adminType = "web"; 45 | try { 46 | request.singleMode = getConfigSettings().mode == "single"; 47 | if (request.singleMode) 48 | request.adminType="server"; 49 | } catch (e){ 50 | // lucee 6.0 only 51 | } 52 | 53 | //if(fileName!="admin.cfm" && fileName!="web.cfm" && fileName!="server.cfm" && fileName!="index.cfm") { 54 | public function onRequestStart() { 55 | // if not logged in, we only allow access to admin|web|server[.cfm] 56 | 57 | if ( !StructKeyExists( session, "password" & request.adminType ) ){ 58 | structDelete( session, "passwordWeb" ); 59 | structDelete( session, "passwordServer" ); 60 | } 61 | 62 | if(!structKeyExists( session, "passwordWeb" ) && !structKeyExists( session, "passwordServer" )){ 63 | var fileName = listLast( cgi.script_name, "/" ); 64 | 65 | if (getDirectoryFromPath(ExpandPath(cgi.SCRIPT_NAME)) neq GetDirectoryFromPath(GetCurrentTemplatePath()) 66 | || fileName!="index.cfm") { 67 | cfsetting(showdebugoutput:false); 68 | cfheader(statuscode="404" statustext="Invalid access"); 69 | cfcontent(reset="true"); 70 | abort; 71 | } 72 | url.pluginAction="login"; 73 | } 74 | } 75 | 76 | public function onApplicationStart(){ 77 | if(structKeyExists(server.system.environment,"LUCEE_ADMIN_ENABLED") && server.system.environment.LUCEE_ADMIN_ENABLED EQ false){ 78 | cfheader(statuscode="404" statustext="Invalid access"); 79 | abort; 80 | } 81 | } 82 | 83 | 84 | -------------------------------------------------------------------------------- /source/cfml/plugins/applications.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | if (not structKeyExists(local.debugLogs, "data")) 14 | local.debugLogs.data = []; // getLoggedDebugData may return null 15 | var q = QueryNew("name,time,sql,src,line, count,datasource,usage,cacheType"); 16 | request.subtitle = "Slowest Queries"; 17 | var local.r =0; 18 | cfinclude(template="toolbar.cfm"); 19 | 20 | 21 | 22 | 23 | local.log = local.debugLogs.data[local.i]; 24 | if (StructKeyExists(req, "since")){ 25 | if (dateCompare(log.starttime, req.since ) neq 1) 26 | continue; 27 | } 28 | 29 | 30 | 31 | //dump(local.log); abort; 32 | loop query="#local.queries#" { 33 | queryAddRow(q, queryRowData(local.queries, local.queries.currentrow)); 34 | } 35 | 36 | 37 | 38 | 39 | select name,time,sql,src,line, count as total,datasource,cacheType 40 | from q 41 | 42 | 43 | 44 | select name, sum(time) as totalTime, min(time) as minTime, max(time) as maxTime, avg(time) as avgTime, 45 | src,line, sum(total) as total ,datasource,cacheType, count(*) as executions 46 | from q 47 | group by name,src,line,datasource,cacheType 48 | order by totalTime desc 49 | 50 | 51 | 52 | 53 |

This report is based on all the debugging logs currently in memory (#local.debugLogs.data.len()#), click column headers to sort

54 |
55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 94 | 95 | 96 | 97 | 98 | 100 | 101 | 102 | 103 |
TemplateLineNameDatasourceTotal timeMinMaxAvgExecutions
#local.q.src##NumberFormat(local.q.line)##local.q.name##local.q.datasource##DecimalFormat(local.q.totalTime/(1000*1000))##DecimalFormat(local.q.minTime/(1000*1000))##DecimalFormat(local.q.maxTime/(1000*1000))##DecimalFormat(local.q.avgTime/(1000*1000))##NumberFormat(local.q.executions)#
87 |
88 | 89 | No query logs found? Is debugging enabled? 90 | 91 | No Queries found 92 | 93 |

Showing the top #req.maxrows# queries by total execution time (from #src_rows#) 99 |
104 | 105 | #renderUtils.includeLang()# 106 | #renderUtils.includeJavascript("perf")# 107 | 108 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lucee Performance Analyzer 2 | Performance Analyzer plugin for Lucee, to be used in the Lucee admin. 3 | 4 | By Zac Spitzer https://twitter.com/zackster/ 5 | 6 | ![extension install count](https://www.forgebox.io/api/v1/entry/A345C8CB-04CC-4D2B-93D50471D5105D83/badges/downloads) 7 | 8 | [Forgebox](https://www.forgebox.io/view/A345C8CB-04CC-4D2B-93D50471D5105D83) 9 | 10 | Supports Lucee 5.2.8.50 and later 11 | 12 | ## Install 13 | 14 | ### Lucee Administrator as an Admin Plugin / Extension 15 | 16 | Install via Applications page in your Lucee Administrator. It's best to install under the Web Administrator, once [this bug/patch](https://luceeserver.atlassian.net/browse/LDEV-2791) against Lucee is merged, you will be able to install the plugin once at the Server level and then access the plugin from all web contexts. After installing the plugin restart Lucee to make the plugin accessible to your Lucee Server/Web Administrator. 17 | 18 | ### Standalone Install (new!) 19 | 20 | Checkout the code into a folder and you can run it without having the Lucee Administrator enabled. 21 | 22 | Just login with your Lucee Server Admin password, currently still requires debugging to be already enabled. 23 | 24 | ## Usage 25 | 26 | You will need to enable debugging and configure a debug template in order to capture debug logs for this plugin to work. To enable debugging log into Lucee Administrator, click in the "Debugging" section on "Settings" and enable "Database Activity" with "Query Usage", "Exceptions", "Timer" and "Implicit variable Access". Then make sure to populate the debugging log by navigating/opening a cfml page with your browser, e.g. http://localhost:8888/index.cfm. After this you'll be able to see the collected information in the "Performance Analyzer" section in the Lucee Web Administrator of that web context. 27 | 28 | ## Features 29 | - Overall Analysis Report 30 | - Filter by Path or URL 31 | - Top variable Scoping problems Report 32 | - Slowest SQL queries Report 33 | - Slowest Templates / Functions Report 34 | - Unused Templates Report 35 | - Aggregate Aborts Report 36 | - Aggregate Dumps Report 37 | - Aggregate Exceptions Report 38 | - Aggregate Timers Report 39 | - Aggregate Traces Report 40 | - Lucee Thread Report 41 | - Memory Report by Application / Session 42 | - All tables are sortable, just click any header 43 | 44 | ## Building 45 | The Build process uses [Apache Ant](https://ant.apache.org/) 46 | 47 | Simply run **ant** in the root directory to build the extension .lex file, which you can then manually install via the Lucee Administrator 48 | 49 | ## Support 50 | 51 | If you run into any issues, **please always describe your Lucee stack** (Java version, Lucee version, OS, webserver, tomcat/commandbox etc) and include any stacktraces if you encounter an exception. 52 | 53 | Lucee doesn't yet support accessing plugins installed at the Server Admin plugins from the Web Admin, I have been working on a patch to enable this https://github.com/lucee/Lucee/pull/901 which was merged in with version 5.3.7.31 54 | 55 | This plugin relies on the same backend API as the built in `Debugging - Logs` view in the Lucee Admin. If you don't see any logs there, this plugin won't have anything to report on. 56 | 57 | ## Hacking 58 | Once installed, all the source cfml and js files can be found under the server or web context, depending where you installed it 59 | 60 | - web context: under the \WEB-INF\context\admin\plugin\PerformanceAnalyzer 61 | - server: C:\lucee\tomcat\lucee-server\context\context\admin\plugin\PerformanceAnalyzer 62 | 63 | Append debug=true to the url to enable debugging output 64 | 65 | If the plugin doesn't appear, append alwaysnew=1 to the url 66 | 67 | Pull requests are welcome! 68 | 69 | -------------------------------------------------------------------------------- /source/cfml/plugins/memory.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | local.serverScope = getPageContext().scope( createObject( "java", "lucee.runtime.type.scope.Scope" ).SCOPE_SERVER ) 5 | local.configServer= getPageContext().getConfig().getConfigServer( session[ "password" & request.adminType ] ); 6 | local.webContexts = configServer.getConfigWebs(); 7 | setTitle( "Memory Scopes" ); 8 | local.r = 0; 9 | local.rows = 1; 10 | local.total_app_size = sizeOf( serverScope ); 11 | local.total_app_keys = structCount( serverScope ); 12 | local.total_session_size = 0; 13 | local.total_session_count = 0; 14 | 15 | 16 | 17 | 18 | 19 | Server Scope 20 | 21 | #prettyNum( sizeOf( serverScope ) )# 22 | #prettyNum( structCount( serverScope ), false)# 23 | 24 | 25 | 26 | 27 | 28 | local.config = webContexts[ configName ]; 29 | local.context = config.getFactory().getScopeContext(); 30 | local.apps = context.getAllApplicationScopes(); 31 | local.sessions = context.getAllCFSessionScopes(); 32 | 33 | local.rows++; 34 | 35 | 36 | 37 | local.app_size = sizeOf( duplicate( apps[ app ] ) ); 38 | local.total_app_size += local.app_size; 39 | local.total_app_keys += structCount( apps[ app ] ); 40 | 41 | 42 | #config.getRootDirectory()# 43 | #app# 44 | #prettyNum( local.app_size, true )# 45 | #prettyNum( structCount( apps[ app ] ), false)# 46 | 47 | 48 | local.session_size = sizeOf( duplicate( local.sessions[ app ] ) ); 49 | local.total_session_size += local.session_size; 50 | local.total_session_count += structCount( sessions[ app ] ); 51 | 52 | #prettyNum( structCount( sessions[ app ]), false )# 53 | #prettyNum( local.session_size, true)# 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Totals 67 | 68 | #prettyNum( local.total_app_size, true )# 69 | #prettyNum( local.total_app_keys, false )# 70 | #prettyNum( local.total_session_count, false )# 71 | #prettyNum( local.total_session_size, true )# 72 | 73 | 74 | 75 | 76 | 77 |

Size of the Server, Application and Session scopes currently in memory, click column headers to sort

78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | #totals# 91 | 92 | 93 | 94 | #body# 95 | 96 | 97 | 98 | #totals# 99 | 100 | 101 |
WebRootApplicationScope MbKeysSession CountSize Mb
-------------------------------------------------------------------------------- /source/cfml/plugins/templates.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.template" default =""; 3 | param name="arguments.req.maxrows" default ="100"; 4 | setTitle("Slowest Templates"); 5 | local.pages = this.Perf.getLogs(arguments.req, "pages"); 6 | local.q = local.pages.q; 7 | 8 | 9 | 10 | local.templates = [=]; // ordered struct 11 | if ( len( arguments.req.template ) && ! variables.exactTemplatePath ){ 12 | timer label='DirectoryList(path=#arguments.req.template#, recurse=true, listInfo="path")' { 13 | local.files = DirectoryList( path=arguments.req.template, recurse=true, listInfo="path", 14 | filter = function( path ){ 15 | local.e = listLast( arguments.path, "\/." ); 16 | return ( Find( "cf", local.e ) eq 1 ); 17 | } 18 | ); 19 | } 20 | //dump(var=local.files, top=10); 21 | loop array = local.files index="local.file"{ 22 | templates[ local.file ] = { 23 | uses: 0 // count usage 24 | , file: local.file 25 | }; 26 | } 27 | //dump(var=local.templates, top=10); 28 | } 29 | 30 | 31 | 32 | 33 | 34 | 35 | #renderTemplateHead()# 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | #renderTemplateLink( arguments.req, local.q.template )# 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
FunctionTotal timeCountMinMaxAvgRequests
#local.q._function#()#NumberFormat( local.q.totalTime / ( 1000 * 1000 ) )##NumberFormat( local.q.totalCount)##NumberFormat( local.q.minTime / ( 1000 * 1000 ) )##NumberFormat( local.q.maxTime / ( 1000 * 1000 ) )##NumberFormat( local.q.avgTime / ( 1000 * 1000 ) )##NumberFormat( local.q.executions )#
63 | 64 | 65 | // loop again, because cfoutput has a maxrows 66 | loop query="local.q" { 67 | if ( StructKeyExists( local.templates, local.q.template ) ){ 68 | local.templates[ local.q.template ].uses ++; 69 | } 70 | } 71 | 72 | 73 | 74 | 75 |

Template Usage (via current debug logs)

76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | "unused-template"> 90 | #renderTemplateLink( arguments.req, local.t )# 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 |
TemplateUsesSizeLast Modified
#NumberFormat( local.c.uses )##NumberFormat( fi.size)##LSDateTimeFormat( fi.lastModified )#
104 |
105 |
-------------------------------------------------------------------------------- /source/cfml/plugins/settings.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default="1000"; 3 | local.timers = this.Perf.getLogs(arguments.req, "timers"); 4 | local.q = timers.q; 5 | local._total_time = 0; 6 | local._total_executions = 0; 7 | setTitle( "Settings" ); 8 | 9 | param name="form.bUpdateDebug" default="false"; 10 | 11 | if (form.bUpdateDebug){ 12 | 13 | var attrColl = form.debugSetting; // struct of settings 14 | attrColl.action = "updateDebug"; 15 | attrColl.type = "#request.adminType#" 16 | attrColl.password = "#session["password"&request.adminType]#" 17 | attrColl.debugTemplate = ""; 18 | attrColl.remoteClients = ""; 19 | 20 | admin attributeCollection="#attrColl#"; 21 | 22 | admin 23 | action="updateDebugSetting" 24 | type="#request.adminType#" 25 | password="#session["password"&request.adminType]#" 26 | maxLogs="#form.maxLogs#" 27 | remoteClients=""; 28 | 29 | echo("Debug Settings were updated!
"); 30 | } 31 | 32 | admin 33 | action="getDebugSetting" 34 | type="#request.adminType#" 35 | password="#session["password"&request.adminType]#" 36 | returnVariable="local.debugSetting"; 37 | 38 | admin 39 | action="getDebug" 40 | type="#request.adminType#" 41 | password="#session["password"&request.adminType]#" 42 | returnVariable="local.debug"; 43 | 44 |
45 |

46 | This is the same as updating the debug settings in the Lucee Admin 47 |

48 | 49 | 50 |
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | local.r = 0; 61 | local.d = "debug"; 62 | 63 | 64 | 65 | 75 | 76 | 77 | 78 | 79 | 80 | structDelete( local.debug, "debug" ); 81 | local.r++; 82 | 83 | 84 | 85 | 86 | 96 | 97 | 98 | 99 | 100 | 101 | 104 | 105 | 106 | 107 | 108 | 109 | 113 | 114 | 115 |
SettingStatus
Debugging Enabled 66 | 70 | 74 |

#UCFirst(d)# 87 | 91 | 95 |
Number of Debug Logs 102 | 103 |

110 | 111 | 112 |
116 |
117 | 118 |

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

121 |
-------------------------------------------------------------------------------- /source/cfml/plugins/requests.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.maxrows" default ="1000"; 3 | param name="arguments.req.consoleDump" default ="false"; 4 | param name="arguments.req.doPurge" default ="false"; 5 | 6 | if (arguments.req.doPurge) 7 | this.Perf.purgeLogs(); 8 | 9 | setTitle( "Debugging Logs" ); 10 | local.midnight = CreateDate( Year( Now() ), Month( Now() ), Day( Now() ) ); // hide todays date 11 | local.logs = this.Perf.getLogs(arguments.req, "logs"); 12 | local.q = logs.q; 13 | local.baseUrl = "?action=#arguments.req.action#&plugin=#arguments.req.plugin#&pluginAction=#arguments.req.pluginAction#"; 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | if (!iSJson( SerializeJson( this.Perf.getLog( q.id ) ) ) ) 23 | throw "json error"; 24 | 25 | 28 | 29 | 30 | if (local.q.isThread ) 31 | local.requestExtra = ' ' & (len(local.q.threadName) ? local.q.threadName: "thread") & ''; 32 | else 33 | local.requestExtra = ""; 34 | 35 | 36 | #renderRequestLink( arguments.req, local.q.path, local.q.id, local.requestExtra )# 37 | #listFirst(local.q.statusCode," ")# 38 | 39 | By Url,  40 | 41 | By Host 42 | 43 | 44 | #DateTimeFormat( local.q.starttime )# 45 | 46 | #TimeFormat( local.q.starttime )# 47 | 48 | 49 | #prettyTime( local.q.total )# 50 | #prettyTime( local.q.app )# 51 | #prettyTime( local.q.query )# 52 | #prettyTime( local.q.load )# 53 | #prettyNum( local.q.scope )# 54 | #prettyNum( local.q.exceptions )# 55 | #prettyNum( local.q.size / 1000 )# 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | Totals 65 | 66 | #prettyTime( local.logs.totals.total )# 67 | #prettyTime( local.logs.totals.app )# 68 | #prettyTime( local.logs.totals.query )# 69 | #prettyTime( local.logs.totals.load )# 70 | #prettyNum( local.logs.totals.scope )# 71 | #prettyNum( local.logs.totals.exceptions )# 72 | #prettyNum( local.logs.totals.size )# 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | #totals# 94 | 95 | 96 | #body# 97 |
UrlCodeFilterTimestampTotalAppQueryLoadScope ProblemsExceptionsLog Size
98 | -------------------------------------------------------------------------------- /add-lgpl-header.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Add license header 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | "; 40 | } 41 | // CFC (can be script or tag) 42 | else if(file.endsWith(".cfc")) { 43 | // script version 44 | if(text.indexOf(" -1) { 59 | text = text.substring(text.indexOf(ce) + ce.length); 60 | } 61 | text = cs + license + ce + text; 62 | } 63 | 64 | project.setProperty(attributes.get("property"), text); 65 | ]]> 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | * 76 | * Copyright (c) ${yearnow}, Paul Klinkenberg, Utrecht, The Netherlands. 77 | * Originally written by Gert Franz, Switzerland. 78 | * All rights reserved. 79 | * 80 | * Date: ${now} 81 | * Revision: ${bundleversion} 82 | * Project info: http://www.lucee.nl/post.cfm/railo-admin-log-analyzer 83 | * 84 | * This library is free software; you can redistribute it and/or 85 | * modify it under the terms of the GNU Lesser General Public 86 | * License as published by the Free Software Foundation; either 87 | * version 2.1 of the License, or (at your option) any later version. 88 | * 89 | * This library is distributed in the hope that it will be useful, 90 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 91 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 92 | * Lesser General Public License for more details. 93 | * 94 | * You should have received a copy of the GNU Lesser General Public 95 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. 96 | * 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /source/cfml/plugins/threads.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | local.debugLogs = {}; 4 | local.debugLogs.data = this.perf.getRawDebugLogs(); 5 | 6 | setTitle( "Java Threads" ); 7 | 8 |
9 | 10 | local.javaManagementFactory = createObject( "java", "java.lang.management.ManagementFactory" ); 11 | local.threadMXBean = javaManagementFactory.getThreadMXBean(); 12 | 13 | local.allThreadIDs = threadMXBean.getAllThreadIds(); 14 | //allThreads = threadMXBean.getThreadInfo( allThreadIDs, javaCast( "int", 3 ) ); 15 | 16 | //dump(allThreads); 17 | 18 | local.Thread = createObject( "java", "java.lang.Thread" ); 19 | local.it = Thread.getAllStackTraces().keySet().iterator(); 20 | // loop threads 21 | 22 | local.q_threads = queryNew( "name,threadState,stack,cpuTime,cfmlStack","varchar,varchar,varchar,numeric,object" ); 23 | 24 | loop collection=it item="local.t" { 25 | //dump(t); abort; 26 | local.st = t.getStackTrace(); 27 | local.str = ""; 28 | // loop stacktraces 29 | loop array=st item="local.ste" { 30 | str &= ste; 31 | str &= "
"; 32 | } 33 | local.servlet = find( "lucee.loader.servlet.CFMLServlet.service", str ); 34 | if ( local.servlet gt 1 ) 35 | str = mid( str , 1, local.servlet-1 ) & "..."; 36 | 37 | local.r = queryAddRow(q_threads); 38 | //if(!find("PageContextImpl",str)) continue; 39 | QuerySetCell( q_threads, "name", t.name, r ); 40 | QuerySetCell( q_threads, "threadState", t.getState().toString(), r ); 41 | QuerySetCell( q_threads, "stack",trim(str), r ); 42 | QuerySetCell( q_threads, "cpuTime", threadMXBean.getThreadCpuTime(t.getId())/1000/1000, r ); 43 | QuerySetCell( q_threads, "cfmlstack", extractCfmlStack(str), r ); 44 | 45 | } 46 | 47 | q_threads = q_threads.sort("cputime","desc"); 48 | //dump(q_threads); abort; 49 | 50 | function extractCfmlStack(string str){ 51 | var cfStack = REMatch("(\([\/a-zA-Z\_\-\.\$]*[\.cfc|\.cfm|\.lucee)]\:\d+\))", arguments.str); 52 | for (var cf = 1; cf <= cfStack.len(); cf++){ 53 | // strip out the wrapping braces 54 | cfStack[cf] = ListFirst(cfStack[cf],"()"); 55 | } 56 | // https://regex101.com/r/Fd8qCi/1/ 57 | var logStack = REMatch("(\[[\:\/\\a-zA-Z\_\-\.\$]*\])", arguments.str); 58 | if (logStack.len() gt 0){ 59 | // de dup 60 | var ls = StructNew('linked'); 61 | for (var s in logstack) 62 | ls[listFirst(s,"[]")]=""; 63 | logStack = StructKeyList(ls); 64 | ArrayAppend(cfStack, logStack, true); 65 | } 66 | return cFstack; 67 | } 68 |
69 | 70 | 71 | select threadState, count(threadState) as threads, sum(cpuTime) as cpuTotal 72 | from q_threads 73 | group by threadState 74 | union 75 | select 'All threads' as threadstate, count(*) as threads, sum(cpuTime) as cpuTotal 76 | from q_threads 77 | order by cpuTotal desc 78 | 79 | 80 | Thread States: 81 | 82 | 83 |
#q_summary.threadState# 85 | ( #q_summary.threads# ) #NumberFormat(q_summary.cpuTotal)#s, 86 | 87 | 88 |
89 |
90 | Thread Types: 91 | 92 | 93 | #filter# 95 | 96 | 97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 120 | 121 | 122 | 123 | 124 |
ThreadStatusStackCPU Time (seconds)
#q_threads.name##q_threads.threadState# 114 | 115 |
116 | 117 |
118 |
119 |
#q_threads.stack#
#DecimalFormat(q_threads.cpuTime)#
-------------------------------------------------------------------------------- /source/cfml/plugins/renderUtils.cfc: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2016, Paul Klinkenberg, Utrecht, The Netherlands. 4 | * Originally written by Gert Franz, Switzerland. 5 | * All rights reserved. 6 | * 7 | * Date: 2016-02-11 13:45:05 8 | * Revision: 2.3.1. 9 | * Project info: http://www.lucee.nl/post.cfm/railo-admin-log-analyzer 10 | * 11 | * This library is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This library is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library. If not, see . 23 | * 24 | */ 25 | component hint="various rendering related files"{ 26 | 27 | public void function init( required struct lang, required string href, required any action ) { 28 | variables.AssetHrefPath = ListFirst( arguments.href, "?" ); 29 | variables.AssetHrefParams = ListLast( arguments.href, "?" );; 30 | variables.lang = arguments.lang; 31 | variables.action = arguments.action; 32 | } 33 | 34 | public string function getCSRF(){ 35 | return CSRFGenerateToken("log-analyzer"); 36 | } 37 | 38 | private boolean function checkCSRF( required string token ){ 39 | if ( !CSRFVerifyToken( arguments.token, "log-analyzer" ) ) 40 | throw message="access denied"; 41 | else 42 | return true; 43 | } 44 | 45 | public void function renderServerTimingHeaders( required array timings ){ 46 | var serverTimingHeaders = []; 47 | for ( var timing in arguments.timings ){ 48 | arrayAppend( serverTimingHeaders, '#timing.metric#;dur=#timing.data#;desc="#timing.name#"' ); 49 | } 50 | 51 | if (serverTimingHeaders.len() gt 0 and not getPageContext().getHttpServletResponse().isCommitted() ) // avoid cfflush error 52 | header name="Server-Timing" value="#ArrayToList( serverTimingHeaders, ", " )#"; 53 | } 54 | 55 | public void function includeCSS( required string template ) { 56 | htmlhead text='#chr(10)#'; 57 | } 58 | 59 | public void function includeJavascript( required string template ) { 60 | htmlbody text='#chr(10)#'; 61 | } 62 | 63 | public void function includeLang() { 64 | htmlbody text='#Chr( 10 )#'; 65 | } 66 | 67 | public void function warnMissingLang( required struct missingLang ) { 68 | if ( structCount( warnMissingLang ) eq 0 ) 69 | return; 70 | var missing = []; 71 | for ( var k in arguments.missingLang ) 72 | missing.append( "console.warn('missing language string: [#JSStringFormat( k )#] from cfml');" ); 73 | if ( ArrayLen( missing ) ){ 74 | writeOutput( "" ); 75 | } 76 | } 77 | 78 | public void function returnAsset( required string asset ) { 79 | if (arguments.asset contains "..") 80 | throw "invalid asset request #EncodeForHtml( arguments.asset )#"; 81 | local.fileType = ListLast( arguments.asset, "." ); 82 | 83 | switch (local.fileType){ 84 | case "js": 85 | local.file = getDirectoryFromPath( getCurrentTemplatePath() ) & "js/#arguments.asset#"; 86 | local.mime = "text/javascript"; 87 | break; 88 | case "css": 89 | local.file = getDirectoryFromPath( getCurrentTemplatePath() ) & "css/#arguments.asset#"; 90 | local.mime = "text/css"; 91 | break; 92 | default: 93 | throw(); 94 | } 95 | if ( !FileExists( local.file ) ){ 96 | header statuscode="404"; 97 | writeOutput( "file not found #EncodeForHtml( local.file )#" ); 98 | abort; 99 | } 100 | local.fileInfo = FileInfo(local.file); 101 | 102 | if ( StructKeyExists( GetHttpRequestData().headers, "If-Modified-Since" ) ){ 103 | local.if_modified_since = ParseDateTime( GetHttpRequestData().headers['If-Modified-Since'] ); 104 | if ( DateDiff( "s", local.fileInfo.dateLastModified, local.if_modified_since ) GTE 0 ){ 105 | header statuscode="304" statustext="Not Modified"; 106 | abort; 107 | } 108 | } 109 | header name="cache-control" value="max-age=50000"; 110 | header name="Last-Modified" value="#GetHttpTimeString(local.fileInfo.dateLastModified)#"; 111 | content type="#local.mime#" reset="yes" file="#local.file#"; 112 | } 113 | 114 | /** 115 | * creates a text string indicating the timespan between NOW and given datetime 116 | */ 117 | public function getTextTimeSpan( required date date ) output=false { 118 | var diffSecs = DateDiff( 's', arguments.date, now() ); 119 | if ( diffSecs < 60 ) { 120 | return Replace( variables.lang.xSecondsAgo, '%1', diffSecs ); 121 | } else if ( diffSecs < 3600 ) { 122 | return Replace( variables.lang.xMinutesAgo, '%1', int (diffSecs / 60 ) ); 123 | } else if ( diffSecs < 86400 ) { 124 | return Replace( variables.lang.xHoursAgo, '%1', int( diffSecs / 3600 ) ); 125 | } else { 126 | return Replace( variables.lang.xDaysAgo, '%1', int( diffSecs / 86400 ) ); 127 | } 128 | } 129 | 130 | public function cleanHtml( required string content ){ 131 | return ReReplace( arguments.content, "[\r\n]\s*([\r\n]|\Z)", Chr(10), "ALL" ); 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /source/cfml/plugins/js/perf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var perf = { 3 | nl: String.fromCharCode(10), 4 | crlf: String.fromCharCode(10) + String.fromCharCode(13), 5 | i18n: function(key, _default){ 6 | key = key.toLowerCase(); 7 | if (perf.langBundle[key]){ 8 | return perf.langBundle[key]; 9 | } else { 10 | console.warn("missing language string: [" + key + "] for locale: [" + perf.locale + "] from javascript"); 11 | if (_default) 12 | return _default; 13 | else 14 | return key; 15 | } 16 | }, 17 | langBundle: {}, 18 | locale: "en", 19 | importi18n: function(pluginLanguage){ 20 | for (var str in pluginLanguage.STRINGS) 21 | perf.langBundle[(String(str).toLowerCase())] = pluginLanguage.STRINGS[str]; 22 | perf.locale = pluginLanguage.locale; 23 | }, 24 | sortTable: function (th, sortDefault){ 25 | var tr = th.parentElement; 26 | var table = tr.parentElement.parentElement; // table; 27 | var tbodys = table.getElementsByTagName("tbody"); 28 | var theads = table.getElementsByTagName("thead"); 29 | var rowspans = (table.dataset.rowspan !== "false"); 30 | 31 | if (!th.dataset.type) 32 | th.dataset.type = sortDefault; // otherwise text 33 | if (!th.dataset.dir){ 34 | th.dataset.dir = "asc"; 35 | } else { 36 | if (th.dataset.dir == "desc") 37 | th.dataset.dir = "asc"; 38 | else 39 | th.dataset.dir = "desc"; 40 | } 41 | for (var h = 0; h < tr.children.length; h++){ 42 | var cell = tr.children[h].style; 43 | if (h === th.cellIndex){ 44 | cell.fontWeight = 700; 45 | cell.fontStyle = (th.dataset.dir == "desc") ? "normal" : "italic"; 46 | } else { 47 | cell.fontWeight = 300; 48 | cell.fontStyle = "normal"; 49 | } 50 | } 51 | var sortGroup = false; 52 | var localeCompare = "test".localeCompare ? true : false; 53 | var numberParser = new Intl.NumberFormat('en-US'); 54 | var data = []; 55 | 56 | for ( var b = 0; b < tbodys.length; b++ ){ 57 | var tbody =tbodys[b]; 58 | for ( var r = 0; r < tbody.children.length; r++ ){ 59 | var row = tbody.children[r]; 60 | var group = false; 61 | if (row.classList.length > 0){ 62 | // check for class sort-group 63 | group = row.classList.contains("sort-group"); 64 | } 65 | // this is to handle secondary rows with rowspans, but this stops two column tables from sorting 66 | if (group){ 67 | data[data.length-1][1].push(row); 68 | } else { 69 | switch (row.childElementCount){ 70 | case 0: 71 | case 1: 72 | continue; 73 | case 2: 74 | if (!rowspans) 75 | break; 76 | if (data.length > 1) 77 | data[data.length-1][1].push(row); 78 | continue; 79 | default: 80 | break; 81 | } 82 | var cell = row.children[th.cellIndex]; 83 | var val = cell.innerText; 84 | if (!localeCompare){ 85 | switch (th.dataset.type){ 86 | case "text": 87 | val = val.toLowerCase(); 88 | break; 89 | case "numeric": 90 | case "number": 91 | switch (val){ 92 | case "": 93 | case "-": 94 | val = -1; 95 | break; 96 | default: 97 | val = Number(val); 98 | break; 99 | } 100 | break; 101 | } 102 | } else { 103 | if (cell.dataset.value) 104 | val = cell.dataset.value; 105 | // hack to handle formatted numbers with commas for thousand separtors 106 | var tmpNum = val.split(","); 107 | if (tmpNum.length > 1){ 108 | tmpNum = Number(tmpNum.join("")); 109 | if (tmpNum !== NaN) 110 | val = String(tmpNum); 111 | } 112 | } 113 | var _row = row; 114 | if (r === 0 && 115 | theads.length > 1 && 116 | tbody.previousElementSibling.nodeName === "THEAD" && 117 | tbody.previousElementSibling.children.length){ 118 | data.push([val, [tbody.previousElementSibling, row], tbody]); 119 | sortGroup = true; 120 | } else { 121 | data.push([val, [row]]); 122 | } 123 | 124 | } 125 | } 126 | } 127 | 128 | switch (th.dataset.type){ 129 | case "text": 130 | data = data.sort(function(a,b){ 131 | if (localeCompare){ 132 | return a[0].localeCompare(b[0],"en", {numeric:true, ignorePunctuation: true}); 133 | } else { 134 | if (a[0] < b[0]) 135 | return -1; 136 | if (a[0] > b[0]) 137 | return 1; 138 | return 0; 139 | } 140 | }); 141 | break; 142 | case "numeric": 143 | case "number": 144 | data = data.sort(function(a,b){ 145 | return a[0] - b[0]; 146 | }); 147 | } 148 | 149 | if (th.dataset.dir === "asc") 150 | data.reverse(); 151 | if (!sortGroup){ 152 | for (r = 0; r < data.length; r++){ 153 | for (var rr = 0; rr < data[r][1].length; rr++) 154 | tbody.appendChild(data[r][1][rr]); 155 | } 156 | } else { 157 | for (r = 0; r < data.length; r++){ 158 | 159 | if (data[r].length === 3){ 160 | var _rows = data[r]; 161 | table.appendChild(_rows[1][0]); // thead 162 | table.appendChild(_rows[2]); // tbody 163 | var _tbody = _rows[2]; 164 | for (var rr = 1; rr < _rows[1].length; rr++) 165 | _tbody.appendChild(_rows[1][rr]); // tr 166 | 167 | } else { 168 | for (var rr = 0; rr < data[r][1].length; rr++) 169 | table.appendChild(data[r][1][rr]); 170 | } 171 | } 172 | } 173 | 174 | } 175 | }; 176 | 177 | $(function(){ 178 | if (!pluginLanguage) 179 | console.warn("pluginLanguage missing, use #renderUtils.includeLang()#"); 180 | else 181 | perf.importi18n(pluginLanguage); 182 | 183 | $(".sort-table TH").on("click", function(ev){ 184 | perf.sortTable(ev.currentTarget, "numeric"); 185 | }); 186 | $(".thread-type-filter a.filter").on("click", function(){ 187 | var filter=$(this).data("filter"); 188 | $(".thread-type-filter a.filter").each(function(){ 189 | $(this).removeClass("filterSelected"); 190 | }) 191 | $(this).addClass("filterSelected"); 192 | 193 | $(".thread-table TBODY TR.stack").each(function(){ 194 | $(this).toggle(($(this).data('stack') == filter || filter == 'all')); 195 | }); 196 | }); 197 | 198 | $(".thread-state-filter a.filter").on("click", function(){ 199 | var filter=$(this).data("filter"); 200 | $(".thread-state-filter a.filter").each(function(){ 201 | $(this).removeClass("filterSelected"); 202 | }) 203 | $(this).addClass("filterSelected"); 204 | 205 | $(".thread-table TBODY TR.stack").each(function(){ 206 | $(this).toggle(($(this).data('state') == filter || filter == 'all')); 207 | }); 208 | }); 209 | }); 210 | -------------------------------------------------------------------------------- /source/cfml/plugins/toolbar.cfm: -------------------------------------------------------------------------------- 1 | 2 | param name="arguments.req.template" default =""; 3 | param name="arguments.req.url" default =""; 4 | param name="arguments.req.log" default =""; 5 | variables.template = arguments.req.template; 6 | variables.req = arguments.req; 7 | 8 | local.reports = ["Requests", "Templates", "Scopes", "Queries", "Timers", "Exceptions", "Dumps", "Aborts", "Traces", "Parts", "Memory", "Threads", "Settings"]; 9 | //if ( Len( arguments.req.template ) || Len( arguments.req.url ) || Len( arguments.req.log ) ) 10 | ArrayPrepend(local.reports, "Analysis"); 11 | local.path_reports = ["Requests", "Templates", "Scopes", "Queries", "Timers", "Exceptions", "Dumps", "Aborts", "Traces", "Parts"]; 12 | local.lastLogDate = now(); 13 | local.urlExtra = ""; 14 | if ( StructKeyExists(arguments.req, "since") and arguments.req.since and isDate(arguments.req.since)) 15 | urlExtra = "&since=#arguments.req.since#"; 16 | if ( Len( arguments.req.template ) ) 17 | urlExtra = urlExtra & "&template=" & urlEncodedFormat( arguments.req.template ); 18 | if ( Len( arguments.req.url ) ) 19 | urlExtra = urlExtra & "&url=" & urlEncodedFormat( arguments.req.url ); 20 | if ( Len( arguments.req.log ) ) 21 | urlExtra = urlExtra & "&log=" & urlEncodedFormat( arguments.req.log ); 22 | 23 | local.cfquery = ""; // hide from scopes 24 | request.title = "Performance Analyzer"; 25 | local.path = ""; 26 | variables.exactTemplatePath = len( arguments.req.template ) eq 0 ? false: FileExists( arguments.req.template ); 27 | if ( variables.exactTemplatePath && DirectoryExists( arguments.req.template )) 28 | variables.exactTemplatePath = false; 29 | 30 | void function renderRequestLink ( required struct req, required string linkTemplate, required string logId, string extra="" ){ 31 | var temp = arguments.linkTemplate; 32 | if (len( arguments.req.url ) gt 0 and find( arguments.req.url, arguments.linkTemplate, 1 ) eq 1) 33 | temp = mid( arguments.linkTemplate, len( arguments.req.url ) + 1 ); 34 | if ( Len(temp) eq 0) 35 | temp = arguments.linkTemplate; 36 | echo('#htmleditformat( temp )#'); 39 | if ( Len( arguments.extra ) ) 40 | echo( ' ' & arguments.extra ); 41 | echo(' '); 42 | 43 | } 44 | 45 | void function renderTemplateLink ( required struct req, reqPath ){ 46 | var temp = arguments.reqPath; 47 | if (len( arguments.req.template ) gt 0 and find( arguments.req.template, arguments.reqPath, 1 ) eq 1) 48 | temp = mid( arguments.reqPath, len( arguments.req.template ) + 2 ); 49 | if ( Len(temp) eq 0) 50 | temp = arguments.reqPath; 51 | if ( !variables.exactTemplatePath ){ 52 | echo(""); 53 | echo('#htmleditformat( temp )#'); 56 | // TODO if (len(singleLog.scope.cgi.http_user_agent) eq 0>Empty, probably a Lucee thread) 57 | echo(""); 58 | } 59 | } 60 | 61 | void function renderTemplateHead(){ 62 | if ( !variables.exactTemplatePath ) 63 | echo( 'Template' ); 64 | }; 65 | 66 | boolean function hasTemplates(){ 67 | return variables.exactTemplatePath ? 0 : 1; 68 | }; 69 | 70 | void function setTitle( string title ){ 71 | var t = ListFirst( ListLast( GetCurrentTemplatePath(), "\/" ), "." ); 72 | if ( variables.req.pluginAction eq t ) 73 | echo( "

#arguments.title#

" ); 74 | request.subtitle = arguments.title; 75 | } 76 | 77 | string function altRow( numeric currentrow ){ 78 | if ( arguments.currentRow mod 2 eq 1 ) 79 | return "alt-row"; 80 | return "zzz"; 81 | } 82 | 83 | string function prettyTime( numeric n ){ 84 | if ( arguments.n == 0 ) 85 | return ""; 86 | var s = arguments.n / ( 1000 * 1000 ); 87 | if ( int( s ) eq 0 ) 88 | return ""; 89 | return NumberFormat( s ); 90 | } 91 | 92 | string function prettyNum( numeric n=0, boolean large=false ){ 93 | if ( arguments.n == 0 ) 94 | return ""; 95 | 96 | if ( int( arguments.n ) eq 0 ) 97 | return ""; 98 | if ( arguments.large ) 99 | return NumberFormat( arguments.n / 1024 ); 100 | else 101 | return NumberFormat( arguments.n ); 102 | } 103 | local.baseUrl = "?action=#arguments.req.action#&plugin=#arguments.req.plugin#&pluginAction=#arguments.req.pluginAction#"; 104 |
105 | 106 | 107 | 108 | 109 |

Request Log: #arguments.req.log# 110 |   (clear) 111 |

112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 |
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#
Application Name#singleLog.applicationName#
Thread#singleLog.threadName#
161 | 162 | Log not found?
163 |
164 |
165 |
166 | 167 |
168 | 169 |
170 |
171 | 172 | 173 | 174 | local.delim = ""; 175 | local.offset = 0; 176 | local.pLen = listLen( arguments.req.url, "/" ); 177 | local.p = 0; 178 | local.urlFragments = this.Perf.splitUrl(arguments.req.url); 179 | //dump(local.urlFragments); 180 | 181 | 182 | 183 |

URL: 184 | 185 | 187 | #delim# #encodeForHtml( local.v )# 188 | 189 | 190 | 191 |   (clear) 192 |

193 |
194 |
195 |
196 |
197 | 198 | 199 | 200 | local.delim = ""; 201 | local.offset = 0; 202 | local.pLen=listLen( arguments.req.template, "\/" ); 203 | local.p = 0; 204 | 205 | 206 | 207 | 208 |

211 | #ListLast( arguments.req.template, "\/" )# 212 | 213 |

214 | 215 |
216 |

217 | 218 | 219 | 220 | 221 | 222 | #delim# 223 | 225 | #encodeForHtml( folder )# 226 | 227 | 228 | 229 | local.offset += len( local.folder ) +1; 230 | delim = server.separator.file; 231 | 232 | 233 |   (clear) 234 |

235 |
236 |
237 |
238 |
239 | 240 |
241 | 242 | 243 | 244 | #ucFirst(report)# 245 | 246 | 247 | 248 | 249 |
250 |
251 | 252 | 253 |

Filter: Only reporting logs since #DateTimeFormat( arguments.req.since )# 254 | 255 | (remove filter) 256 | 257 |

258 |
259 | 260 |

Refresh with only new logs 261 | 262 | #LSDateTimeFormat( lastLogDate )# 263 | 264 |

265 |
266 |
-------------------------------------------------------------------------------- /source/cfml/plugins/perf.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | this.debugLogs = []; 3 | this.debugLogsIndex = {}; 4 | this.filtered = false; 5 | variables.cfquery =""; 6 | 7 | public void function init ( required string adminType, required string password ){ 8 | variables.adminType = arguments.adminType; 9 | variables.password = arguments.password; 10 | 11 | this.debugLogs = getRawDebugLogs(); 12 | 13 | timer label="prepare Logs" { 14 | loop from="#this.debugLogs.len()#" to="1" step=-1 index="local.i" { 15 | if ( !StructKeyExists( this.debugLogs[i], "scope" ) ) 16 | this.debugLogs[ i ]["scope"].scope.cgi = local.log.cgi; // pre 5.3++ 17 | if ( !StructKeyExists( this.debugLogs[i], "size" ) ) 18 | this.debugLogs[ i ]["size"] = SizeOf( this.debugLogs[i] ); // expensive, do it once (cheeky, debug logs are writeable) 19 | this.debugLogsIndex[ this.debugLogs[i].id ] = i; 20 | } 21 | } 22 | if (IsNull(this.debugLogs)) 23 | this.debugLogs = []; 24 | } 25 | 26 | public array function getRawDebugLogs(){ 27 | admin action="getLoggedDebugData" 28 | type="#variables.adminType#" 29 | password="#variables.password#" 30 | returnVariable="local.debugLogs"; 31 | return debugLogs; 32 | } 33 | 34 | public void function purgeLogs(){ 35 | try { 36 | admin action="purgeDebugPool" 37 | type="#variables.adminType#" 38 | password="#variables.password#"; 39 | this.debugLogs = []; 40 | } catch ( e ){ 41 | ``` 42 | 43 | Sorry, Purge logs failed, it was added in Lucee 5.3.8.80 (this is #server.lucee.version#) 44 | 45 | 46 | 47 | ``` 48 | } 49 | } 50 | 51 | public struct function splitUrl( requestUrl ){ 52 | var frags = [=]; // ordered 53 | var offset = 0; 54 | var str = ""; 55 | var doubleSlash = find( "//", arguments.requestUrl ); 56 | var singleSlash = find( "/", arguments.requestUrl, doubleSlash + 2 ); 57 | var qs = find( "?", arguments.requestUrl); 58 | if (singleSlash eq 0 ){ 59 | frags[ arguments.requestUrl ] = arguments.requestUrl; 60 | } else { 61 | var f = Mid( arguments.requestUrl, 1, singleSlash ); 62 | frags[f] = f; 63 | offset = singleSlash + 1; 64 | if ( len( arguments.requestUrl ) gt offset){ 65 | if (qs gt 0){ 66 | str = Mid( arguments.requestUrl, offset, qs - offset ); 67 | } else { 68 | str = Mid( arguments.requestUrl, offset ); 69 | } 70 | 71 | if ( Len(str) gt 0 ){ 72 | loop list="#str#" item="folder" delimiters="/" { 73 | f = f & folder; 74 | frags[ f ] = folder; 75 | } 76 | } 77 | } 78 | 79 | } 80 | if ( qs gt 0 ){ 81 | frags[ arguments.requestUrl ] = Mid( arguments.requestUrl, qs ); 82 | } 83 | /* 84 | dump(local); 85 | dump(arguments); 86 | abort; 87 | */ 88 | return frags; 89 | 90 | }; 91 | 92 | public string function getHost( string requestUrl ){ 93 | local.doubleSlash = Find( "//", arguments.requestUrl ); 94 | if ( doubleSlash gte 0 ){ 95 | local.singleSlash = Find( "/", arguments.requestUrl, doubleSlash + 2 ); 96 | if ( singleSlash gt 0 ) 97 | return Mid( arguments.requestUrl, 1, singleSlash ); 98 | } 99 | return arguments.requestUrl; 100 | } 101 | 102 | public struct function getLog( string logId ){ 103 | if ( StructKeyExists( this.debugLogsIndex, arguments.logId ) 104 | && ArrayIndexExists( this.debugLogs, this.debugLogsIndex[ arguments.logId ])) 105 | return this.debugLogs[ this.debugLogsIndex[ arguments.logId ] ]; 106 | else 107 | return {}; 108 | 109 | } 110 | 111 | public struct function getLogs(struct req={}, string logType=""){ 112 | var reqUrl = arguments.req?.url?: ""; 113 | var reqTemplate = arguments.req?.template?: ""; 114 | var reqLog = arguments.req?.log?: ""; 115 | if ( IsNull( reqUrl ) && logType == ""){ 116 | return local.debugLogs; 117 | } else { 118 | if ( len( reqLog ) gt 0 ){ 119 | local.logs = this.debugLogs.filter(function(row){ 120 | return arguments.row.id eq reqLog; 121 | }); 122 | } else if ( len( reqUrl ) gt 0 ){ 123 | timer label="logs filter reqUrl(#reqUrl#)" { 124 | local.logs = this.debugLogs.filter(function(row){ 125 | return arguments.row.scope.cgi.REQUEST_URL contains variables.reqUrl; 126 | }); 127 | } 128 | } else { 129 | local.logs = this.debugLogs; 130 | } 131 | request.hiddenPerfAnalyzerOwnLogs = 0; 132 | // hide performance analyzer 133 | if ( application.applicationName eq "lucee-performance-analzyer" ){ 134 | var perfUrl = ListFirst( cgi.REQUEST_URL, "?" ); 135 | local.logs = local.logs.filter( function( row ){ 136 | var notPerfAnalyzer = arguments.row.scope.cgi.REQUEST_URL does not contain variables.perfUrl; 137 | if (notPerfAnalyzer){ 138 | return true; 139 | } else { 140 | request.hiddenPerfAnalyzerOwnLogs++; 141 | return false; 142 | } 143 | 144 | }); 145 | } 146 | 147 | return getFilteredLogs( logs, reqTemplate, arguments.logType ); 148 | } 149 | } 150 | 151 | public numeric function getRawLogCount(){ 152 | return ArrayLen( this.debugLogs ); 153 | } 154 | 155 | public string function getDebugMemUsage(){ 156 | local.s = 0; 157 | loop from="#this.debugLogs.len()#" to="1" step=-1 index="local.i" { 158 | local.s += this.debugLogs[ local.i ].size; 159 | } 160 | return DecimalFormat( local.s / 1024 / 1024 ) & " Mb"; 161 | } 162 | 163 | public struct function getFilteredLogs( logs, reqTemplate, logType ){ 164 | local.q = false; 165 | timer label="getFilteredLogs:#arguments.logType#" { 166 | switch (arguments.logType){ 167 | case "timers": 168 | local.result = getTimers( arguments.logs ); 169 | break; 170 | case "pages": 171 | local.result = getPages( arguments.logs ); 172 | break; 173 | case "parts": 174 | local.result = getParts( arguments.logs ); 175 | break; 176 | case "exceptions": 177 | local.result = getExceptions( arguments.logs ); 178 | break; 179 | case "scopes": 180 | local.result = getScopes( arguments.logs ); 181 | break; 182 | case "queries": 183 | local.result = getQueries( arguments.logs ); 184 | break; 185 | case "logs": 186 | local.result = getDebugLogs( arguments.logs ); 187 | break; 188 | case "dumps": 189 | local.result = getDumps( arguments.logs ); 190 | break; 191 | case "aborts": 192 | local.result = getAborts( arguments.logs ); 193 | break; 194 | case "traces": 195 | local.result = getTraces( arguments.logs ); 196 | break; 197 | default: 198 | throw "write code zac! [#arguments.logType#]"; 199 | } 200 | } 201 | result.sourceRows = local.result.q.recordcount; 202 | 203 | if ( len( arguments.reqTemplate ) gt 0 ){ 204 | this.reqTemplate = arguments.reqTemplate; 205 | timer label="query.filter reqTemplate(#arguments.reqTemplate#)"{ 206 | local.result.q = local.result.q.filter( function( row ){ 207 | return arguments.row.template contains this.reqTemplate; 208 | }); 209 | } 210 | } 211 | 212 | return local.result; 213 | } 214 | 215 | // TODO since 216 | 217 | public struct function getTimers( required array logs ){ 218 | var q_timers = QueryNew( "label,time,executions,template,line,requestUrl" ); 219 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 220 | local.log = arguments.logs[local.i]; 221 | if ( structKeyExists( local.log, "timers") ){ 222 | local.timers = local.log.timers; 223 | loop query="#local.timers#" { 224 | local.r = queryAddRow( q_timers, queryRowData( local.timers, local.timers.currentrow ) ); 225 | QuerySetCell( q_timers, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 226 | } 227 | } 228 | } 229 | ``` 230 | 231 | select label, sum(time) as totalTime, count(*) as executions, template, line, 232 | min(time) as minTime, max(time) as maxTime, avg(time) as avgTime 233 | from q_timers 234 | group by label, template, line 235 | order by totalTime desc 236 | 237 | ``` 238 | return { 239 | q: q_timers 240 | }; 241 | } 242 | 243 | public struct function getPages( required array logs ){ 244 | var q = QueryNew('id,count,min,max,avg,app,load,query,total,src,template,requestUrl'); 245 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 246 | local.log = arguments.logs[local.i]; 247 | if ( StructKeyExists( local.log, "pages" )){ 248 | local.pages=local.log.pages; 249 | loop query="#local.pages#" { 250 | local.r = queryAddRow( q, queryRowData( local.pages, local.pages.currentrow ) ); 251 | QuerySetCell( q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 252 | QuerySetCell( q, "template", local.q.src[r], local.r ); 253 | } 254 | } 255 | } 256 | 257 | ``` 258 | 259 | select id, count as _count, min as _min, max as _max, avg as _avg, app, load, query, total, src, '' as template, '' as _function 260 | from q 261 | 262 | 263 | loop query="q_pages" { 264 | local.tmp = ListToArray( local.q_pages.src, "$" ); 265 | if ( ArrayLen( local.tmp ) eq 2 ){ 266 | QuerySetCell( q_pages, "_function", local.tmp[2], q_pages.currentrow ); 267 | } 268 | QuerySetCell( q_pages, "template", local.tmp[1], q_pages.currentrow ); 269 | } 270 | 271 | 272 | 273 | select template, _function, min(_min) as minTime, max(_max) as maxTime, avg(_avg) as avgTime, 274 | avg(query) as avgQuery, avg(load) as avgLoad, sum(total) as totalTime, sum(_count) as totalCount, 275 | sum(total) as total, count(*) as executions 276 | from q_pages 277 | group by template, _function 278 | order by totalTime desc 279 | 280 | ``` 281 | 282 | return { 283 | q: q_pages 284 | }; 285 | } 286 | 287 | public struct function getParts( required array logs ){ 288 | var q = QueryNew('id,count,min,max,avg,total,path,start,end,startLine,endLine,snippet,template,requestUrl,lines'); 289 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 290 | local.log = arguments.logs[local.i]; 291 | 292 | if ( StructKeyExists( local.log, "pageParts" )){ 293 | local.parts=local.log.pageParts; 294 | loop query="#local.parts#" { 295 | local.r = queryAddRow( q, queryRowData( local.parts, local.parts.currentrow ) ); 296 | QuerySetCell( q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 297 | QuerySetCell( q, "template", local.q.path[r], local.r ); 298 | QuerySetCell( q, "lines", "#local.q.startline[r]# - #local.q.endline[r]#", local.r ); 299 | } 300 | } 301 | } 302 | // QoQ doesn't like count 303 | ``` 304 | 305 | 306 | select id, count as _count, min as _min, max as _max, avg as _avg, 307 | total, path, start, end as _end, startLine, endLine, snippet, template, requestUrl, lines 308 | from q 309 | 310 | 311 | 312 | select template, lines, min(_min) as minTime, max(_max) as maxTime, avg(_avg) as avgTime, 313 | sum(total) as totalTime, sum(_count) as totalCount, 314 | sum(total) as total, count(*) as executions, snippet, start, _end 315 | from q_parts 316 | group by template, lines, snippet, start, _end 317 | order by totalTime desc 318 | 319 | ``` 320 | return { 321 | q: q_parts 322 | }; 323 | } 324 | 325 | public struct function getScopes( required array logs ){ 326 | var q_scopes = QueryNew( "template,line,scope,count,name,requestUrl" ); 327 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 328 | local.log = arguments.logs[local.i]; 329 | // if implicitAccess isn't enabled in debug settings, there won't be data 330 | if (structKeyExists( local.log, "implicitAccess" )){ 331 | local.implicitAccess = local.log.implicitAccess; 332 | loop query="#local.implicitAccess#" { 333 | QueryAddRow( q_scopes, QueryRowData( local.implicitAccess, local.implicitAccess.currentrow ) ); 334 | } 335 | } 336 | } 337 | 338 | ``` 339 | 340 | select template, line, scope as resolvedScope, count as total ,name 341 | from q_scopes 342 | 343 | 344 | 345 | select template, line, resolvedScope, sum(total) total ,name 346 | from q_scopes 347 | group by template, line, resolvedScope, name 348 | order by total desc 349 | 350 | ``` 351 | 352 | return { 353 | q: q_scopes 354 | }; 355 | } 356 | 357 | public struct function getExceptions( required array logs ){ 358 | var q = QueryNew( "_type,message,detail,template,line,requestUrl" ); 359 | 360 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 361 | local.log = arguments.logs[local.i]; 362 | // if exceptions isn't enabled in debug settings, there won't be data 363 | if ( StructKeyExists( local.log, "exceptions" ) ){ 364 | local.exceptions = local.log.exceptions; 365 | loop array="#local.exceptions#" item="local.exp"{ 366 | local.r = QueryAddRow( q ); 367 | QuerySetCell( local.q, "_type", exp.type, r ); 368 | QuerySetCell( local.q, "message", exp.message, r ); 369 | QuerySetCell( local.q, "detail", exp.detail, r ); 370 | if ( arrayLen(exp.TagContext) ) { 371 | QuerySetCell( local.q, "line", exp.TagContext[1].line, r ); 372 | QuerySetCell( local.q, "template", exp.TagContext[1].template, r ); 373 | } 374 | QuerySetCell( local.q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 375 | } 376 | } 377 | } 378 | ``` 379 | 380 | select _type, template, message, detail, line, count(*) as executions 381 | from q 382 | group by _type, template, message, detail, line 383 | order by executions desc 384 | 385 | ``` 386 | return { 387 | q: local.q_exceptions 388 | }; 389 | } 390 | 391 | public struct function getDumps( required array logs ){ 392 | var q = QueryNew( "output,template,line,requestUrl", "clob,varchar,integer,varchar" ); 393 | 394 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 395 | local.log = arguments.logs[local.i]; 396 | // if exceptions isn't enabled in debug settings, there won't be data 397 | if ( StructKeyExists( local.log, "dumps" ) ){ 398 | local.dumps = local.log.dumps; 399 | loop query="#local.dumps#"{ 400 | local.r = QueryAddRow( q, QueryRowData( local.dumps, local.dumps.currentrow ) ); 401 | QuerySetCell( q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 402 | } 403 | } 404 | } 405 | ``` 406 | 407 | select output, template, line, requestUrl, count(*) as dumps 408 | from q 409 | group by output, template, line, requestUrl 410 | order by dumps desc 411 | 412 | ``` 413 | return { 414 | q: q_dumps 415 | }; 416 | } 417 | //KeyConstants._type, KeyConstants._category, KeyConstants._text, KeyConstants._template, KeyConstants._line, 418 | //KeyConstants._action, KeyConstants._varname, KeyConstants._varvalue, KeyConstants._time 419 | 420 | public struct function getTraces( required array logs ){ 421 | var q = QueryNew( "type,category,text,template,line,action,var,varValue,time,requestUrl" ); 422 | 423 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 424 | local.log = arguments.logs[local.i]; 425 | // if exceptions isn't enabled in debug settings, there won't be data 426 | if ( StructKeyExists( local.log, "traces" ) ){ 427 | local.traces = local.log.traces; 428 | loop query="#local.traces#"{ 429 | local.r = QueryAddRow( q, queryRowData(local.traces, local.traces.currentrow ) ); 430 | QuerySetCell( q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 431 | } 432 | } 433 | } 434 | ``` 435 | 436 | select type, category, text, template, line, action, var, varValue, time, requestUrl, count(*) as executions 437 | from q 438 | group by type, category, text, template, line, action, var, varValue, time, requestUrl 439 | order by executions desc 440 | 441 | ``` 442 | return { 443 | q: q_traces 444 | }; 445 | } 446 | 447 | public struct function getAborts( required array logs ){ 448 | var q = QueryNew( "template,line,requestUrl" ); 449 | 450 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 451 | local.log = arguments.logs[local.i]; 452 | // if exceptions isn't enabled in debug settings, there won't be data 453 | if ( StructKeyExists( local.log, "abort" ) ){ 454 | local.abort = local.log.abort; 455 | local.r = QueryAddRow( q ); 456 | QuerySetCell( q, "template", local.abort.template, r ); 457 | QuerySetCell( q, "line", local.abort.line, r ); 458 | QuerySetCell( q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 459 | } 460 | } 461 | ``` 462 | 463 | select template, line, requestUrl, count(*) as executions 464 | from q 465 | group by template, line, requestUrl 466 | order by executions desc 467 | 468 | ``` 469 | return { 470 | q: q_aborts 471 | }; 472 | } 473 | 474 | public struct function getQueries( required array logs ){ 475 | var q = QueryNew( "name,time,sql,src,line,count,datasource,usage,cacheType,requestUrl,template" ); 476 | 477 | loop from="#arguments.logs.len()#" to="1" step=-1 index="local.i" { 478 | local.log = arguments.logs[local.i]; 479 | // if queries isn't enabled in debug settings, there won't be data 480 | if ( StructKeyExists( local.log, "queries" ) ){ 481 | local.queries=local.log.queries; 482 | loop query="#local.queries#" { 483 | local.r = QueryAddRow( q, QueryRowData(local.queries, local.queries.currentrow) ); 484 | QuerySetCell( q, "template", local.q.src[r], r ); 485 | QuerySetCell( q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 486 | } 487 | } 488 | } 489 | // QoQ doesn't like count 490 | ``` 491 | 492 | select name, time, sql, src as template, line, count as total, datasource, cacheType 493 | from q 494 | 495 | 496 | 497 | select name, sum(time) as totalTime, min(time) as minTime, max(time) as maxTime, avg(time) as avgTime, 498 | template,line, sum(total) as total, datasource, cacheType, count(*) as executions 499 | from local.q_queries 500 | group by name, template, line, datasource, cacheType 501 | order by totalTime desc 502 | 503 | ``` 504 | 505 | return { 506 | q: q_queries 507 | }; 508 | } 509 | 510 | public struct function getDebugLogs( required array logs ){ 511 | var q = QueryNew( "template,requestUrl,path,total,query,load,app,scope,exceptions,starttime,id,size,isThread,threadName,statusCode,ContentType,ContentLength" ); 512 | local.totals = { 513 | app = 0, 514 | query: 0, 515 | total: 0, 516 | load: 0, 517 | size: 0, 518 | scope: 0, 519 | exceptions: 0 520 | }; 521 | local.log = {}; 522 | local.rows = 0; 523 | loop from="#arguments.logs.len()#" to="1" step="-1" index="local.i" { 524 | local.log = arguments.logs[local.i]; 525 | local.rows ++; 526 | //dump(local.log); 527 | local.cgi = local.log.scope.cgi; 528 | var path = local.cgi.REQUEST_URL 529 | 530 | if ( ( local.cgi.REQUEST_METHOD ?: "" ) eq "POST" ) 531 | path = "POST #PATH#"; 532 | 533 | var _scope = "0"; 534 | if ( StructKeyExists( local.log, "implicitAccess" ) and local.log.implicitAccess.recordcount ){ 535 | _scope = QueryReduce( local.log.implicitAccess, 536 | function( problems=0, row, rowNumber, recordset ){ 537 | return arguments.problems + arguments.row.count; 538 | } 539 | ); 540 | } 541 | var _total=0; 542 | var _query=0; 543 | var _app=0; 544 | var _load=0; 545 | var _exp=0 546 | if ( StructKeyExists( local.log, "pages" ) ){ 547 | loop query="local.log.pages"{ 548 | _total += local.log.pages.total; 549 | _query+= local.log.pages.query; 550 | _app += local.log.pages.app; 551 | _load += local.log.pages.load; 552 | } 553 | } 554 | 555 | if (StructKeyExists( local.log, "exceptions" ) ) 556 | _exp += ArrayLen( local.log.exceptions ); 557 | 558 | 559 | local.r = QueryAddRow( q ); 560 | QuerySetCell( local.q, "size", log.size, local.r ); 561 | QuerySetCell( local.q, "id", log.id, local.r ); 562 | QuerySetCell( local.q, "starttime", log.starttime, local.r ); 563 | QuerySetCell( local.q, "template", local.cgi.script_name, local.r ); 564 | QuerySetCell( local.q, "path", path, local.r ); 565 | QuerySetCell( local.q, "total", _total, local.r ); 566 | QuerySetCell( local.q, "query", _query, local.r ); 567 | QuerySetCell( local.q, "load", _load, local.r ); 568 | QuerySetCell( local.q, "app", _app, local.r ); 569 | QuerySetCell( local.q, "scope", _scope, local.r ); 570 | QuerySetCell( local.q, "exceptions", _exp, local.r ); 571 | QuerySetCell( local.q, "requestUrl", local.log.scope.cgi.REQUEST_URL, local.r ); 572 | QuerySetCell( local.q, "isThread", ( Len( local.log.scope.cgi.HTTP_USER_AGENT ) eq 0 ), local.r ); 573 | QuerySetCell( local.q, "threadName", local.log.threadName ?: "", local.r ); 574 | 575 | if ( StructKeyExists( log, "statusCode" ) ) 576 | QuerySetCell( local.q, "statusCode", log.statusCode, local.r ); 577 | if ( StructKeyExists( log, "ContentType" ) ) 578 | QuerySetCell( local.q, "ContentType", log.ContentType, local.r ); 579 | if ( StructKeyExists( log, "ContentLength" ) ) 580 | QuerySetCell( local.q, "ContentLength", log.ContentLength, local.r ); 581 | 582 | local.totals.size += + local.log.size / 1000; 583 | local.totals.app += _app; 584 | local.totals.query += _query; 585 | local.totals.total += _total; 586 | local.totals.load += _load; 587 | local.totals.scope += _scope; 588 | local.totals.exceptions += _exp; 589 | } 590 | return { 591 | totals: local.totals, 592 | q: local.q 593 | }; 594 | } 595 | } -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 489 | 490 | Also add information on how to contact you by electronic and paper mail. 491 | 492 | You should also get your employer (if you work as a programmer) or your 493 | school, if any, to sign a "copyright disclaimer" for the library, if 494 | necessary. Here is a sample; alter the names: 495 | 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 498 | 499 | , 1 April 1990 500 | Ty Coon, President of Vice 501 | 502 | That's all there is to it! -------------------------------------------------------------------------------- /source/cfml/plugins/js/jquery-3.6.0.slim.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.6.0 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector | (c) OpenJS Foundation and other contributors | jquery.org/license */ 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(g,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,v=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),m={},b=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},w=g.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function C(e,t,n){var r,i,o=(n=n||w).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function T(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector",E=function(e,t){return new E.fn.init(e,t)};function d(e){var t=!!e&&"length"in e&&e.length,n=T(e);return!b(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+R+")"+R+"*"),U=new RegExp(R+"|>"),V=new RegExp(W),X=new RegExp("^"+B+"$"),Q={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,G=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){C()},ae=xe(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(t=P.call(d.childNodes),d.childNodes),t[d.childNodes.length].nodeType}catch(e){O={apply:t.length?function(e,t){q.apply(e,P.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,d=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==d&&9!==d&&11!==d)return n;if(!r&&(C(e),e=e||T,E)){if(11!==d&&(u=Z.exec(t)))if(i=u[1]){if(9===d){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return O.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&p.getElementsByClassName&&e.getElementsByClassName)return O.apply(n,e.getElementsByClassName(i)),n}if(p.qsa&&!k[t+" "]&&(!v||!v.test(t))&&(1!==d||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===d&&(U.test(t)||_.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&p.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=A)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+be(l[o]);c=l.join(",")}try{return O.apply(n,f.querySelectorAll(c)),n}catch(e){k(t,!0)}finally{s===A&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>x.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[A]=!0,e}function ce(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)x.attrHandle[n[r]]=t}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function pe(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in p=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},C=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:d;return r!=T&&9===r.nodeType&&r.documentElement&&(a=(T=r).documentElement,E=!i(T),d!=T&&(n=T.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),p.scope=ce(function(e){return a.appendChild(e).appendChild(T.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),p.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),p.getElementsByTagName=ce(function(e){return e.appendChild(T.createComment("")),!e.getElementsByTagName("*").length}),p.getElementsByClassName=J.test(T.getElementsByClassName),p.getById=ce(function(e){return a.appendChild(e).id=A,!T.getElementsByName||!T.getElementsByName(A).length}),p.getById?(x.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},x.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(x.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},x.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),x.find.TAG=p.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):p.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},x.find.CLASS=p.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(p.qsa=J.test(T.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+R+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+A+"-]").length||v.push("~="),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+R+"*name"+R+"*="+R+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+A+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=T.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+R+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(p.matchesSelector=J.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){p.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",W)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=J.test(a.compareDocumentPosition),y=t||J.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!p.sortDetached&&t.compareDocumentPosition(e)===n?e==T||e.ownerDocument==d&&y(d,e)?-1:t==T||t.ownerDocument==d&&y(d,t)?1:u?H(u,e)-H(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==T?-1:t==T?1:i?-1:o?1:u?H(u,e)-H(u,t):0;if(i===o)return de(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?de(a[r],s[r]):a[r]==d?-1:s[r]==d?1:0}),T},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(C(e),p.matchesSelector&&E&&!k[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||p.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){k(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return b(n)?E.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?E.grep(e,function(e){return e===n!==r}):"string"!=typeof n?E.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(E.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||L,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:j.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:w,!0)),k.test(r[1])&&E.isPlainObject(t))for(r in t)b(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=w.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):b(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this)}).prototype=E.fn,L=E(w);var q=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,pe=/^$|^module$|\/(?:java|ecma)script/i;le=w.createDocumentFragment().appendChild(w.createElement("div")),(ce=w.createElement("input")).setAttribute("type","radio"),ce.setAttribute("checked","checked"),ce.setAttribute("name","t"),le.appendChild(ce),m.checkClone=le.cloneNode(!0).cloneNode(!0).lastChild.checked,le.innerHTML="",m.noCloneChecked=!!le.cloneNode(!0).lastChild.defaultValue,le.innerHTML="",m.option=!!le.lastChild;var he={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ge(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&S(e,t)?E.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var ye=/<|&#?\w+;/;function me(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),d=[],p=0,h=e.length;p\s*$/g;function ke(e,t){return S(e,"table")&&S(11!==t.nodeType?t:t.firstChild,"tr")&&E(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function je(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n
",2===lt.childNodes.length),E.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(m.createHTMLDocument?((r=(t=w.implementation.createHTMLDocument("")).createElement("base")).href=w.location.href,t.head.appendChild(r)):t=w),o=!n&&[],(i=k.exec(e))?[t.createElement(i[1])]:(i=me([e],t,o),o&&o.length&&E(o).remove(),E.merge([],i.childNodes)));var r,i,o},E.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=E.css(e,"position"),c=E(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=E.css(e,"top"),u=E.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),b(t)&&(t=t.call(e,n,E.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){E.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===E.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===E.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=E(e).offset()).top+=E.css(e,"borderTopWidth",!0),i.left+=E.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-E.css(r,"marginTop",!0),left:t.left-i.left-E.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===E.css(e,"position"))e=e.offsetParent;return e||re})}}),E.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;E.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),E.each(["top","left"],function(e,n){E.cssHooks[n]=Me(m.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?E(e).position()[n]+"px":t})}),E.each({Height:"height",Width:"width"},function(a,s){E.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){E.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?E.css(e,t,i):E.style(e,t,n,i)},s,n?e:void 0,n)}})}),E.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),E.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){E.fn[n]=function(e,t){return 0