---
title: "getMetricData方法"
author: "kang"
date: "2010-01-15T15:53:05Z"
tags: []
categories: ["企业架构"]
slug: "getmetricdata"
draft: false
lastmod: "2010-01-15T15:53:05Z"
id: 571193
url: "https://kang.iteye.com/blog/571193"
---

getMetricData：

Calculates metrics on collected data for the dates specified.  
对于指定日期内收集数据的计算指标。

Note:  
getMetricData API applies the same constrains as getQueryData to the startTime/endTime/aggPeriod, and also return the same format data as getQueryData. See getQueryData description.  
说明：  
getMetricData API和getQueryData API使用相同的限制条件，比如开始时间、结束时间和aggPeriod，  
并且返回和getQueryData相同格式的数据。参见getQueryData描述。

参数  
Parameters:  
 1.entityId  the unique identifier of the entity   
 entity id：entity独一无二的标识符(唯一标识符)  
   
 2.metricType  the type of metric   
 metricType：度量的类型  
   
 3.aggregationLevel  the level to which to aggregate the collected data   
 aggregationLevel：对收集数据的合计等级(即在哪一个等级上合计统计收集到的数据)  
   
 4.startTime  The time at which to start the query. For queries that do not include a measurement granularity greater 360 seconds, use a multiple of 6 minutes (360 seconds). For queries with measurement granularity greater than 360 seconds, use a multiple of measurement granularity. A NULL value sets startTime to the earliest time in the database.   
开始时间：开始query的时间。  
对于查询，假如测量粒度大于360秒，就使用6分钟（360秒）的倍数。  
假如测量粒度大于360秒，则使用测量粒度的倍数。  
将startTime设置成NULL值，作为数据库中的最早时间。  
   
 5.endTime  The time at which to end the query. A null value sets endTime to the latest time in the database.   
结束时间：结束查询的时间。将endTime设置成NULL值，作为数据库中的最迟时间。  
   
 6.aggPeriod  the period, in seconds, over which the collected data is aggregated. Must be a multiple of the largest measurement granularity value during the time range of this call. A value of 0 sets the aggPeriod to the smallest possible value. A value of -1 sets the aggPeriod to the largest possible value.  
To get the largest sampling frequency during the time range of this call, call getMetricAggregationPeriodList().   
aggPeriod：期间，秒做计量单位，在哪一个范围内收集到的数据被统计。必须是这个方法的时间范围上的最大测量粒度的倍数。  
将aggPeriod设置为0值，作为最小的可能值。将aggPeriod设置为-1值，作为最大的可能值。  
假如想在这个方法的时间范围上获取最大的采样粒度，请调用方法getMetricAggregationPeriodList()。