当前位置: 首页>>代码示例>>Java>>正文


Java MetricsRequest类代码示例

本文整理汇总了Java中org.apache.kylin.rest.request.MetricsRequest的典型用法代码示例。如果您正苦于以下问题:Java MetricsRequest类的具体用法?Java MetricsRequest怎么用?Java MetricsRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MetricsRequest类属于org.apache.kylin.rest.request包,在下文中一共展示了MetricsRequest类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculateMetrics

import org.apache.kylin.rest.request.MetricsRequest; //导入依赖的package包/类
public MetricsResponse calculateMetrics(MetricsRequest request) {
    List<CubeInstance> cubes = this.getCubeManager().listAllCubes();
    MetricsResponse metrics = new MetricsResponse();
    Date startTime = (null == request.getStartTime()) ? new Date(-1) : request.getStartTime();
    Date endTime = (null == request.getEndTime()) ? new Date() : request.getEndTime();
    metrics.increase("totalCubes", (float) 0);
    metrics.increase("totalStorage", (float) 0);

    for (CubeInstance cube : cubes) {
        Date createdDate = new Date(-1);
        createdDate = (cube.getCreateTimeUTC() == 0) ? createdDate : new Date(cube.getCreateTimeUTC());

        if (createdDate.getTime() > startTime.getTime() && createdDate.getTime() < endTime.getTime()) {
            metrics.increase("totalCubes");
        }
    }

    metrics.increase("aveStorage",
            (metrics.get("totalCubes") == 0) ? 0 : metrics.get("totalStorage") / metrics.get("totalCubes"));

    return metrics;
}
 
开发者ID:apache,项目名称:kylin,代码行数:23,代码来源:CubeService.java

示例2: calculateMetrics

import org.apache.kylin.rest.request.MetricsRequest; //导入依赖的package包/类
public MetricsResponse calculateMetrics(MetricsRequest request) {
    List<CubeInstance> cubes = this.getCubeManager().listAllCubes();
    MetricsResponse metrics = new MetricsResponse();
    Date startTime = (null == request.getStartTime()) ? new Date(-1) : request.getStartTime();
    Date endTime = (null == request.getEndTime()) ? new Date() : request.getEndTime();
    metrics.increase("totalCubes", (float) 0);
    metrics.increase("totalStorage", (float) 0);

    for (CubeInstance cube : cubes) {
        Date createdDate = new Date(-1);
        createdDate = (cube.getCreateTimeUTC() == 0) ? createdDate : new Date(cube.getCreateTimeUTC());

        if (createdDate.getTime() > startTime.getTime() && createdDate.getTime() < endTime.getTime()) {
            metrics.increase("totalCubes");
        }
    }

    metrics.increase("aveStorage", (metrics.get("totalCubes") == 0) ? 0 : metrics.get("totalStorage") / metrics.get("totalCubes"));

    return metrics;
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:22,代码来源:CubeService.java

示例3: cubeMetrics

import org.apache.kylin.rest.request.MetricsRequest; //导入依赖的package包/类
@RequestMapping(value = "/metrics/cubes", method = { RequestMethod.GET }, produces = { "application/json" })
@ResponseBody
public MetricsResponse cubeMetrics(MetricsRequest request) {
    return cubeMgmtService.calculateMetrics(request);
}
 
开发者ID:apache,项目名称:kylin,代码行数:6,代码来源:AdminController.java

示例4: cubeMetrics

import org.apache.kylin.rest.request.MetricsRequest; //导入依赖的package包/类
@RequestMapping(value = "/metrics/cubes", method = { RequestMethod.GET })
@ResponseBody
public MetricsResponse cubeMetrics(MetricsRequest request) {
    return cubeMgmtService.calculateMetrics(request);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:6,代码来源:AdminController.java


注:本文中的org.apache.kylin.rest.request.MetricsRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。