generated from newrelic-experimental/java-instrumentation-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed additional logging and added additional calls
- Loading branch information
1 parent
3709ccb
commit a206e55
Showing
1 changed file
with
21 additions
and
62 deletions.
There are no files selected for viewing
83 changes: 21 additions & 62 deletions
83
...ing-api/src/main/java/org/apache/sling/api/resource/ResourceResolver_instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,34 @@ | ||
|
||
package org.apache.sling.api.resource; | ||
|
||
import java.util.logging.Level; | ||
|
||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
import javax.servlet.http.HttpServletRequest; | ||
|
||
import com.newrelic.api.agent.Logger; | ||
import com.newrelic.api.agent.NewRelic; | ||
import com.newrelic.api.agent.Trace; | ||
import com.newrelic.api.agent.Transaction; | ||
import com.newrelic.api.agent.TransactionNamePriority; | ||
|
||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import com.newrelic.api.agent.weaver.Weaver; | ||
import org.apache.sling.api.resource.ResourceResolver; | ||
|
||
@Weave(originalName = "org.apache.sling.api.resource.ResourceResolver", type = MatchType.Interface) | ||
public abstract class ResourceResolver_instrumentation { | ||
|
||
|
||
@Trace | ||
public Resource resolve(HttpServletRequest req, String var1) { | ||
|
||
Resource res=Weaver.callOriginal(); | ||
|
||
if (req instanceof HttpServletRequest) { | ||
|
||
Transaction transaction = NewRelic.getAgent().getTransaction(); | ||
if(transaction != null) { | ||
NewRelic.getAgent().getTracedMethod().setMetricName(new String[] {"Custom","Sling","resolve",res.getName()}); | ||
|
||
//transaction.setTransactionName(TransactionNamePriority.FRAMEWORK_LOW, true, "Sling", | ||
/// new String[] { "Sling", "ResourceResolver", "resolve"}); | ||
|
||
Logger nrLogger = NewRelic.getAgent().getLogger(); | ||
nrLogger.log(Level.FINER, "APACHE-SLING - Starting ResourceResolver resolve method"); | ||
|
||
|
||
|
||
} | ||
|
||
} | ||
return res; | ||
} | ||
|
||
|
||
@Trace | ||
public Resource resolve(HttpServletRequest req) { | ||
|
||
Resource res=Weaver.callOriginal(); | ||
|
||
if (req instanceof HttpServletRequest) { | ||
|
||
Transaction transaction = NewRelic.getAgent().getTransaction(); | ||
if(transaction != null) { | ||
NewRelic.getAgent().getTracedMethod().setMetricName(new String[] {"Custom","Sling","resolve",res.getName()}); | ||
|
||
//transaction.setTransactionName(TransactionNamePriority.FRAMEWORK_LOW, true, "Sling", | ||
// new String[] { "Sling", "ResourceResolver", "resolve"}); | ||
|
||
Logger nrLogger = NewRelic.getAgent().getLogger(); | ||
nrLogger.log(Level.FINER, "APACHE-SLING - Starting ResourceResolver resolve method"); | ||
|
||
|
||
|
||
} | ||
|
||
} | ||
return res; | ||
} | ||
} | ||
@Trace | ||
public Resource resolve(HttpServletRequest req) { | ||
Resource res = Weaver.callOriginal(); | ||
|
||
if (req instanceof HttpServletRequest) { | ||
NewRelic.getAgent().getTracedMethod().setMetricName(new String[] {"Custom", "Sling", getClass().getSimpleName(), "resolve", res.getName()}); | ||
} | ||
return res; | ||
} | ||
|
||
@Trace | ||
public Resource resolve(HttpServletRequest req, String var1) { | ||
Resource res = Weaver.callOriginal(); | ||
|
||
if (req instanceof HttpServletRequest) { | ||
NewRelic.getAgent().getTracedMethod().setMetricName(new String[] {"Custom", "Sling", getClass().getSimpleName(), "resolve", res.getName()}); | ||
} | ||
return res; | ||
} | ||
} |