Skip to content

Commit

Permalink
Add operationMetrics to CommitInfoEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
mdesmet committed Dec 4, 2024
1 parent 724a98b commit 3379ffd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3085,6 +3085,7 @@ private CommitInfoEntry getCommitInfoEntry(
session.getUser(),
operation,
ImmutableMap.of("queryId", session.getQueryId()),
ImmutableMap.of(),
null,
null,
"trino-" + nodeVersion + "-" + nodeId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public record CommitInfoEntry(
String userName,
String operation,
Map<String, String> operationParameters,
Map<String, String> operationMetrics,
Job job,
Notebook notebook,
String clusterId,
Expand All @@ -39,7 +40,7 @@ public record CommitInfoEntry(

public CommitInfoEntry withVersion(long version)
{
return new CommitInfoEntry(version, timestamp, userId, userName, operation, operationParameters, job, notebook, clusterId, readVersion, isolationLevel, isBlindAppend);
return new CommitInfoEntry(version, timestamp, userId, userName, operation, operationParameters, operationMetrics, job, notebook, clusterId, readVersion, isolationLevel, isBlindAppend);
}

public record Job(String jobId, String jobName, String runId, String jobOwnerId, String triggerType) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ private DeltaLakeTransactionLogEntry buildCommitInfoEntry(ConnectorSession sessi
commitInfo.getString("userName"),
commitInfo.getString("operation"),
commitInfo.getMap(stringMap, "operationParameters"),
commitInfo.getMap(stringMap, "operationMetrics"),
new CommitInfoEntry.Job(
job.getString("jobId"),
job.getString("jobName"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ public void testCacheFileOperations()
assertFileSystemAccesses(
"SELECT * FROM test_cache_file_operations",
ImmutableMultiset.<CacheOperation>builder()
.add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 794))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 816))
.add(new CacheOperation("InputFile.length", "00000000000000000000.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000001.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000002.json"))
.add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000002.json", 0, 636))
.add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000002.json", 0, 658))
.add(new CacheOperation("InputFile.newStream", "00000000000000000002.json"))
.add(new CacheOperation("Alluxio.writeCache", "00000000000000000002.json", 0, 636))
.add(new CacheOperation("Alluxio.writeCache", "00000000000000000002.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000003.json"))
.add(new CacheOperation("InputFile.newStream", "_last_checkpoint"))
.add(new CacheOperation("Alluxio.readCached", "key=p1/", 0, 220))
Expand All @@ -105,11 +105,11 @@ public void testCacheFileOperations()
assertFileSystemAccesses(
"SELECT * FROM test_cache_file_operations",
ImmutableMultiset.<CacheOperation>builder()
.add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 794))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 816))
.add(new CacheOperation("InputFile.length", "00000000000000000000.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000001.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000002.json"))
.add(new CacheOperation("InputFile.length", "00000000000000000003.json"))
.add(new CacheOperation("InputFile.newStream", "_last_checkpoint"))
Expand All @@ -122,19 +122,19 @@ public void testCacheFileOperations()
assertFileSystemAccesses(
"SELECT * FROM test_cache_file_operations",
ImmutableMultiset.<CacheOperation>builder()
.add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 794))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 816))
.add(new CacheOperation("InputFile.length", "00000000000000000000.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000001.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000002.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000003.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000003.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000003.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000004.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000004.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000004.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000005.json", 0, 636))
.add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000005.json", 0, 636))
.add(new CacheOperation("Alluxio.writeCache", "00000000000000000005.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000005.json", 0, 658))
.add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000005.json", 0, 658))
.add(new CacheOperation("Alluxio.writeCache", "00000000000000000005.json", 0, 658))
.add(new CacheOperation("InputFile.newStream", "00000000000000000005.json"))
.add(new CacheOperation("InputFile.length", "00000000000000000005.json"))
.add(new CacheOperation("InputFile.length", "00000000000000000006.json"))
Expand All @@ -154,17 +154,17 @@ public void testCacheFileOperations()
assertFileSystemAccesses(
"SELECT * FROM test_cache_file_operations",
ImmutableMultiset.<CacheOperation>builder()
.add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 794))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 816))
.add(new CacheOperation("InputFile.length", "00000000000000000000.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000001.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000002.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000003.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000003.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000003.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000004.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000004.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000004.json"))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000005.json", 0, 636))
.add(new CacheOperation("Alluxio.readCached", "00000000000000000005.json", 0, 658))
.add(new CacheOperation("InputFile.length", "00000000000000000005.json"))
.add(new CacheOperation("InputFile.length", "00000000000000000006.json"))
.add(new CacheOperation("InputFile.newStream", "_last_checkpoint"))
Expand Down

0 comments on commit 3379ffd

Please sign in to comment.