# Not getting JVM stats in Java API (0.19.2)

**URL:** <https://discuss.elastic.co/t/not-getting-jvm-stats-in-java-api-0-19-2/7439>\
**Category:** Elasticsearch\
**Created:** [April 23, 2012, 8:44am UTC](https://discuss.elastic.co/t/not-getting-jvm-stats-in-java-api-0-19-2/7439 "2012-04-23T08:44:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rore/32/399_2.png) [@rore](https://discuss.elastic.co/u/rore)\
**Post date:** [April 23, 2012, 8:44am UTC](https://discuss.elastic.co/t/not-getting-jvm-stats-in-java-api-0-19-2/7439/1 "2012-04-23T08:44:37Z")

</div>

I've upgraded ES to 0.19.2. I'm using the Java API to collect stats. Since  
the upgrade the jvm method on the NodeStats returns null instead of the JVM  
stats object.  
Is there something changed in 0.19.2 in the way you need to get those stats?

---

<div class="post-metadata">

**Author:** ![rore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rore/32/399_2.png) [@rore](https://discuss.elastic.co/u/rore)\
**Post date:** [April 23, 2012, 9:01am UTC](https://discuss.elastic.co/t/not-getting-jvm-stats-in-java-api-0-19-2/7439/2 "2012-04-23T09:01:09Z")

</div>

OK, I was looking at the 0.18.7 sources instead of the new version.  
So for someone stumbling on this - since 0.19.X you need to explicitly set  
the flags of the stats you want to get (or call all() to get all stats).

On Monday, April 23, 2012 11:44:37 AM UTC+3, Rotem wrote:

> I've upgraded ES to 0.19.2. I'm using the Java API to collect stats. Since  
> the upgrade the jvm method on the NodeStats returns null instead of the JVM  
> stats object.  
> Is there something changed in 0.19.2 in the way you need to get those  
> stats?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:31am UTC](https://discuss.elastic.co/t/not-getting-jvm-stats-in-java-api-0-19-2/7439/3 "2017-07-06T03:31:24Z")

</div>

Closed on July 6, 2017, 3:31am UTC


