-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- dt_format.luau is used for the luau_multi benchmark - turnaround_time.luau is used for the luau_script benchmark - benchmark_aggregations.luau is used by the benchmark shell script to compute recs_per_sec and to aggregate mean to total_mean
- Loading branch information
1 parent
c146cf7
commit cb28ea3
Showing
3 changed files
with
45 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,26 @@ | ||
-- this is the BEGIN block, which is executed once before the main loop | ||
BEGIN { | ||
-- we initialize the variables here | ||
total_mean = 0; | ||
benchmark_data_rowcount=tonumber(qsv_getenv("QSVBM_ROWCOUNT")); | ||
|
||
-- and setup helper functions | ||
-- this one is to round a number to a given number of decimal places | ||
function round(num, numDecimalPlaces) | ||
return string.format("%." .. (numDecimalPlaces or 0) .. "f", num) | ||
end | ||
}! | ||
|
||
-- this is the main loop, which is executed for each row | ||
work_var = benchmark_data_rowcount / mean; | ||
total_mean = total_mean + mean; | ||
|
||
recs_per_sec=string.format("%.0f",work_var); | ||
return recs_per_sec; | ||
|
||
-- this is the end block, which is executed once after the main loop | ||
END { | ||
-- we return the total_mean here | ||
-- note that this value is returned to stderr | ||
return round(total_mean, 3); | ||
}! |
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,8 @@ | ||
local date = require "date"; | ||
|
||
createdate = date(col["Created Date"]); | ||
|
||
dayofweek = createdate:fmt('%a'); | ||
hourofday = createdate:fmt('%H'); | ||
weeknumber = createdate:fmt('%W'); | ||
return {dayofweek, hourofday, weeknumber}; |
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,11 @@ | ||
-- compute Turnaround Time for NYC 311 Benchmark data | ||
local date = require "date" | ||
|
||
if (string.len(col["Created Date"]) == 0 or string.len(col["Closed Date"]) == 0) then | ||
return | ||
end | ||
|
||
local t_sdate = date(col["Created Date"]) | ||
local t_edate = date(col["Closed Date"]) | ||
local t_diff = date.diff(t_edate, t_sdate) | ||
return t_diff:spandays() |