Package com.skymobi.monitor.model

Examples of com.skymobi.monitor.model.ChartView


    }

    @RequestMapping(value = "/projects/{projectName}/metrics/add", method = RequestMethod.POST)
    public @ResponseBody
    ChartView addMetricView(ModelMap map, @PathVariable String projectName,HttpEntity<ChartView> entity ) {
        ChartView chartView=entity.getBody();
        Assert.notNull(chartView.getTitle());
        Project project = projectService.findProject(projectName);
        project.getChartViews().add(chartView);
        projectService.saveProject(project);
        return  chartView;
    }
View Full Code Here


    @RequestMapping(value = "/projects/{projectName}/metrics/show", method = RequestMethod.GET)
    public @ResponseBody ModelMap  show(ModelMap map, @PathVariable String projectName, String title) {
        Project project = projectService.findProject(projectName);

        List<List<MetricValue>>  metricLists=Lists.newArrayList();
            ChartView view = null;
        for(ChartView chartView:project.getChartViews()){
            if(title.equals(chartView.getTitle()))
            {
                view=chartView;
                break;
            }
        }
        if(view!=null){
            for(String name:view.getMetricNames()){
                metricLists.add(project.findMetricData(name));
            }

            map.put("data", ChartUtil.format(metricLists,false));
        }
View Full Code Here

        List<ChartView> chartViews = project.getChartViews();
        Map<String, String> views = project.getViews();

        if (chartViews.isEmpty() && !views.isEmpty()) {
            for (String metricName : views.keySet()) {
                ChartView view=new ChartView();
                view.setTitle(metricName);
                view.setMetricNames(Lists.newArrayList(views.get(metricName).split(",")));
                chartViews.add(view);
            }

        }
        if (chartViews.isEmpty()) {
            for (String metricName : project.findMetricNames())  {
                ChartView view=new ChartView();
                view.setTitle(metricName);
                view.setMetricNames(Lists.newArrayList(metricName));
                chartViews.add(view);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.skymobi.monitor.model.ChartView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.