Skip to content

Commit

Permalink
add graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Jul 15, 2024
1 parent 9e1b2e7 commit 499055c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Simple benchmarking
name: Simple benchmarking

on:
workflow_dispatch:
Expand All @@ -10,10 +10,10 @@ jobs:
strategy:
fail-fast: true
max-parallel: 1
matrix:
luceeVersion: [ 5.4/snapshot/light, 6.0/snapshot/light ] #, 6.1/snapshot/light, 6.1.0/snapshot/light, 6.2/snapshot/light ]
matrix:
luceeVersion: [ 5.4/snapshot/light, 6.0/snapshot/light, 6.1/snapshot/light, 6.1.0/snapshot/light, 6.2/snapshot/light ]
javaVersion: [ 11, 21 ]
exclude:
exclude:
- luceeVersion: 5.4/snapshot/jar
javaVersion: 21
- luceeVersion: 6.0/snapshot/jar
Expand Down Expand Up @@ -86,5 +86,5 @@ jobs:
webroot: ${{ github.workspace }}/custom/benchmark
execute: /report.cfm
luceeVersionQuery: 5.4/stable/jar


41 changes: 40 additions & 1 deletion custom/benchmark/report.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,44 @@
}
}
function _logger( string message="", boolean throw=false ){
//systemOutput( arguments.message, true );
if ( !FileExists( server.system.environment.GITHUB_STEP_SUMMARY ) ){
fileWrite( server.system.environment.GITHUB_STEP_SUMMARY, "#### #server.lucee.version# ");
fileAppend( server.system.environment.GITHUB_STEP_SUMMARY, server.system.environment.toJson());
}
if ( arguments.throw ) {
fileAppend( server.system.environment.GITHUB_STEP_SUMMARY, "> [!WARNING]" & chr(10) );
fileAppend( server.system.environment.GITHUB_STEP_SUMMARY, "> #arguments.message##chr(10)#");
throw arguments.message;
} else {
fileAppend( server.system.environment.GITHUB_STEP_SUMMARY, " #arguments.message##chr(10)#");
}
}
systemOutput( serializeJSON( q, true) );
</cfscript>
</cfscript>

<cfloop list="none,once" item="_inspect">
<cfchart chartheight="500" chartwidth="1024" title="#_inspect# Benchmarks" format="png" name="graph">
<cfchartseries type="line" seriesLabel="Hello World">
<cfloop query="q">
<cfif q.type eq "hello-world" and q.inspect eq _inspect>
<cfchartdata item="#q.version# #q.java#" value="#q.time#">
</cfif>
</cfloop>
</cfchartseries>
<cfchartseries type="line" seriesLabel="Json">
<cfloop query="q">
<cfif q.type eq "json" and q.inspect eq _inspect>>
<cfchartdata item="#q.version# #q.java#" value="#q.time#">
</cfif>
</cfloop>
</cfchartseries>
</cfchart>
<cfscript>
_logger( "![#inspect# Benchmarks](data:image/png;base64,#toBase64( graph )#)" );
</cfscript>
</cfloop>

0 comments on commit 499055c

Please sign in to comment.