Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Initial addition of cfml-lucee (#6325)
* Initial addition of cfml-lucee * Additional tests * remove debuggingn port * Expose port and pin docker image
- Loading branch information
Showing
11 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# CFML Lucee Benchmarking Test | ||
|
||
### Test Type Implementation Source Code | ||
|
||
* [JSON](src/json.cfm) | ||
* [PLAINTEXT](src/plaintext.cfm) | ||
* [DB](src/db.cfm) | ||
* [QUERY](src/query.cfm) | ||
* [CACHED QUERY](src/cached_query.cfm) | ||
* [UPDATE](src/update.cfm) | ||
* [FORTUNES](src/fortunes.cfm) | ||
|
||
## Important Libraries | ||
The tests were run with: | ||
* [CommandBox](https://commandbox.ortusbooks.com/) | ||
* [ortussolutions/commandbox Docker image](https://hub.docker.com/r/ortussolutions/commandbox/) | ||
* [Lucee Server](https://www.lucee.org/) | ||
|
||
## Test URLs | ||
### JSON | ||
|
||
http://localhost:8080/json.cfm | ||
|
||
### PLAINTEXT | ||
|
||
http://localhost:8080/plaintext.cfm | ||
|
||
### DB | ||
|
||
http://localhost:8080/db.cfm | ||
|
||
### QUERY | ||
|
||
http://localhost:8080/query.cfm?queries= | ||
|
||
### CACHED QUERY | ||
|
||
http://localhost:8080/cached_query.cfm?queries= | ||
|
||
### UPDATE | ||
|
||
http://localhost:8080/update.cfm?queries= | ||
|
||
### FORTUNES | ||
|
||
http://localhost:8080/fortunes.cfm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"framework": "cfml-lucee", | ||
"tests": [ | ||
{ | ||
"default": { | ||
"json_url": "/json.cfm", | ||
"db_url": "/db.cfm", | ||
"query_url":"/queries.cfm?queries=", | ||
"fortune_url": "/fortunes.cfm", | ||
"plaintext_url": "/plaintext.cfm", | ||
"update_url": "/updates.cfm?queries=", | ||
"port": 8080, | ||
"approach": "Realistic", | ||
"classification": "Platform", | ||
"database": "Postgres", | ||
"framework": "None", | ||
"language": "CFML", | ||
"flavor": "None", | ||
"orm": "raw", | ||
"platform": "None", | ||
"webserver": "None", | ||
"os": "Linux", | ||
"database_os": "Linux", | ||
"display_name": "cfml-lucee", | ||
"notes": "", | ||
"versus": "None" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM ortussolutions/commandbox:3.2.1 | ||
|
||
COPY ./src/server.json /app/server.json | ||
COPY ./src/.cfconfig.json /app/.cfconfig.json | ||
|
||
RUN box install commandbox-cfconfig --verbose --force | ||
|
||
RUN ${BUILD_DIR}/util/warmup-server.sh | ||
|
||
RUN export FINALIZE_STARTUP=true;$BUILD_DIR/run.sh;unset FINALIZE_STARTUP | ||
|
||
EXPOSE 8080 | ||
|
||
COPY ./src /app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"datasources":{ | ||
"world":{ | ||
"database":"hello_world", | ||
"dbdriver":"PostgreSQL", | ||
"host":"tfb-database", | ||
"password":"benchmarkdbpass", | ||
"port":"5432", | ||
"username":"benchmarkdbuser" | ||
} | ||
}, | ||
"inspectTemplate":"never", | ||
"maxCFThreads":"512" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<cfsetting enablecfoutputonly=true> | ||
<cfheader name="Server" value="cfml-lucee"> | ||
<cfheader name="Content-Type" value="application/json"> | ||
<cfquery name="qry" datasource="world" returntype="array"> | ||
SELECT id, randomNumber | ||
FROM World | ||
WHERE id = <cfqueryparam value="#randRange( 1, 10000 )#" cfsqltype="integer"> | ||
</cfquery> | ||
<cfoutput>#serializeJSON( qry[ 1 ] )#</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<cfsetting enablecfoutputonly=true> | ||
<cfheader name="Server" value="cfml-lucee"> | ||
<cfheader name="Content-Type" value="text/html; charset=utf-8"> | ||
<cfquery name="qry" datasource="world" returntype="array"> | ||
SELECT id, message | ||
FROM Fortune | ||
</cfquery> | ||
<cfset qry.append( { 'id' : 0, 'message' : 'Additional fortune added at request time.' } )> | ||
<cfset qry = qry.sort( (a,b)=>compareNoCase(a.message,b.message) )> | ||
<cfoutput><!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr> | ||
<cfloop array="#qry#" index="row"><tr><td>#row.id#</td><td>#htmlEditFormat( row.message )#</td></tr></cfloop> | ||
</table></body></html> | ||
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<cfsetting enablecfoutputonly=true> | ||
<cfheader name="Server" value="cfml-lucee"> | ||
<cfheader name="Content-Type" value="application/json"> | ||
<cfoutput>#serializeJSON( { 'message' : 'Hello, World!' } )#</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<cfheader name="Server" value="cfml-lucee"> | ||
<cfheader name="Content-Type" value="text/plain"> | ||
<cfcontent reset="true">Hello, World! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<cfsetting enablecfoutputonly=true> | ||
<cfparam name="url.queries" default="1"> | ||
<cfset url.queries = val( url.queries )> | ||
<cfif url.queries gt 500 > | ||
<cfset url.queries = 500> | ||
<cfelseif url.queries lt 1 > | ||
<cfset url.queries = 1> | ||
</cfif> | ||
<cfheader name="Server" value="cfml-lucee"> | ||
<cfheader name="Content-Type" value="application/json"> | ||
<cfset results = []> | ||
<cfloop times="#url.queries#"> | ||
<cfquery name="qry" datasource="world" returntype="array"> | ||
SELECT id, randomNumber | ||
FROM World | ||
WHERE id = <cfqueryparam value="#randRange( 1, 10000 )#" cfsqltype="integer"> | ||
</cfquery> | ||
<cfset results.append( qry[ 1 ] )> | ||
</cfloop> | ||
<cfoutput>#serializeJSON( results )#</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"profile" : "none", | ||
"web" : { | ||
"maxRequests" : 512 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<cfsetting enablecfoutputonly=true> | ||
<cfparam name="url.queries" default="1"> | ||
<cfset url.queries = val( url.queries )> | ||
<cfif url.queries gt 500 > | ||
<cfset url.queries = 500> | ||
<cfelseif url.queries lt 1 > | ||
<cfset url.queries = 1> | ||
</cfif> | ||
<cfheader name="Server" value="cfml-lucee"> | ||
<cfheader name="Content-Type" value="application/json"> | ||
<cfset results = []> | ||
<cfloop times="#url.queries#"> | ||
<cfquery name="qry" datasource="world" returntype="array"> | ||
SELECT id, randomNumber | ||
FROM World | ||
WHERE id = <cfqueryparam value="#randRange( 1, 10000 )#" cfsqltype="integer"> | ||
</cfquery> | ||
<cfset results.append( { 'id' : qry[ 1 ].id, 'randomNumber' : randRange( 1, 1000 ) } )> | ||
</cfloop> | ||
<cfquery datasource="world"> | ||
update World as w set | ||
randomNumber = w2.randomNumber | ||
from (values | ||
#results.map( (r)=>"(#val( r.id )#, #val( r.randomNumber )#)" ).toList( ',' )# | ||
) as w2(id,randomNumber) | ||
where w2.id = w.id; | ||
</cfquery> | ||
<cfoutput>#serializeJSON( results )#</cfoutput> |