1
2
3
4
5
6
7
8
9
10
11 package psiprobe.beans.stats.providers;
12
13 import jakarta.servlet.http.HttpServletRequest;
14
15 import java.util.List;
16
17 import org.jfree.data.xy.DefaultTableXYDataset;
18 import org.jfree.data.xy.XYDataItem;
19 import org.springframework.web.bind.ServletRequestBindingException;
20 import org.springframework.web.bind.ServletRequestUtils;
21
22 import psiprobe.model.stats.StatsCollection;
23
24
25
26
27 public class ConnectorSeriesProvider extends AbstractSeriesProvider {
28
29 @Override
30 public void populate(DefaultTableXYDataset dataset, StatsCollection statsCollection,
31 HttpServletRequest request) {
32
33 try {
34
35 String connectorName = ServletRequestUtils.getStringParameter(request, "cn");
36
37
38 String statType = ServletRequestUtils.getStringParameter(request, "st");
39
40 if (connectorName != null && statType != null) {
41 List<XYDataItem> stats =
42 statsCollection.getStats("stat.connector." + connectorName + "." + statType);
43 if (stats != null) {
44
45 String series1Legend = ServletRequestUtils.getStringParameter(request, "sl", "");
46 dataset.addSeries(toSeries(series1Legend, stats));
47 }
48 }
49 } catch (ServletRequestBindingException e) {
50 logger.error("", e);
51 }
52 }
53 }