/** * 监控指标名称 * * 文档型数据库 / SQL型数据库 / 云函数 / 云托管 / 静态网站 / 身份认证 / API调用 / HTTP网关 / 大模型 / 知识库 / 用户登录 / 环境QPS / 数据库连接器 / 网关 */ export type MetricName = 'DbRead' | 'DbWrite' | 'DbCostTime10ms' | 'DbCostTime50ms' | 'DbCostTime100ms' | 'DbSizepkg' | 'MysqlStorageUsage' | 'MysqlCCU' | 'MysqlCpuUsageRate' | 'MysqlDbConnections' | 'MysqlMemoryUse' | 'MysqlSlowQueries' | 'MysqlTps' | 'MysqlQps' | 'FunctionCU' | 'FunctionInvocation' | 'FunctionFlux' | 'FunctionThrottle' | 'FunctionConcurrentExecutions' | 'FunctionTimeout' | 'FunctionGBs' | 'FunctionError' | 'FunctionDuration' | 'FunctionConcurrencyMemoryMB' | 'FunctionMemOverFlow' | 'FunctionIdleProvisioned' | 'FunctionProvisionedConcurrency' | 'TkeRspTimeService' | 'TkeCpuUsedService' | 'TkeMemUsedService' | 'TkeQPSService' | 'TkePodNumService' | 'TkeHttpServiceNatPkg' | 'TkeCUUsedService' | 'TkeInvokeNumService' | 'TkeHttpErrorService' | 'StaticFsFluxPkg' | 'StaticFsSizePkg' | 'AuthInvocationNumPkg' | 'GwCloudDevelopmentSecureCallsInvocation' | 'GwWXInvocation' | 'GwCloudDevelopmentStandardCallsInvocation' | 'AIPromptTokenNumPkg' | 'AICompletionTokenNumPkg' | 'AITotalTokenNumPkg' | 'KnowledgeBaseCapacity' | 'DayActiveLoginAnonymousUser' | 'DayActiveLoginAllUser' | 'DayActiveLoginExternalUser' | 'DayActiveLoginInternalUser' | 'EnvQPSAll' | 'MongoConnectorRead' | 'MongoConnectorWrite' | 'MongoConnectorCostTime10ms' | 'MongoConnectorCostTime50ms' | 'MongoConnectorCostTime100ms' | 'MongoConnectorInvokeNum' | 'GatewayTraceEnvQPS' | 'GatewayShowAPIInvokeNum' | 'GatewayShowAPICostTotal' | 'GatewayShowAPIHTTP2XX' | 'GatewayShowAPIHTTPError' | 'GatewayTraceAccessSourceQPS' | 'GatewayShowHttpInvokeNum' | 'GatewayShowHttpCostTotal' | 'GatewayShowHttpHTTP2XX' | 'GatewayShowHttpHTTPError' | 'GatewayTraceResourceQPS' | (string & {}); /** 统计周期(秒) */ export type MetricPeriod = 300 | 3600 | 86400; /** DescribeCurveData 请求参数 */ export interface IDescribeCurveDataParams { /** 指标名称 */ MetricName: MetricName; /** 开始时间,格式 'YYYY-MM-DD HH:mm:ss',需早于结束时间至少5分钟 */ StartTime: string; /** 结束时间,格式 'YYYY-MM-DD HH:mm:ss',需晚于开始时间至少5分钟 */ EndTime: string; /** * 资源ID(可选) * - 文档型数据库:集合名称 * - 云函数:函数名称 * - 云托管:服务名称(必传) * - 数据库连接器:实例id(必传) * - 网关-调用链路维度:小程序API传'wx',云开发API传'http_openapi'(必传) * - 网关-环境/资源维度:必传 * - 留空则查询整个 namespace 的指标 */ ResourceID?: string; /** 微信AppId,微信场景必传 */ WxAppId?: string; /** 子资源信息,查询云托管相关指标的具体版本的监控数据,需传入 */ SubresourceID?: string; /** 网关路由 */ ThirdResource?: string; /** * 统计周期(秒),仅支持 300 / 3600 / 86400 * 不传则根据时间范围自动选择: * - 1天内:300 * - 1天~15天:3600 * - 15天~180天:86400 * * 传入时需遵循以下约束: * - 时间范围 ≤ 1天:可取 300 或 3600 * - 时间范围 > 1天且 ≤ 3天:可取 300、3600 或 86400 * - 时间范围 > 3天:可取 3600 或 86400 */ Period?: MetricPeriod; } /** DescribeCurveData 响应结果 */ export interface IDescribeCurveDataResponse { /** 开始时间(会根据统计周期取整) */ StartTime: string; /** 结束时间(会根据统计周期取整) */ EndTime: string; /** 指标名 */ MetricName: string; /** 统计周期(秒) */ Period: number; /** 监控数据(整数),与 Time 一一对应 */ Values: number[]; /** 时间戳数组(Unix 时间戳,秒级),与 Values 一一对应 */ Time: number[]; /** 监控数据(浮点数),与 Time 一一对应 */ NewValues: number[]; /** 聚合方式:'last' | 'max' | 'avg' | 'sum' */ Statistics: string; /** 请求ID */ RequestId: string; }