/** * <code>repeated .exec.shared.OperatorProfile operator_profile = 4;</code> */ public Builder setOperatorProfile( int index, com.dremio.exec.proto.UserBitShared.OperatorProfile.Builder builderForValue) { if (operatorProfileBuilder_ == null) { ensureOperatorProfileIsMutable(); operatorProfile_.set(index, builderForValue.build()); onChanged(); } else { operatorProfileBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .exec.shared.OperatorProfile operator_profile = 4;</code> */ public Builder addOperatorProfile( int index, com.dremio.exec.proto.UserBitShared.OperatorProfile.Builder builderForValue) { if (operatorProfileBuilder_ == null) { ensureOperatorProfileIsMutable(); operatorProfile_.add(index, builderForValue.build()); onChanged(); } else { operatorProfileBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .exec.shared.OperatorProfile operator_profile = 4;</code> */ public Builder addOperatorProfile( com.dremio.exec.proto.UserBitShared.OperatorProfile.Builder builderForValue) { if (operatorProfileBuilder_ == null) { ensureOperatorProfileIsMutable(); operatorProfile_.add(builderForValue.build()); onChanged(); } else { operatorProfileBuilder_.addMessage(builderForValue.build()); } return this; } /**
@Test public void testGetMetricsTableHandlesNotRegisteredMetrics() { OperatorProfile op = OperatorProfile .newBuilder().addMetric( UserBitShared.MetricValue.newBuilder() .setMetricId(1) .setDoubleValue(200)) .addMetric( UserBitShared.MetricValue.newBuilder() .setMetricId(3) .setDoubleValue(21)) .setOperatorId(UserBitShared.CoreOperatorType.PARQUET_ROW_GROUP_SCAN.getNumber()) .build(); ImmutablePair<OperatorProfile, Integer> pair = new ImmutablePair<>(op, 1); OperatorWrapper ow = new OperatorWrapper(1, ImmutableList.of(pair), OperatorMetricRegistry.getCoreOperatorTypeMetricsMap()); String html = ow.getMetricsTable(); Pattern columnPattern = Pattern.compile("<td>.*?</td>"); Matcher matcher = columnPattern.matcher(html); int count = 0; while (matcher.find()){ count++; } // Unregistered metrics should not appear on profiles screen assertEquals(2, count); }
public OperatorProfile getProfile() { final OperatorProfile.Builder b = OperatorProfile // .newBuilder() // .setOperatorType(operatorType) // .setOperatorId(operatorId) // .setSetupNanos(getSetupNanos()) // .setProcessNanos(getProcessingNanos()) .setWaitNanos(getWaitNanos()); if(allocator != null){ b.setPeakLocalMemoryAllocated(allocator.getPeakMemoryAllocation()); } addAllMetrics(b); return b.build(); }