public final class NewRelic
extends java.lang.Object
| Constructor and Description |
|---|
NewRelic() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addCustomParameter(java.lang.String key,
java.lang.Number value)
Add a key/value pair to the current transaction.
|
static void |
addCustomParameter(java.lang.String key,
java.lang.String value)
Add a key/value pair to the current transaction.
|
static Agent |
getAgent()
Returns the primary New Relic java agent api.
|
static java.lang.String |
getBrowserTimingFooter()
Get the RUM JavaScript footer for the current web transaction.
|
static java.lang.String |
getBrowserTimingHeader()
Get the RUM JavaScript header for the current web transaction.
|
static void |
ignoreApdex()
Ignore the current transaction for calculating Apdex score.
|
static void |
ignoreTransaction()
Ignore the current transaction.
|
static void |
incrementCounter(java.lang.String name)
Increment the metric counter for the given name.
|
static void |
incrementCounter(java.lang.String name,
int count)
Increment the metric counter for the given name.
|
static void |
noticeError(java.lang.String message)
Notice an error and report it to New Relic.
|
static void |
noticeError(java.lang.String message,
java.util.Map<java.lang.String,java.lang.String> params)
Notice an error and report it to New Relic.
|
static void |
noticeError(java.lang.Throwable throwable)
Report an exception to New Relic.
|
static void |
noticeError(java.lang.Throwable throwable,
java.util.Map<java.lang.String,java.lang.String> params)
Notice an exception and report it to New Relic.
|
static void |
recordMetric(java.lang.String name,
float value)
Record a metric value for the given name.
|
static void |
recordResponseTimeMetric(java.lang.String name,
long millis)
Record a response time in milliseconds for the given metric name.
|
static void |
setAccountName(java.lang.String name)
Set the account name to associate with the RUM JavaScript footer for the current web transaction.
|
static void |
setProductName(java.lang.String name)
Set the product name to associate with the RUM JavaScript footer for the current web transaction.
|
static void |
setRequestAndResponse(Request request,
Response response)
Sets the request and response instances for the current transaction.
|
static void |
setTransactionName(java.lang.String category,
java.lang.String name)
Set the name of the current transaction.
|
static void |
setUserName(java.lang.String name)
Set the user name to associate with the RUM JavaScript footer for the current web transaction.
|
public static Agent getAgent()
public static void recordMetric(java.lang.String name,
float value)
name - The name of the metric. The metric is not recorded if the name is null or the empty string.value - The value of the metric.public static void recordResponseTimeMetric(java.lang.String name,
long millis)
name - The name of the metric. The response time is not recorded if the name is null or the empty string.millis - The response time in milliseconds.public static void incrementCounter(java.lang.String name)
name - The name of the metric to increment.public static void incrementCounter(java.lang.String name,
int count)
name - The name of the metric to increment.count - The amount in which the metric should be incremented.public static void noticeError(java.lang.Throwable throwable,
java.util.Map<java.lang.String,java.lang.String> params)
throwable - The throwable to notice and report.params - Custom parameters to include in the traced error. May be null.public static void noticeError(java.lang.Throwable throwable)
throwable - The throwable to report.noticeError(Throwable, Map)public static void noticeError(java.lang.String message,
java.util.Map<java.lang.String,java.lang.String> params)
message - The error message to be reported.params - Custom parameters to include in the traced error. May be nullpublic static void noticeError(java.lang.String message)
message - Message to report with a transaction when it finishes.public static void addCustomParameter(java.lang.String key,
java.lang.Number value)
key - Custom parameter key.value - Custom parameter value.public static void addCustomParameter(java.lang.String key,
java.lang.String value)
key - Custom parameter key.value - Custom parameter value.public static void setTransactionName(java.lang.String category,
java.lang.String name)
category - Metric category. If the input is null, then the default will be used.name - The name of the transaction starting with a forward slash. example: /store/orderpublic static void ignoreTransaction()
public static void ignoreApdex()
public static void setRequestAndResponse(Request request, Response response)
request - The current transaction's request.response - The current transaction's response.public static java.lang.String getBrowserTimingHeader()
public static java.lang.String getBrowserTimingFooter()
public static void setUserName(java.lang.String name)
name - User name to associate with the RUM JavaScript footer.public static void setAccountName(java.lang.String name)
name - Account name to associate with the RUM JavaScript footer.public static void setProductName(java.lang.String name)
name - Product name to associate with the RUM JavaScript footer.