use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder in project pinpoint by naver.
the class TotalThreadCountCodec method decodeValues.
@Override
public List<JoinStatBo> decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) {
final String id = decodingContext.getApplicationId();
final long baseTimestamp = decodingContext.getBaseTimestamp();
final long timestampDelta = decodingContext.getTimestampDelta();
final long initialTimestamp = baseTimestamp + timestampDelta;
int numValues = valueBuffer.readVInt();
List<Long> timestampList = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
final byte[] header = valueBuffer.readPrefixedBytes();
AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
JoinLongFieldEncodingStrategy totalThreadCountEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
final List<JoinLongFieldBo> totalThreadCountList = this.codec.decodeValues(valueBuffer, totalThreadCountEncodingStrategy, numValues);
List<JoinStatBo> joinTotalThreadCountBoList = new ArrayList<JoinStatBo>();
for (int i = 0; i < numValues; i++) {
JoinTotalThreadCountBo joinTotalThreadCountBo = new JoinTotalThreadCountBo();
joinTotalThreadCountBo.setId(id);
joinTotalThreadCountBo.setTimestamp(timestampList.get(i));
joinTotalThreadCountBo.setTotalThreadCountJoinValue(totalThreadCountList.get(i));
joinTotalThreadCountBoList.add(joinTotalThreadCountBo);
}
return joinTotalThreadCountBoList;
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder in project pinpoint by naver.
the class AgentStatCodecV1 method decodeValues.
@Override
public List<T> decodeValues(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
final String agentId = decodingContext.getAgentId();
final long baseTimestamp = decodingContext.getBaseTimestamp();
final long timestampDelta = decodingContext.getTimestampDelta();
final long initialTimestamp = baseTimestamp + timestampDelta;
int numValues = valueBuffer.readVInt();
List<Long> timestamps = this.codecFactory.getCodec().decodeTimestamps(initialTimestamp, valueBuffer, numValues);
final CodecDecoder<T> codecDecoder = this.codecFactory.createCodecDecoder();
// decode headers
final byte[] header = valueBuffer.readPrefixedBytes();
AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
codecDecoder.decode(valueBuffer, headerDecoder, numValues);
List<T> result = new ArrayList<T>(numValues);
for (int i = 0; i < numValues; i++) {
T newObject = codecDecoder.getValue(i);
newObject.setAgentId(agentId);
newObject.setTimestamp(timestamps.get(i));
result.add(newObject);
}
return result;
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder in project pinpoint by naver.
the class JvmGcCodecV1 method decodeValues.
@Override
public List<JvmGcBo> decodeValues(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
final String agentId = decodingContext.getAgentId();
final long baseTimestamp = decodingContext.getBaseTimestamp();
final long timestampDelta = decodingContext.getTimestampDelta();
final long initialTimestamp = baseTimestamp + timestampDelta;
final JvmGcType gcType = JvmGcType.getTypeByCode(valueBuffer.readVInt());
int numValues = valueBuffer.readVInt();
List<Long> timestamps = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
// decode headers
final byte[] header = valueBuffer.readPrefixedBytes();
AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
JvmGcCodecV2.JvmGcCodecDecoder decoder = new JvmGcCodecV2.JvmGcCodecDecoder(codec);
decoder.decode(valueBuffer, headerDecoder, numValues);
List<JvmGcBo> jvmGcBos = new ArrayList<>(numValues);
for (int i = 0; i < numValues; i++) {
JvmGcBo jvmGcBo = decoder.getValue(i);
jvmGcBo.setAgentId(agentId);
jvmGcBo.setTimestamp(timestamps.get(i));
jvmGcBo.setGcType(gcType);
jvmGcBos.add(jvmGcBo);
}
return jvmGcBos;
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder in project pinpoint by naver.
the class DataSourceCodecV2 method decodeValue.
private DataSourceListBo decodeValue(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
final String agentId = decodingContext.getAgentId();
final long baseTimestamp = decodingContext.getBaseTimestamp();
final long timestampDelta = decodingContext.getTimestampDelta();
final long initialTimestamp = baseTimestamp + timestampDelta;
int numValues = valueBuffer.readVInt();
List<Long> startTimestamps = this.codec.decodeValues(valueBuffer, UnsignedLongEncodingStrategy.REPEAT_COUNT, numValues);
List<Long> timestamps = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
// decode headers
final byte[] header = valueBuffer.readPrefixedBytes();
AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
EncodingStrategy<Integer> idEncodingStrategy = UnsignedIntegerEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Short> serviceTypeEncodingStrategy = UnsignedShortEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<String> databaseNameEncodingStrategy = StringEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<String> urlEncodingStrategy = StringEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Integer> activeConnectionSizeStrategy = UnsignedIntegerEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Integer> maxConnectionSizeStrategy = UnsignedIntegerEncodingStrategy.getFromCode(headerDecoder.getCode());
List<Integer> ids = this.codec.decodeValues(valueBuffer, idEncodingStrategy, numValues);
List<Short> serviceTypeCodes = this.codec.decodeValues(valueBuffer, serviceTypeEncodingStrategy, numValues);
List<String> databaseNames = this.codec.decodeValues(valueBuffer, databaseNameEncodingStrategy, numValues);
List<String> jdbcUrls = this.codec.decodeValues(valueBuffer, urlEncodingStrategy, numValues);
List<Integer> activeConnectionSizes = this.codec.decodeValues(valueBuffer, activeConnectionSizeStrategy, numValues);
List<Integer> maxConnectionSizes = this.codec.decodeValues(valueBuffer, maxConnectionSizeStrategy, numValues);
DataSourceListBo dataSourceListBo = new DataSourceListBo();
for (int i = 0; i < numValues; i++) {
if (i == 0) {
dataSourceListBo.setAgentId(agentId);
dataSourceListBo.setTimestamp(timestamps.get(i));
dataSourceListBo.setStartTimestamp(startTimestamps.get(i));
}
DataSourceBo dataSourceBo = new DataSourceBo();
dataSourceBo.setAgentId(agentId);
dataSourceBo.setStartTimestamp(startTimestamps.get(i));
dataSourceBo.setTimestamp(timestamps.get(i));
dataSourceBo.setId(ids.get(i));
dataSourceBo.setServiceTypeCode(serviceTypeCodes.get(i));
dataSourceBo.setDatabaseName(databaseNames.get(i));
dataSourceBo.setJdbcUrl(jdbcUrls.get(i));
dataSourceBo.setActiveConnectionSize(activeConnectionSizes.get(i));
dataSourceBo.setMaxConnectionSize(maxConnectionSizes.get(i));
dataSourceListBo.add(dataSourceBo);
}
return dataSourceListBo;
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder in project pinpoint by naver.
the class JvmGcDetailedCodecV2 method decodeValues.
@Override
public List<JvmGcDetailedBo> decodeValues(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
final String agentId = decodingContext.getAgentId();
final long baseTimestamp = decodingContext.getBaseTimestamp();
final long timestampDelta = decodingContext.getTimestampDelta();
final long initialTimestamp = baseTimestamp + timestampDelta;
int numValues = valueBuffer.readVInt();
List<Long> startTimestamps = this.codec.decodeValues(valueBuffer, UnsignedLongEncodingStrategy.REPEAT_COUNT, numValues);
List<Long> timestamps = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
// decode headers
final byte[] header = valueBuffer.readPrefixedBytes();
AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
EncodingStrategy<Long> gcNewCountEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> gcNewTimeEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> codeCacheUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> newGenUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> oldGenUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> survivorSpaceUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> permGenUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> metaspaceUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
// decode values
List<Long> gcNewCounts = this.codec.decodeValues(valueBuffer, gcNewCountEncodingStrategy, numValues);
List<Long> gcNewTimes = this.codec.decodeValues(valueBuffer, gcNewTimeEncodingStrategy, numValues);
List<Long> codeCacheUseds = this.codec.decodeValues(valueBuffer, codeCacheUsedEncodingStrategy, numValues);
List<Long> newGenUseds = this.codec.decodeValues(valueBuffer, newGenUsedEncodingStrategy, numValues);
List<Long> oldGenUseds = this.codec.decodeValues(valueBuffer, oldGenUsedEncodingStrategy, numValues);
List<Long> survivorSpaceUseds = this.codec.decodeValues(valueBuffer, survivorSpaceUsedEncodingStrategy, numValues);
List<Long> permGenUseds = this.codec.decodeValues(valueBuffer, permGenUsedEncodingStrategy, numValues);
List<Long> metaspaceUseds = this.codec.decodeValues(valueBuffer, metaspaceUsedEncodingStrategy, numValues);
List<JvmGcDetailedBo> jvmGcDetailedBos = new ArrayList<JvmGcDetailedBo>(numValues);
for (int i = 0; i < numValues; ++i) {
JvmGcDetailedBo jvmGcDetailedBo = new JvmGcDetailedBo();
jvmGcDetailedBo.setAgentId(agentId);
jvmGcDetailedBo.setStartTimestamp(startTimestamps.get(i));
jvmGcDetailedBo.setTimestamp(timestamps.get(i));
jvmGcDetailedBo.setGcNewCount(gcNewCounts.get(i));
jvmGcDetailedBo.setGcNewTime(gcNewTimes.get(i));
jvmGcDetailedBo.setCodeCacheUsed(AgentStatUtils.convertLongToDouble(codeCacheUseds.get(i)));
jvmGcDetailedBo.setNewGenUsed(AgentStatUtils.convertLongToDouble(newGenUseds.get(i)));
jvmGcDetailedBo.setOldGenUsed(AgentStatUtils.convertLongToDouble(oldGenUseds.get(i)));
jvmGcDetailedBo.setSurvivorSpaceUsed(AgentStatUtils.convertLongToDouble(survivorSpaceUseds.get(i)));
jvmGcDetailedBo.setPermGenUsed(AgentStatUtils.convertLongToDouble(permGenUseds.get(i)));
jvmGcDetailedBo.setMetaspaceUsed(AgentStatUtils.convertLongToDouble(metaspaceUseds.get(i)));
jvmGcDetailedBos.add(jvmGcDetailedBo);
}
return jvmGcDetailedBos;
}
Aggregations