use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class SnsClientInstrumentationHelperTest method testTargetArnBasedMessage.
@Test
public void testTargetArnBasedMessage() throws Exception {
PublishRequest publishRequest = PublishRequest.builder().message("message").targetArn("userSpecifiedTargetArn").subject("VERY IMPORTANT").build();
MessageProduceParameters result = SnsClientInstrumentationHelper.makeMessageProducerParameters(publishRequest);
assertEquals("SNS", result.getLibrary());
assertEquals("userSpecifiedTargetArn", result.getDestinationName());
assertEquals(DestinationType.NAMED_TOPIC, result.getDestinationType());
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class SnsClientInstrumentationHelperTest method testTopicArnBasedMessage.
@Test
public void testTopicArnBasedMessage() throws Exception {
PublishRequest publishRequest = PublishRequest.builder().message("message").topicArn("userSpecifiedTopicArn").subject("VERY IMPORTANT").build();
MessageProduceParameters result = SnsClientInstrumentationHelper.makeMessageProducerParameters(publishRequest);
assertEquals("SNS", result.getLibrary());
assertEquals("userSpecifiedTopicArn", result.getDestinationName());
assertEquals(DestinationType.NAMED_TOPIC, result.getDestinationType());
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class AmazonSQS_Instrumentation method sendMessageBatch.
@Trace
public SendMessageBatchResult sendMessageBatch(SendMessageBatchRequest sendMessageBatchRequest) {
MessageProduceParameters messageProduceParameters = Util.generateExternalProduceMetrics(sendMessageBatchRequest.getQueueUrl());
NewRelic.getAgent().getTracedMethod().reportAsExternal(messageProduceParameters);
return Weaver.callOriginal();
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class AmazonSQS_Instrumentation method sendMessage.
@Trace
public SendMessageResult sendMessage(SendMessageRequest sendMessageRequest) {
MessageProduceParameters messageProduceParameters = Util.generateExternalProduceMetrics(sendMessageRequest.getQueueUrl());
NewRelic.getAgent().getTracedMethod().reportAsExternal(messageProduceParameters);
return Weaver.callOriginal();
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class UtilTest method testGenerateProduceMetricsGoodQueueName.
@Test
public void testGenerateProduceMetricsGoodQueueName() {
MessageProduceParameters messageProduceParameters = Util.generateExternalProduceMetrics("path/myQueue");
Assert.assertEquals("SQS", messageProduceParameters.getLibrary());
Assert.assertEquals("myQueue", messageProduceParameters.getDestinationName());
Assert.assertEquals(DestinationType.NAMED_QUEUE, messageProduceParameters.getDestinationType());
}
Aggregations