/** * <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; } /**
bitField0_ = (bitField0_ & ~0x00000001); } else { ensureInputProfileIsMutable(); inputProfile_.addAll(other.inputProfile_); onChanged(); inputProfileBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getInputProfileFieldBuilder() : null; } else { inputProfileBuilder_.addAllMessages(other.inputProfile_); setOperatorId(other.getOperatorId()); setOperatorType(other.getOperatorType()); setSetupNanos(other.getSetupNanos()); setProcessNanos(other.getProcessNanos()); setPeakLocalMemoryAllocated(other.getPeakLocalMemoryAllocated()); bitField0_ = (bitField0_ & ~0x00000040); } else { ensureMetricIsMutable(); metric_.addAll(other.metric_); onChanged();
return; case 1: builder.addInputProfile(input.mergeObject(com.dremio.exec.proto.UserBitShared.StreamProfile.newBuilder(), com.dremio.exec.proto.SchemaUserBitShared.StreamProfile.MERGE)); builder.setOperatorId(input.readInt32()); break; case 4: builder.setOperatorType(input.readInt32()); break; case 5: builder.setSetupNanos(input.readInt64()); break; case 6: builder.setProcessNanos(input.readInt64()); break; case 7: builder.setPeakLocalMemoryAllocated(input.readInt64()); break; case 8: builder.addMetric(input.mergeObject(com.dremio.exec.proto.UserBitShared.MetricValue.newBuilder(), com.dremio.exec.proto.SchemaUserBitShared.MetricValue.MERGE)); builder.setWaitNanos(input.readInt64()); break; default:
@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); }
/** * <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; } /**
/** * <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; } /**
@Override public void apply(int key, long value) { builder.addMetric(MetricValue.newBuilder().setMetricId(key).setLongValue(value)); }
@Override public void apply(int key, double value) { builder.addMetric(MetricValue.newBuilder().setMetricId(key).setDoubleValue(value)); }
public void addStreamProfile(OperatorProfile.Builder builder) { for(int i = 0; i < recordsReceivedByInput.length; i++){ builder.addInputProfile( StreamProfile.newBuilder() .setBatches(batchesReceivedByInput[i]) .setRecords(recordsReceivedByInput[i]) .setSize(sizeInBytesReceivedByInput[i]) ); } }
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(); }