Comments (16)
@ryantenney, this is all yours.
from metrics.
Actually, considering this a dupe of #162.
from metrics.
The problem is actually with the XML namespace beans
, as I omitted the schemaLocation for the spring-beans xsd.
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.yammer.com/schema/metrics http://www.yammer.com/schema/metrics/metrics.xsd">
The XML in the manual was intended as an example of the XML the should be added to your Spring application's existing applicationContext.xml
. If it is added as a separate file, it will not have any effect.
from metrics.
Thanks. Works now.
Missed the spring bean part.
from metrics.
Though I get a null pointer exception in my app now which looks like https://gist.github.com/1934852
Can you just have a look at it.Please, pretty please.
from metrics.
When I wrote this, I actually had ruled out the possibility of this error occurring... Is healthAsHTML
the method that you have annotated with @timed? Could you give me some more information about the class that this method belongs to? It seems to implement an interface, does that interface define the healthAsHTML
method?
from metrics.
healthAsHTML is part of an interface.
Here are my code snippets of HealthCheck inteface and its implementation.
https://gist.github.com/1935181
from metrics.
healthAsHTML is part of an interface.
Here are my code snippets of HealthCheck inteface and its implementation.
https://gist.github.com/1935181
-Abhishek Kona
On Wed, Feb 29, 2012 at 2:34 AM, Ryan W Tenney <
[email protected]
wrote:
When I wrote this, I actually had ruled out the possibility of this error
occurring... IshealthAsHTML
the method that you have annotated with
@timed? Could you give me some more information about the class that this
method belongs to? It seems to implement an interface, does that interface
define thehealthAsHTML
method?
Reply to this email directly or view it on GitHub:
https://github.com/codahale/metrics/issues/169#issuecomment-4225453
from metrics.
Thanks! I'll run some tests to see if I can replicate this issue.
from metrics.
Good news, I was able to reproduce this problem! I'll look into whether it is possible to fix this, but in the meantime, you can avoid this issue by annotating the implementation of healthAsHTML
in the class HealthCheckImpl
, instead of annotating the method in the interface HealthCheck
. (see https://gist.github.com/1935505 )
from metrics.
Annotating the method in HealthCheckImpl does not time the method and no stats are collected.
I already had annotated asJSON method in the Impl but no stats are collected for it.
from metrics.
Ok my bad. The data is getting collected, it is available as a JMX Bean, but to get the data out on Graphite, do I need to configure something else in the bean?
Right now I am initializing the Graphite Reporter in code and not in XML.
from metrics.
Looks like I cannot initialize the graphite reporter in XML, how Do I access the registry defined in XML in Code?
from metrics.
Right now, if you're calling GraphiteReporter.enable(long period, TimeUnit unit, String host, int port)
, it tries to use the default MetricsRegistry, which is not the same as the one created by this module. The MetricsRegistry created by this module is made available as a candidate for autowiring, so you can create a class like the one below and create it as a Spring bean:
public class EnableGraphiteReporter {
@Autowired
MetricsRegistry metricsRegistry;
@PostConstruct
public void init() {
/* pass metricsRegistry into GraphiteReporter.enable(), like so: */
GraphiteReporter.enable(metricsRegistry, 1, TimeUnit.MINUTE, "graphite-server", 8080);
}
}
from metrics.
Right, this worked for me. but get a lot of Null Pointer errors. The @Timed
annotation can be safely used in the higher Layers of Jersey
from metrics.
I spent some time playing with the Guice module, and it seems that it also does not recognize annotations on interfaces. I'll put in a patch to prevent the NullPointerExceptions, but I think that the behavior should remain consistent with that of the Guice module.
from metrics.
Related Issues (20)
- Mechanism to Change Default Reservoir for Timer Metrics HOT 1
- ScheduledReporter may have missed reports HOT 2
- JDK 8 compatibility to compile metric-core module (4.2.x) HOT 1
- Concept of MetricLevel [new feature?]
- Update jackson dependencies due to CVE-2020-36518 HOT 1
- Issue with using the JMX reporter with platform MBean server HOT 1
- InstrumentedExecutorService does not remove registered gauges after shutdown HOT 3
- Asynchronous computation of Histogram/DecayingReservoir functions? HOT 1
- com.codahale.metrics.WeightedSnapshot$WeightedSample objects not being garbage collected
- com.codahale.metrics.WeightedSnapshot$WeightedSample objects not being garbage collected HOT 1
- JFR reporter HOT 1
- Cascading exceptions in InstrumentedHandler when `super.doStart` fails HOT 1
- HV000254 warning on ResponseMeteredLevel
- SlidingTimeWindowMovingAverages data race HOT 1
- Thoughts on improving visibility to SettableGauge
- Jetty 12 detailed response metrics bug: IndexOutOfBoundsException HOT 1
- InstrumentedEE10Handler not recording metrics on Jetty 12 with Jersey CompletableFuture HOT 13
- Overriding HTTP status code of healthcheck servlet is not possible anymore
- Rename metrics in Dropwzard MetricsRegistry in a Spring Boot application
- ScheduledReporter reports metrics when stopped/closed even when not started
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metrics.