setPlanEnd(other.getPlanEnd());
@Nullable @Override public ProfileInfo apply(@Nullable Entry<String, UserBitShared.QueryProfile> input) { if (input == null || input.getValue() == null) { return ProfileInfo.getDefault(); } //Constructing ProfileInfo final String queryID = input.getKey(); final QueryProfile profile = input.getValue(); //For cases where query was never queued final long assumedQueueEndTime = profile.getQueueWaitEnd()> 0 ? profile.getQueueWaitEnd() : profile.getPlanEnd(); return new ProfileInfo( queryID, new Timestamp(profile.getStart()), profile.getForeman().getAddress(), profile.getTotalFragments(), profile.getUser(), profile.getQueueName(), computeDuration(profile.getStart(), profile.getPlanEnd()), computeDuration(profile.getPlanEnd(), assumedQueueEndTime), computeDuration(assumedQueueEndTime, profile.getEnd()), profile.getState().name(), profile.getQuery() ); } });
public String getQueuedDuration() { //Check if State is ENQUEUED if (profile.getState() == QueryState.ENQUEUED) { return (new SimpleDurationFormat(profile.getPlanEnd(), System.currentTimeMillis())).verbose(); } //Check if Queue Wait End is known if (profile.getQueueWaitEnd() > 0L) { return (new SimpleDurationFormat(profile.getPlanEnd(), profile.getQueueWaitEnd())).verbose(); } //Unable to estimate/calculate Specific Time spent in Queue return NOT_AVAILABLE_LABEL; }
setPlanEnd(other.getPlanEnd());
output.writeString(17, message.getOptionsJson(), false); if(message.hasPlanEnd()) output.writeInt64(18, message.getPlanEnd(), false); if(message.hasQueueWaitEnd()) output.writeInt64(19, message.getQueueWaitEnd(), false);
if (profile.getPlanEnd() > 0L) { return (new SimpleDurationFormat(profile.getPlanEnd(), queryEndTime)).verbose();
public String getPlanningDuration() { //Check if Planning End is known if (profile.getPlanEnd() > 0L) { return (new SimpleDurationFormat(profile.getStart(), profile.getPlanEnd())).verbose(); } //Check if any fragments have started if (profile.getFragmentProfileCount() > 0) { //Init Planning End Time long estimatedPlanEnd = Long.MAX_VALUE; //Using Screen MajorFragment as reference MajorFragmentProfile majorFrag0 = profile.getFragmentProfile(0); //Searching for earliest starting fragment for (MinorFragmentProfile fragmentWrapper : majorFrag0.getMinorFragmentProfileList()) { long minorFragmentStart = fragmentWrapper.getStartTime(); if (minorFragmentStart > 0 && minorFragmentStart < estimatedPlanEnd) { estimatedPlanEnd = minorFragmentStart; } } //Provide estimated plan time return (new SimpleDurationFormat(profile.getStart(), estimatedPlanEnd)).verbose() + ESTIMATED_LABEL; } //Unable to estimate/calculate Specific Time spent in Planning return NOT_AVAILABLE_LABEL; }
output.writeString(17, message.getOptionsJson(), false); if(message.hasPlanEnd()) output.writeInt64(18, message.getPlanEnd(), false); if(message.hasQueueWaitEnd()) output.writeInt64(19, message.getQueueWaitEnd(), false);