Skip to content

Commit

Permalink
Add spilled data size to QueryStatistics
Browse files Browse the repository at this point in the history
  • Loading branch information
regadas committed Mar 12, 2023
1 parent 54f0fab commit 2b335bd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public void queryImmediateFailureEvent(BasicQueryInfo queryInfo, ExecutionFailur
0,
0,
0,
0,
ImmutableList.of(),
0,
true,
Expand Down Expand Up @@ -323,6 +324,7 @@ private QueryStatistics createQueryStatistics(QueryInfo queryInfo)
queryStats.getOutputPositions(),
queryStats.getLogicalWrittenDataSize().toBytes(),
queryStats.getWrittenPositions(),
queryStats.getSpilledDataSize().toBytes(),
queryStats.getCumulativeUserMemory(),
queryStats.getFailedCumulativeUserMemory(),
queryStats.getStageGcStatistics(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class QueryStatistics
private final long outputRows;
private final long writtenBytes;
private final long writtenRows;
private final long spilledBytes;

private final double cumulativeMemory;
private final double failedCumulativeMemory;
Expand Down Expand Up @@ -115,6 +116,7 @@ public QueryStatistics(
long outputRows,
long writtenBytes,
long writtenRows,
long spilledBytes,
double cumulativeMemory,
double failedCumulativeMemory,
List<StageGcStatistics> stageGcStatistics,
Expand Down Expand Up @@ -155,6 +157,7 @@ public QueryStatistics(
this.outputRows = outputRows;
this.writtenBytes = writtenBytes;
this.writtenRows = writtenRows;
this.spilledBytes = spilledBytes;
this.cumulativeMemory = cumulativeMemory;
this.failedCumulativeMemory = failedCumulativeMemory;
this.stageGcStatistics = requireNonNull(stageGcStatistics, "stageGcStatistics is null");
Expand Down Expand Up @@ -346,6 +349,12 @@ public long getWrittenRows()
return writtenRows;
}

@JsonProperty
public long getSpilledBytes()
{
return spilledBytes;
}

@JsonProperty
public double getCumulativeMemory()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public class TestHttpEventListener
0L,
0L,
0L,
0L,
0.0f,
Collections.emptyList(),
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public class TestMysqlEventListener
125L,
126L,
127L,
1271L,
128.0,
129.0,
// not stored
Expand Down Expand Up @@ -257,6 +258,7 @@ public class TestMysqlEventListener
125L,
126L,
127L,
1271L,
128.0,
129.0,
// not stored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ public void testOutputStats()
assertEquals(statistics.getOutputRows(), queryStats.getOutputPositions());
assertEquals(statistics.getWrittenBytes(), queryStats.getLogicalWrittenDataSize().toBytes());
assertEquals(statistics.getWrittenRows(), queryStats.getWrittenPositions());
assertEquals(statistics.getSpilledBytes(), queryStats.getSpilledDataSize().toBytes());
assertEquals(statistics.getCumulativeMemory(), queryStats.getCumulativeUserMemory());
assertEquals(statistics.getStageGcStatistics(), queryStats.getStageGcStatistics());
assertEquals(statistics.getCompletedSplits(), queryStats.getCompletedDrivers());
Expand Down

0 comments on commit 2b335bd

Please sign in to comment.