etsy / statsd-jvm-profiler

Simple JVM Profiler Using StatsD and Other Metrics Backends
MIT License
330 stars 93 forks source link

Problems writing directly to InfluxDB #24

Closed ibobak closed 9 years ago

ibobak commented 9 years ago

I'm getting this problem: Exception in thread "Thread-1" java.lang.NullPointerException at org.influxdb.impl.TimeUtil.toTimePrecision(TimeUtil.java:21) at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:155) at com.etsy.statsd.profiler.reporter.InfluxDBReporter.recordGaugeValues(InfluxDBReporter.java:69) at com.etsy.statsd.profiler.Profiler.recordGaugeValues(Profiler.java:73) at com.etsy.statsd.profiler.profilers.MemoryProfiler.recordStats(MemoryProfiler.java:108) at com.etsy.statsd.profiler.profilers.MemoryProfiler.flushData(MemoryProfiler.java:49) at com.etsy.statsd.profiler.worker.ProfilerShutdownHookWorker.run(ProfilerShutdownHookWorker.java:22) at java.lang.Thread.run(Thread.java:744)

Steps to reproduce: 1) download http://sourceforge.net/projects/suprfractalthng/ - the jar file name is superfractalthing_0.8.3.jar 2) install InfluxDB on another machine 3) run this set of commands:

export _JAVA_OPTIONS='-javaagent:/var/lib/statsd-jvm-profiler-0.8.1-SNAPSHOT.jar=server=192.168.56.101,port=8086,reporter=InfluxDBReporter,database=monitoring,username=monitoring,password=monitoring,profiler=CPUProfilers'

java -jar superfractalthing_0.8.3.jar

(I've built the profiler by git cloning your repository first, then "maven package", then copied to /var/lib/; then I created a database called "monitoring" with the same username and password in the InfluxDB).

4) play with the app, close the app. And you will get an exception.

ajsquared commented 9 years ago

Thanks for reporting this, I was able to reproduce the problem. I'll look into it.

ajsquared commented 9 years ago

This should be fixed now. Let us know if you have additional issues!

ibobak commented 9 years ago

yes, it works fine. thank you.