Skip to content

Commit 9e2806a

Browse files
committed
LINE -> LINES. SAMPLE -> SAMPLES. remove temporality.
1 parent 5d215c5 commit 9e2806a

File tree

4 files changed

+9
-32
lines changed

4 files changed

+9
-32
lines changed

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationMarshaler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private LocationMarshaler(
6464
protected void writeTo(Serializer output) throws IOException {
6565
output.serializeInt32(Location.MAPPING_INDEX, mappingIndex);
6666
output.serializeUInt64(Location.ADDRESS, address);
67-
output.serializeRepeatedMessage(Location.LINE, lineMarshalers);
67+
output.serializeRepeatedMessage(Location.LINES, lineMarshalers);
6868
output.serializeRepeatedInt32(Location.ATTRIBUTE_INDICES, attributeIndices);
6969
}
7070

@@ -76,7 +76,7 @@ private static int calculateSize(
7676
int size = 0;
7777
size += MarshalerUtil.sizeInt32(Location.MAPPING_INDEX, mappingIndex);
7878
size += MarshalerUtil.sizeUInt64(Location.ADDRESS, address);
79-
size += MarshalerUtil.sizeRepeatedMessage(Location.LINE, lineMarshalers);
79+
size += MarshalerUtil.sizeRepeatedMessage(Location.LINES, lineMarshalers);
8080
size += MarshalerUtil.sizeRepeatedInt32(Location.ATTRIBUTE_INDICES, attributeIndices);
8181
return size;
8282
}

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileMarshaler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private ProfileMarshaler(
9696
@Override
9797
protected void writeTo(Serializer output) throws IOException {
9898
output.serializeMessage(Profile.SAMPLE_TYPE, sampleTypeMarshaler);
99-
output.serializeRepeatedMessage(Profile.SAMPLE, sampleMarshalers);
99+
output.serializeRepeatedMessage(Profile.SAMPLES, sampleMarshalers);
100100
output.serializeFixed64(Profile.TIME_UNIX_NANO, timeNanos);
101101
output.serializeInt64(Profile.DURATION_NANO, durationNanos);
102102
output.serializeMessage(Profile.PERIOD_TYPE, periodTypeMarshaler);
@@ -126,7 +126,7 @@ private static int calculateSize(
126126
int size;
127127
size = 0;
128128
size += MarshalerUtil.sizeMessage(Profile.SAMPLE_TYPE, sampleTypeMarshaler);
129-
size += MarshalerUtil.sizeRepeatedMessage(Profile.SAMPLE, sampleMarshalers);
129+
size += MarshalerUtil.sizeRepeatedMessage(Profile.SAMPLES, sampleMarshalers);
130130
size += MarshalerUtil.sizeFixed64(Profile.TIME_UNIX_NANO, timeNanos);
131131
size += MarshalerUtil.sizeInt64(Profile.DURATION_NANO, durationNanos);
132132
size += MarshalerUtil.sizeMessage(Profile.PERIOD_TYPE, periodTypeMarshaler);

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeData.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import javax.annotation.concurrent.Immutable;
1010

1111
/**
12-
* ValueType describes the type and units of a value, with an optional aggregation temporality.
12+
* ValueType describes the type and units of a value.
1313
*
1414
* @see "profiles.proto::ValueType"
1515
*/
@@ -21,7 +21,4 @@ public interface ValueTypeData {
2121

2222
/** Index into string table. */
2323
int getUnitStringIndex();
24-
25-
@Nullable
26-
AggregationTemporality getAggregationTemporality();
2724
}

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeMarshaler.java

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize;
1010
import io.opentelemetry.exporter.internal.marshal.ProtoEnumInfo;
1111
import io.opentelemetry.exporter.internal.marshal.Serializer;
12-
import io.opentelemetry.proto.profiles.v1development.internal.AggregationTemporality;
1312
import io.opentelemetry.proto.profiles.v1development.internal.ValueType;
1413
import java.io.IOException;
1514
import java.util.List;
@@ -21,25 +20,11 @@ final class ValueTypeMarshaler extends MarshalerWithSize {
2120

2221
private final int typeStringIndex;
2322
private final int unitStringIndex;
24-
private final ProtoEnumInfo aggregationTemporality;
2523

2624
static ValueTypeMarshaler create(ValueTypeData valueTypeData) {
27-
ProtoEnumInfo aggregationTemporality =
28-
AggregationTemporality.AGGREGATION_TEMPORALITY_UNSPECIFIED;
29-
if (valueTypeData.getAggregationTemporality() != null) {
30-
switch (valueTypeData.getAggregationTemporality()) {
31-
case DELTA:
32-
aggregationTemporality = AggregationTemporality.AGGREGATION_TEMPORALITY_DELTA;
33-
break;
34-
case CUMULATIVE:
35-
aggregationTemporality = AggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE;
36-
break;
37-
}
38-
}
3925
return new ValueTypeMarshaler(
4026
valueTypeData.getTypeStringIndex(),
41-
valueTypeData.getUnitStringIndex(),
42-
aggregationTemporality);
27+
valueTypeData.getUnitStringIndex());
4328
}
4429

4530
static ValueTypeMarshaler[] createRepeated(List<ValueTypeData> items) {
@@ -60,28 +45,23 @@ public void accept(ValueTypeData valueTypeData) {
6045
return valueTypeMarshalers;
6146
}
6247

63-
private ValueTypeMarshaler(
64-
int typeStringIndex, int unitStringIndex, ProtoEnumInfo aggregationTemporality) {
65-
super(calculateSize(typeStringIndex, unitStringIndex, aggregationTemporality));
48+
private ValueTypeMarshaler(int typeStringIndex, int unitStringIndex) {
49+
super(calculateSize(typeStringIndex, unitStringIndex));
6650
this.typeStringIndex = typeStringIndex;
6751
this.unitStringIndex = unitStringIndex;
68-
this.aggregationTemporality = aggregationTemporality;
6952
}
7053

7154
@Override
7255
protected void writeTo(Serializer output) throws IOException {
7356
output.serializeInt64(ValueType.TYPE_STRINDEX, typeStringIndex);
7457
output.serializeInt64(ValueType.UNIT_STRINDEX, unitStringIndex);
75-
output.serializeEnum(ValueType.AGGREGATION_TEMPORALITY, aggregationTemporality);
7658
}
7759

78-
private static int calculateSize(
79-
int typeStringIndex, int unitStringIndex, ProtoEnumInfo aggregationTemporality) {
60+
private static int calculateSize(int typeStringIndex, int unitStringIndex) {
8061
int size;
8162
size = 0;
8263
size += MarshalerUtil.sizeInt32(ValueType.TYPE_STRINDEX, typeStringIndex);
8364
size += MarshalerUtil.sizeInt32(ValueType.UNIT_STRINDEX, unitStringIndex);
84-
size += MarshalerUtil.sizeEnum(ValueType.AGGREGATION_TEMPORALITY, aggregationTemporality);
8565
return size;
8666
}
8767
}

0 commit comments

Comments
 (0)