Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ public enum TaskCounter {
*/
MERGE_PHASE_TIME,

/**
* Time taken to sort data in milliseconds.
*/
SORT_TIME,

/**
* First event received from source relative to task start time.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ public void progress() {
protected final TezCounter numAdditionalSpills;
// Number of files offered via shuffle-handler to consumers.
protected final TezCounter numShuffleChunks;
// Time (in ms) spent with sorting (includes only the actual sorting time, doesn't include Span related operations)
protected final TezCounter sortTimeMsCounter;

// How partition stats should be reported.
final ReportPartitionStats reportPartitionStats;

Expand Down Expand Up @@ -220,6 +223,7 @@ public ExternalSorter(OutputContext outputContext, Configuration conf, int numOu
additionalSpillBytesRead = outputContext.getCounters().findCounter(TaskCounter.ADDITIONAL_SPILLS_BYTES_READ);
numAdditionalSpills = outputContext.getCounters().findCounter(TaskCounter.ADDITIONAL_SPILL_COUNT);
numShuffleChunks = outputContext.getCounters().findCounter(TaskCounter.SHUFFLE_CHUNK_COUNT);
sortTimeMsCounter = outputContext.getCounters().findCounter(TaskCounter.SORT_TIME);

// compression
this.codec = CodecUtils.getCodec(conf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,10 @@ public SpanIterator sort(IndexedSorter sorter) {
if(length() > 1) {
sorter.sort(this, 0, length(), progressable);
}
long sortTime = System.currentTimeMillis() - start;
LOG.info(outputContext.getDestinationVertexName() + ": " + "done sorting span=" + index + ", length=" + length() + ", "
+ "time=" + (System.currentTimeMillis() - start));
+ "time=" + sortTime);
sortTimeMsCounter.increment(sortTime);
return new SpanIterator((SortSpan)this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,11 @@ protected void sortAndSpill(long sameKeyCount, long totalKeysCount)
throws IOException, InterruptedException {
final int mstart = getMetaStart();
final int mend = getMetaEnd();

long start = System.currentTimeMillis();
sorter.sort(this, mstart, mend, progressable);
sortTimeMsCounter.increment(System.currentTimeMillis() - start);

spill(mstart, mend, sameKeyCount, totalKeysCount);
}

Expand Down