Skip to content

Commit d02f0db

Browse files
committed
remove timing logs, cleanup non-existant @params
1 parent 88b70a5 commit d02f0db

2 files changed

Lines changed: 1 addition & 35 deletions

File tree

src/main/java/edu/harvard/iq/dataverse/FileDownloadServiceBean.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ public void writeGuestbookAndStartBatchDownload(GuestbookResponse guestbookRespo
129129
boolean useCustomZipService = customZipDownloadUrl != null;
130130
String zipServiceKey = null;
131131

132-
totalPrepNanos = 0L;
133-
totalWriteNanos = 0L;
134-
long totalStartNanos = System.nanoTime();
135132
long numFiles = guestbookResponse.getSelectedFileIds().split(",").length;
136133
// Do we need to write GuestbookRecord entries for the files?
137134
if (!doNotSaveGuestbookRecord) {
@@ -162,14 +159,6 @@ public void writeGuestbookAndStartBatchDownload(GuestbookResponse guestbookRespo
162159
}
163160

164161
}
165-
logger.info(String.format(
166-
Locale.ROOT,
167-
"downloadDatafiles timing: total=%d ms, prep=%d ms, write=%d ms, files=%d",
168-
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - totalStartNanos),
169-
TimeUnit.NANOSECONDS.toMillis(totalPrepNanos),
170-
TimeUnit.NANOSECONDS.toMillis(totalWriteNanos),
171-
numFiles
172-
));
173162
if (useCustomZipService) {
174163
redirectToCustomZipDownloadService(customZipDownloadUrl, zipServiceKey);
175164
} else {
@@ -247,7 +236,6 @@ public List<String> writeGuestbookResponseRecords(GuestbookResponse guestbookRes
247236
if (guestbookResponse == null || guestbookResponse.getSelectedFileIds() == null || guestbookResponse.getSelectedFileIds().isBlank()) {
248237
return Collections.emptyList();
249238
}
250-
long prepStartNanos = System.nanoTime();
251239

252240
List<DataFile> selectedDataFiles = resolveSelectedDataFiles(guestbookResponse.getSelectedFileIds());
253241
if (selectedDataFiles.isEmpty()) {
@@ -260,11 +248,7 @@ public List<String> writeGuestbookResponseRecords(GuestbookResponse guestbookRes
260248
perFileResponse.setDataFile(dataFile);
261249
responsesToPersist.add(perFileResponse);
262250
}
263-
Long writeStartNanos = System.nanoTime();
264-
totalPrepNanos = writeStartNanos - prepStartNanos;
265251
List<String> savedIds = saveGuestbookResponseRecordsAndMDCLogEntries(responsesToPersist);
266-
totalWriteNanos = System.nanoTime() - writeStartNanos;
267-
268252
return savedIds;
269253
}
270254

@@ -349,13 +333,10 @@ public List<String> saveGuestbookResponseRecordsAndMDCLogEntries(List<GuestbookR
349333
return savedIds;
350334
}
351335

352-
long totalPrepNanos = 0L;
353-
long totalWriteNanos = 0L;
354336
public String writeGuestbookResponseRecord(GuestbookResponse guestbookResponse) {
355337
String guestbookResponseIds = "";
356338

357339
try {
358-
long storageStartNanos = System.nanoTime();
359340
CreateGuestbookResponseCommand cmd = new CreateGuestbookResponseCommand(
360341
dvRequestService.getDataverseRequest(),
361342
guestbookResponse,

src/main/java/edu/harvard/iq/dataverse/api/Access.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,21 +1014,18 @@ private Response downloadDatafiles(ContainerRequestContext crc, String body, boo
10141014
// ToDo - cache dataset perms, e.g. editdataset let's you get all files (assuming one dataset)
10151015
// Same for filedownload if assigned at the dataset level
10161016

1017-
long totalAuthorizationNanos = 0L;
10181017
for (int i = 0; i < fileIdParams.length; i++) {
10191018
DataFile df = findDataFileOrDieWrapper(fileIdParams[i]);
10201019
if (guestbookResponseRequired == null) {
10211020
// Only need to check this on the first file
10221021
guestbookResponseRequired = checkGuestbookRequiredResponse(crc, uriInfo, df, gbrids);
10231022
}
1024-
long authStartNanos = System.nanoTime();
10251023
if(i==1) logger.info("Downloading" + fileIdParams.length + " files. GBR required: " + guestbookResponseRequired);
10261024
datafilesMap.put(df.getId(), df);
10271025
datasetIds.add(df.getOwner() != null ? df.getOwner().getId() : 0L);
10281026
if (isAccessAuthorized(user, df)) {
10291027
authorizedDatafileIds.add(df.getId());
10301028
}
1031-
totalAuthorizationNanos += System.nanoTime() - authStartNanos;
10321029

10331030
if (datasetIds.size() > 1) {
10341031
// All files must be from the same Dataset
@@ -1052,12 +1049,6 @@ private Response downloadDatafiles(ContainerRequestContext crc, String body, boo
10521049
}
10531050
}
10541051
}
1055-
logger.info(String.format(
1056-
Locale.ROOT,
1057-
"downloadDatafiles timing: authorization=%d ms, files=%d",
1058-
TimeUnit.NANOSECONDS.toMillis(totalAuthorizationNanos),
1059-
fileIdParams.length
1060-
));
10611052

10621053
if (useCustomZipService) {
10631054
URI redirect_uri = null;
@@ -1456,7 +1447,6 @@ private String getWebappImageResource(String imageName) {
14561447
* @param isPublic
14571448
* @param type
14581449
* @param fileInputStream
1459-
* @param contentDispositionHeader
14601450
* @param formDataBodyPart
14611451
* @return
14621452
*
@@ -1525,12 +1515,7 @@ public Response saveAuxiliaryFileWithVersion(@Context ContainerRequestContext cr
15251515
* @param fileId
15261516
* @param formatTag
15271517
* @param formatVersion
1528-
* @param origin
1529-
* @param isPublic
1530-
* @param fileInputStream
1531-
* @param contentDispositionHeader
1532-
* @param formDataBodyPart
1533-
* @return
1518+
* @return
15341519
*/
15351520
@DELETE
15361521
@AuthRequired

0 commit comments

Comments
 (0)