总览
所有文档

          边缘计算节点 BEC

          总览

          总览

          总览是BEC的资源信息操作实例。

          查询资源概览信息

          使用以下代码可以查看当前资源使用量的汇总信息:

          public void getBecResourceSummary(BecClient client) {
              GetBecResourceSummaryRequest request = new GetBecResourceSummaryRequest();
              GetBecResourceSummaryResponse response = client.getBecResourceSummary(request);
          }

          查询容器资源概览信息

          如下代码可以查询容器概览信息

          public void getBecContainerSummary(BecClient client) {
              GetBecContainerSummaryRequest request = new GetBecContainerSummaryRequest();
              GetBecContainerSummaryResponse response = client.getBecContainerSummary(request);
          }

          查询虚机资源概览信息

          如下代码可以查询虚机概览信息

          public void getBecVmSummary(BecClient client) {
              GetBecVMSummaryRequest request = new GetBecVMSummaryRequest();
              GetBecVMSummaryResponse response = client.getBecVmSummary(request);
          }

          获取容器资源概览监控信息

          如下代码可以获取用户容器资源对于指定监控指标的使用量趋势

          public void getBecContainerMetrics(BecClient client) {
              GetBecContainerMetricsRequest request = new GetBecContainerMetricsRequest();
              // 支持监控信息的类型,包括cpu,memory,bandwidth_receive(入网带宽),bandwidth_transmit(出网带宽)
              request.setType("bandwidth_receive");
              // 偏移时间
              request.setOffsetInSeconds(3600);
              GetBecContainerMetricsResponse response = client.getBecContainerMetrics(request);
          }

          获取虚机资源概览监控信息

          如下代码可以获取用户虚机资源对于指定监控指标的使用量趋势

          public void getBecVmMetrics(BecClient client) {
              GetBecVmMetricsRequest request = new GetBecVmMetricsRequest();
              // 支持监控信息的类型,包括cpu,memory,bandwidth_receive(入网带宽),bandwidth_transmit(出网带宽)
              request.setType("bandwidth_receive");
              // 偏移时间
              request.setOffsetInSeconds(3600);
              GetBecVmMetricsResponse response = client.getBecVmMetrics(request);
          }
          上一篇
          BecClient
          下一篇
          虚机服务