Skip to content

Commit

Permalink
Make description more generic and add optional description argument
Browse files Browse the repository at this point in the history
  • Loading branch information
kathy-t committed Jan 15, 2024
1 parent c24c223 commit 0737cd9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions metricsaggregator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ Usage: <main class> [options] [command] [command options]
* -d, --data
The file path to the CSV file containing workflow metrics from
Terra. The first line of the file should contain the CSV fields: workflow_id,status,workflow_start,workflow_end,workflow_runtime_minutes,source_url
-de, --description
Optional description about the metrics to include when submitting
metrics to Dockstore
--help
Prints help for metricsaggregator
-r, --recordSkipped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,21 @@ public static class SubmitTerraMetrics extends CommandLineArgs {
@Parameter(names = {"-r", "--recordSkipped"}, description = "Record skipped executions and the reason skipped to a CSV file")
private boolean recordSkippedExecutions;

@Parameter(names = {"-de", "--description"}, description = "Optional description about the metrics to include when submitting metrics to Dockstore")
private String description;

public File getConfig() {
return config;
}


public String getDataFilePath() {
return dataFilePath;
}

public String getDescription() {
return description;
}

public boolean isRecordSkippedExecutions() {
return recordSkippedExecutions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,11 @@ private void submitWorkflowExecutions(String sourceUrl, List<CSVRecord> workflow
.toList();
final ExecutionsRequestBody executionsRequestBody = new ExecutionsRequestBody().runExecutions(workflowExecutionsToSubmit);
try {
extendedGa4GhApi.executionMetricsPost(executionsRequestBody, Partner.TERRA.toString(), sourceUrlTrsInfo.trsId(), sourceUrlTrsInfo.version(),
"Terra metrics from Q4 2023");
String description = "Submitted using the metricsaggregator's submit-terra-metrics command";
if (StringUtils.isNotBlank(submitTerraMetricsCommand.getDescription())) {
description += ". " + submitTerraMetricsCommand.getDescription();
}
extendedGa4GhApi.executionMetricsPost(executionsRequestBody, Partner.TERRA.toString(), sourceUrlTrsInfo.trsId(), sourceUrlTrsInfo.version(), description);
numberOfExecutionsSubmitted.addAndGet(workflowMetricRecords.size());
} catch (ApiException e) {
logSkippedExecutions(sourceUrlTrsInfo.sourceUrl(), workflowMetricRecords, String.format("Could not submit execution metrics to Dockstore for workflow %s: %s", sourceUrlTrsInfo, e.getMessage()), skippedExecutionsCsvPrinter, false);
Expand Down

0 comments on commit 0737cd9

Please sign in to comment.