Skip to content

Commit

Permalink
Implemented new subdirectory for output CSVs to avoid clutter
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparen committed Jul 5, 2018
1 parent 6529ff3 commit 2b4c3d8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
5 changes: 2 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ AGGREGATE_LINE_OPACITY = GetAreaCommonData("dnhapm", "AggregateLineOpacity", 0.2

Basic configuration for the APM allows you to set the Event that is used to trigger writing the report (defaults to `EV_USER_STAGE + 2048`), the output directory of the report (defaults to `GetCurrentScriptDirectory() ~ "./dnhapm-output/"`), and the name of the script within the report (defaults to `"--Unnamed Script--"`).

Aggregate, if enabled, will load past data in the OUTPUT_DIRECTORY into the graphs (defaults to `true`). The Output Name field refers to the unique identifier for the script and is used in output file filenames - important for the aggregation feature. For example, you could use `SetAreaCommonData("dnhapm", "OutputName", SCRIPT_NAME)` to have all past runs of SCRIPT_NAME aggregate into the same file regardless of which player did the run, or you could choose to have different difficulties aggregate independently while sharing the same output folder for all reports.
Aggregate, if enabled, will load past data in `OUTPUT_DIRECTORY/apmcsv/` into the graphs (defaults to `true`). The Output Name field refers to the unique identifier for the script and is used in output file filenames - important for the aggregation feature. For example, you could use `SetAreaCommonData("dnhapm", "OutputName", SCRIPT_NAME)` to have all past runs of SCRIPT_NAME aggregate into the same file regardless of which player did the run, or you could choose to have different difficulties aggregate independently while sharing the same output folder for all reports.

GRAPH_SCALE is the scale of the x axis of the graph (defaults to `2`, or two pixel per second). This means that a 5 minute script will fit into 300 pixels at a scale of 1, or 600 pixels at a scale of 2 (default).

In regards to aggregate data, this program assumes that the settings for prior runs were the same (i.e. it assumes that update frequencies, graph scale, etc. were the same as the current run). Former runs will appear with opacity equal to AGGREGATE_LINE_OPACITY (defaults to alpha of 0.25).

It is recommended that you use a different output directory for each script to monitor. However, the APM supports using one directory for different scripts, as long as OUTPUT_NAME has been set.
It is recommended that you use a different output directory for each script to monitor. However, the APM supports using one directory for different scripts, as long as OUTPUT_NAME has been set. If not set while aggregation is enabled, data from other scripts may make its way into the report.

## Specific Configuration

Expand Down Expand Up @@ -238,7 +238,6 @@ Current:
* Step Monitoring (Nonspell and Spellcard Graph Overlays)

Planned:
* Item Monitoring (requires proper integrations)
* Combined graphs (stretch goal)

# Downloads
Expand Down
22 changes: 11 additions & 11 deletions SparenDNHAPM.dnh
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ let FEATURE_BOMBDEATH_TEXTSIZE; // Radius of the bullet text size, in pixels
/* ============================================================================== */
// For now, we will store notes per-run and will not save them to disk.
//let notefile = ObjFile_Create(OBJ_FILE_TEXT);
//let notefilepath = OUTPUT_DIRECTORY ~ "apmnote-" ~ SCRIPT_NAME ~ "_" ~ player ~ "_" ~ starttime ~ ".txt";
//let notefilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ "apmnote-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".txt";
//ObjFile_OpenNW(notefile, notefilepath);
let notestring = "";

Expand Down Expand Up @@ -233,7 +233,7 @@ function NotesToSVG {
/* ============================================================================== */
// For now, we will store steps per-run and will not save them to disk.
//let stepfile = ObjFile_Create(OBJ_FILE_TEXT);
//let stepfilepath = OUTPUT_DIRECTORY ~ "apmstep-" ~ SCRIPT_NAME ~ "_" ~ player ~ "_" ~ starttime ~ ".txt";
//let stepfilepath = OUTPUT_DIRECTORY ~ "apmstep-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".txt";
//ObjFile_OpenNW(stepfile, stepfilepath);
let stepstring = "";

Expand Down Expand Up @@ -286,7 +286,7 @@ function StepsToSVG {
task APM_StartFPS {
// Create output file
let outputfile = ObjFile_Create(OBJ_FILE_TEXT);
let outputfilepath = OUTPUT_DIRECTORY ~ "apmfps-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv";
let outputfilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ "apmfps-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv";
ObjFile_OpenNW(outputfile, outputfilepath);
let csvlog = ""; // CSV log
let counter = 0;
Expand Down Expand Up @@ -347,7 +347,7 @@ function APM_ChartGenFPS {
task APM_StartGraze {
// Create output file
let outputfile = ObjFile_Create(OBJ_FILE_TEXT);
let outputfilepath = OUTPUT_DIRECTORY ~ "apmgraze-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv";
let outputfilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ "apmgraze-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv";
ObjFile_OpenNW(outputfile, outputfilepath);
let csvlog = ""; // CSV log
let counter = 0;
Expand Down Expand Up @@ -408,7 +408,7 @@ function APM_ChartGenGraze {
task APM_StartScore {
// Create output file
let outputfile = ObjFile_Create(OBJ_FILE_TEXT);
let outputfilepath = OUTPUT_DIRECTORY ~ "apmscore-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv";
let outputfilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ "apmscore-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv";
ObjFile_OpenNW(outputfile, outputfilepath);
let csvlog = ""; // CSV log
let counter = 0;
Expand Down Expand Up @@ -469,7 +469,7 @@ function APM_ChartGenScore {
task APM_StartShotCount {
// Create output file
let outputfile = ObjFile_Create(OBJ_FILE_TEXT);
let outputfilepath = OUTPUT_DIRECTORY ~ "apmscount-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv";
let outputfilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ "apmscount-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv";
ObjFile_OpenNW(outputfile, outputfilepath);
let csvlog = ""; // CSV log
let counter = 0;
Expand Down Expand Up @@ -532,7 +532,7 @@ let bombdeathfilepath;

function LogBombDeath(bd) {
let newbd = IntToString(elapsedtime) ~ "," ~ bd;
bombdeathfilepath = OUTPUT_DIRECTORY ~ "apmbd-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".txt";
bombdeathfilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ "apmbd-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".txt";
ObjFile_OpenNW(bombdeathfile, bombdeathfilepath);
ObjFileT_AddLine(bombdeathfile, newbd);
ObjFile_Store(bombdeathfile);
Expand All @@ -548,8 +548,8 @@ function APM_ChartGenBombDeath {
let circles = [];
// First, we will determine the scale of the x axis and log all of the necessary files.
let maxtime = 0; // Will be scaled later
let currfilepath = OUTPUT_DIRECTORY ~ "apmbd-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".txt"; // Current run, for later reference
let filepathlist = GetFilePathList(OUTPUT_DIRECTORY);
let currfilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ "apmbd-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".txt"; // Current run, for later reference
let filepathlist = GetFilePathList(OUTPUT_DIRECTORY ~ "apmcsv/");
ascent(i in 0..length(filepathlist)) {
// First, retrieve the file name
let filename = parseFileName(filepathlist[i]);
Expand Down Expand Up @@ -649,8 +649,8 @@ function APM_ChartGenCommon(apmtype, updfreq, linecolor) {
// First, we will determine the scale of the x and y axes and log all of the necessary files.
let maxval = 0; // Maximum value of interest
let maxtime = 0; // Number of DATA POINTS collected - will be scaled later
let currfilepath = OUTPUT_DIRECTORY ~ apmtype ~ "-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv"; // Current run, for later reference
let filepathlist = GetFilePathList(OUTPUT_DIRECTORY);
let currfilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ apmtype ~ "-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv"; // Current run, for later reference
let filepathlist = GetFilePathList(OUTPUT_DIRECTORY ~ "apmcsv/");
ascent(i in 0..length(filepathlist)) {
// First, retrieve the file name
let filename = parseFileName(filepathlist[i]);
Expand Down
2 changes: 1 addition & 1 deletion SparenDNHAPM_userdef.dnh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function APM_LogDataToFile(outputfile) {
task APM_StartYOURFIELDHERE {
// Create output file
let outputfile = ObjFile_Create(OBJ_FILE_TEXT);
let outputfilepath = OUTPUT_DIRECTORY ~ "apmYFH-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv"; // DNHAPM USER DEF: YFH should correspond to your field name
let outputfilepath = OUTPUT_DIRECTORY ~ "apmcsv/" ~ "apmYFH-" ~ OUTPUT_NAME ~ "_" ~ starttime ~ ".csv"; // DNHAPM USER DEF: YFH should correspond to your field name
ObjFile_OpenNW(outputfile, outputfilepath);
let csvlog = ""; // CSV log
let counter = 0;
Expand Down

0 comments on commit 2b4c3d8

Please sign in to comment.