Repository: pinpoint-apm/pinpoint
Issue: Scatter chart stuck, how to reset settings
Labels: bug

Hi. 

I use Pinpoint RC2

No idea why my scatter chart is not working anymore (It was fine for a couple of weeks)

![image](https://cloud.githubusercontent.com/assets/561441/20931919/0fa15564-bbd3-11e6-860f-fa790eb5066c.png)

... Maybe after I set Y Axis to 30 ms , but I can't change it anymore, as I can't click on options gear 
(the cursor is in crosshair mode, no click possible)

I could find that the following request: http://server/getScatterData.pinpoint?to=1481038925000&from=1481038625000&limit=5000&filter=&application=APPLICATION&xGroupUnit=987&yGroupUnit=0

returns: 

"java.lang.IllegalArgumentException: **yGroupUnit(0)** must be positive number\r\n\tat com.navercorp.pinpoint.web.controller.ScatterChartController.getScatterData(ScatterChartController.java:156)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)\r\n\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:775)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)\r\n\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)\r\n\tat 
....


Could you please tell me: 

- Where are stored these GUI settings (they seem permanent) and how to reset to defaults ? 
- What is yGroupUnit ? Is it related to Y max value on the graph ? 

Thanks 




Issue comments:
@ofauchon 
Sorry it is bug of scatter chart.
GUI value stored in localStorage. if you want to remove your setting you must clear your localStorage.

@ofauchon 
I fixed this issue. 
Could you retry it using current master branch.

Thanks for reporting!
I'll rebuild from master and test that ASAP. 

Thanks for the fix.

 

Pull request review comments:

Patch that resolved the issue:
diff --git a/web/src/main/java/com/navercorp/pinpoint/web/controller/ScatterChartController.java b/web/src/main/java/com/navercorp/pinpoint/web/controller/ScatterChartController.java
index 6e09b6b564dd..e90a79c52755 100644
--- a/web/src/main/java/com/navercorp/pinpoint/web/controller/ScatterChartController.java
+++ b/web/src/main/java/com/navercorp/pinpoint/web/controller/ScatterChartController.java
@@ -16,23 +16,6 @@
 
 package com.navercorp.pinpoint.web.controller;
 
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.util.StopWatch;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.ModelAndView;
-
 import com.navercorp.pinpoint.common.server.bo.SpanBo;
 import com.navercorp.pinpoint.common.util.DateUtils;
 import com.navercorp.pinpoint.common.util.TransactionId;
@@ -48,6 +31,22 @@
 import com.navercorp.pinpoint.web.vo.LimitedScanResult;
 import com.navercorp.pinpoint.web.vo.Range;
 import com.navercorp.pinpoint.web.vo.TransactionMetadataQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.util.StopWatch;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @author netspider
@@ -152,8 +151,8 @@ public ModelAndView getScatterData(
         if (xGroupUnit <= 0) {
             throw new IllegalArgumentException("xGroupUnit(" + xGroupUnit + ") must be positive number");
         }
-        if (yGroupUnit <= 0) {
-            throw new IllegalArgumentException("yGroupUnit(" + yGroupUnit + ") must be positive number");
+        if (yGroupUnit < 0) {
+            throw new IllegalArgumentException("yGroupUnit(" + yGroupUnit + ") may not be negative number");
         }
 
         limit = LimitUtils.checkRange(limit);
@@ -167,9 +166,9 @@ public ModelAndView getScatterData(
 
         ModelAndView mv = null;
         if (StringUtils.isEmpty(filterText)) {
-            mv = selectScatterData(applicationName, range, xGroupUnit, yGroupUnit, limit, backwardDirection, version);
+            mv = selectScatterData(applicationName, range, xGroupUnit, Math.max(yGroupUnit, 1), limit, backwardDirection, version);
         } else {
-            mv = selectFilterScatterData(applicationName, range, xGroupUnit, yGroupUnit, limit, backwardDirection, filterText, version);
+            mv = selectFilterScatterData(applicationName, range, xGroupUnit, Math.max(yGroupUnit, 1), limit, backwardDirection, filterText, version);
         }
 
         if (jsonpCallback == null) {


Test patch: