Skip to content

Commit

Permalink
Remove unused stage schedule task and add split distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
dain committed Jan 8, 2019
1 parent b440bd4 commit 4fe2f45
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ public class StageStateMachine

private final AtomicReference<DateTime> schedulingComplete = new AtomicReference<>();
private final Distribution getSplitDistribution = new Distribution();
private final Distribution scheduleTaskDistribution = new Distribution();
private final Distribution addSplitDistribution = new Distribution();

private final AtomicLong peakUserMemory = new AtomicLong();
private final AtomicLong currentUserMemory = new AtomicLong();
Expand Down Expand Up @@ -442,8 +440,6 @@ public StageInfo getStageInfo(Supplier<Iterable<TaskInfo>> taskInfosSupplier, Su
StageStats stageStats = new StageStats(
schedulingComplete.get(),
getSplitDistribution.snapshot(),
scheduleTaskDistribution.snapshot(),
addSplitDistribution.snapshot(),

totalTasks,
runningTasks,
Expand Down Expand Up @@ -507,16 +503,6 @@ public void recordGetSplitTime(long startNanos)
scheduledStats.getGetSplitTime().add(elapsedNanos, NANOSECONDS);
}

public void recordScheduleTaskTime(long startNanos)
{
scheduleTaskDistribution.add(System.nanoTime() - startNanos);
}

public void recordAddSplit(long startNanos)
{
addSplitDistribution.add(System.nanoTime() - startNanos);
}

@Override
public String toString()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public class StageStats
private final DateTime schedulingComplete;

private final DistributionSnapshot getSplitDistribution;
private final DistributionSnapshot scheduleTaskDistribution;
private final DistributionSnapshot addSplitDistribution;

private final int totalTasks;
private final int runningTasks;
Expand Down Expand Up @@ -84,8 +82,6 @@ public StageStats(
@JsonProperty("schedulingComplete") DateTime schedulingComplete,

@JsonProperty("getSplitDistribution") DistributionSnapshot getSplitDistribution,
@JsonProperty("scheduleTaskDistribution") DistributionSnapshot scheduleTaskDistribution,
@JsonProperty("addSplitDistribution") DistributionSnapshot addSplitDistribution,

@JsonProperty("totalTasks") int totalTasks,
@JsonProperty("runningTasks") int runningTasks,
Expand Down Expand Up @@ -126,8 +122,6 @@ public StageStats(
{
this.schedulingComplete = schedulingComplete;
this.getSplitDistribution = requireNonNull(getSplitDistribution, "getSplitDistribution is null");
this.scheduleTaskDistribution = requireNonNull(scheduleTaskDistribution, "scheduleTaskDistribution is null");
this.addSplitDistribution = requireNonNull(addSplitDistribution, "addSplitDistribution is null");

checkArgument(totalTasks >= 0, "totalTasks is negative");
this.totalTasks = totalTasks;
Expand Down Expand Up @@ -190,18 +184,6 @@ public DistributionSnapshot getGetSplitDistribution()
return getSplitDistribution;
}

@JsonProperty
public DistributionSnapshot getScheduleTaskDistribution()
{
return scheduleTaskDistribution;
}

@JsonProperty
public DistributionSnapshot getAddSplitDistribution()
{
return addSplitDistribution;
}

@JsonProperty
public int getTotalTasks()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@

public class TestStageStats
{
public static final StageStats EXPECTED = new StageStats(
private static final StageStats EXPECTED = new StageStats(
new DateTime(0),

getTestDistribution(1),
getTestDistribution(2),
getTestDistribution(3),

4,
5,
Expand Down Expand Up @@ -92,13 +90,11 @@ public void testJson()
assertExpectedStageStats(actual);
}

public static void assertExpectedStageStats(StageStats actual)
private static void assertExpectedStageStats(StageStats actual)
{
assertEquals(actual.getSchedulingComplete().getMillis(), 0);

assertEquals(actual.getGetSplitDistribution().getCount(), 1.0);
assertEquals(actual.getScheduleTaskDistribution().getCount(), 2.0);
assertEquals(actual.getAddSplitDistribution().getCount(), 3.0);

assertEquals(actual.getTotalTasks(), 4);
assertEquals(actual.getRunningTasks(), 5);
Expand Down

0 comments on commit 4fe2f45

Please sign in to comment.