@Test public void testGetCurrentThreadCount() { System.out.println("getCurrentThreadCount"); long now = System.currentTimeMillis(); SampleResult sample = new SampleResult(); sample.setGroupThreads(3); sample.setThreadName("test_tg"); sample.setStampAndTime(now, 300); AbstractVsThreadVisualizer instance = new AbstractVsThreadVisualizerImpl(); instance.add(sample); int expResult = 3; int result = instance.getCurrentThreadCount(sample); assertEquals(expResult, result); }
protected int getCurrentThreadCount(SampleResult res) { int ret; if (state.size() > 1) { ret = 0; for (AbstractGraphRow abstractGraphRow : state.values()) { AbstractGraphPanelChartElement element = abstractGraphRow.getLowerElement(res.getStartTime()); if (element != null) ret += element.getValue(); } } else { ret = res.getGroupThreads(); } return ret; }
AbstractVsThreadVisualizer extends AbstractGraphPanelVisualizer { protected int getCurrentThreadCount(SampleResult res) { int ret; if (state.size() > 1) { ret = 0; for (AbstractGraphRow abstractGraphRow : state.values()) { AbstractGraphPanelChartElement element = abstractGraphRow.getLowerElement(res.getStartTime()); if (element != null) ret += element.getValue(); } } else { ret = res.getGroupThreads(); } return ret; } }
AbstractVsThreadVisualizer extends AbstractGraphPanelVisualizer { protected int getCurrentThreadCount(SampleResult res) { int ret; if (state.size() > 1) { ret = 0; for (AbstractGraphRow abstractGraphRow : state.values()) { AbstractGraphPanelChartElement element = abstractGraphRow.getLowerElement(res.getStartTime()); if (element != null) ret += element.getValue(); } } else { ret = res.getGroupThreads(); } return ret; } AbstractVsThreadVisualizer(); }
AbstractVsThreadVisualizer extends AbstractGraphPanelVisualizer { protected int getCurrentThreadCount(SampleResult res) { int ret; if (state.size() > 1) { ret = 0; for (AbstractGraphRow abstractGraphRow : state.values()) { AbstractGraphPanelChartElement element = abstractGraphRow.getLowerElement(res.getStartTime()); if (element != null) ret += element.getValue(); } } else { ret = res.getGroupThreads(); } return ret; } AbstractVsThreadVisualizer(); @Override void add(SampleResult res); @Override void clearData(); }
AbstractVsThreadVisualizer extends AbstractGraphPanelVisualizer { protected int getCurrentThreadCount(SampleResult res) { int ret; if (state.size() > 1) { ret = 0; for (AbstractGraphRow abstractGraphRow : state.values()) { AbstractGraphPanelChartElement element = abstractGraphRow.getLowerElement(res.getStartTime()); if (element != null) ret += element.getValue(); } } else { ret = res.getGroupThreads(); } return ret; } AbstractVsThreadVisualizer(); @Override void add(SampleResult res); @Override void clearData();  }