gpt4 book ai didi

com.sdg.cmdb.service.ZabbixHistoryService.acqResultValue()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 23:03:31 25 4
gpt4 key购买 nike

本文整理了Java中com.sdg.cmdb.service.ZabbixHistoryService.acqResultValue()方法的一些代码示例,展示了ZabbixHistoryService.acqResultValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZabbixHistoryService.acqResultValue()方法的具体详情如下:
包路径:com.sdg.cmdb.service.ZabbixHistoryService
类名称:ZabbixHistoryService
方法名:acqResultValue

ZabbixHistoryService.acqResultValue介绍

暂无

代码示例

代码示例来源:origin: ixrjog/opsCloud

private float acqDiskDataRate(ServerDO serverDO) {
  // diskRate
  try {
    String freeDiskOnData = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryFreeDiskSpaceOnData(serverDO, 1));
    float usedDiskOnData = -1;
    if (freeDiskOnData != null) {
      usedDiskOnData = 100 - Float.parseFloat(freeDiskOnData);
      BigDecimal b2 = new BigDecimal(usedDiskOnData);
      usedDiskOnData = b2.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
    }
    return usedDiskOnData;
  } catch (Exception e) {
    logger.error("计算磁盘使用率错误", e);
    return -1;
  }
}

代码示例来源:origin: ixrjog/opsCloud

private float acqDiskSysRate(ServerDO serverDO) {
  // diskRate
  try {
    String freeDiskOnSys = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryFreeDiskSpaceOnSys(serverDO, 1));
    float usedDiskOnSys = -1;
    if (freeDiskOnSys != null) {
      usedDiskOnSys = 100 - Float.parseFloat(freeDiskOnSys);
      BigDecimal b = new BigDecimal(usedDiskOnSys);
      usedDiskOnSys = b.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
    }
    return usedDiskOnSys;
  } catch (Exception e) {
    logger.error("计算磁盘使用率错误", e);
    return -1;
  }
}

代码示例来源:origin: ixrjog/opsCloud

private void updateTomcatVersionByServer(ServerDO serverDO) {
  ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(serverDO.getServerGroupId());
  if (configServerGroupService.isTomcatServer(serverGroupDO)) {
    String version = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryTomcatVersion(serverDO, 1));
    if (StringUtils.isEmpty(serverDO.getExtTomcatVersion()) || !serverDO.getExtTomcatVersion().equals(version)) {
      serverDO.setExtTomcatVersion(version);
      serverDao.updateServerTomcatVersion(serverDO);
    }
  }
}

代码示例来源:origin: ixrjog/opsCloud

String memoryTotal = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryMemoryTotal(serverDO, 1));
  long memoryRate = 100 - Long.parseLong(memoryAvailableMin) * 100 / Long.parseLong(memoryTotal);
  serverPerfVO.setMemoryRate(String.valueOf(memoryRate));
if (diskSysVolume != null) {
  try {
    long vaReadBps = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskReadBps(serverDO, diskSysVolume, 1)));
    long vaWriteBps = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskWriteBps(serverDO, diskSysVolume, 1)));
    serverPerfVO.setDiskSysBps(String.valueOf(vaReadBps + vaWriteBps));
    long vaReadIops = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskReadIops(serverDO, diskSysVolume, 1)));
    long vaWriteIops = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskWriteIops(serverDO, diskSysVolume, 1)));
    serverPerfVO.setDiskSysIops(String.valueOf(vaReadIops + vaWriteIops));
  } catch (Exception e) {
    long vaReadMs = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskReadMs(serverDO, diskSysVolume, 1)));
    long vaWriteMs = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskWriteMs(serverDO, diskSysVolume, 1)));
    serverPerfVO.setDiskSysReadMs(String.valueOf(vaReadMs));
    serverPerfVO.setDiskSysWriteMs(String.valueOf(vaWriteMs));
if (diskDataVolume != null) {
  try {
    long vbReadBps = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskReadBps(serverDO, diskDataVolume, 1)));
    long vbWriteBps = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskWriteBps(serverDO, diskDataVolume, 1)));
    serverPerfVO.setDiskDataBps(String.valueOf(vbReadBps + vbWriteBps));
    long vbReadIops = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskReadIops(serverDO, diskDataVolume, 1)));
    long vbWriteIops = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskWriteIops(serverDO, diskDataVolume, 1)));
    serverPerfVO.setDiskDataIops(String.valueOf(vbReadIops + vbWriteIops));

代码示例来源:origin: ixrjog/opsCloud

@Test
public void test() {
  ServerDO s1 = serverDao.getServerInfoById(752);
  ServerDO outway2 = serverDao.getServerInfoById(108);
  ServerDO serverDO = s1;
  System.err.println(s1);
  long sysDiskRate = 0;
  String freeDiskOnSys = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryFreeDiskSpaceOnSys(serverDO, 1));
  System.err.println("freeDiskOnSys:" + freeDiskOnSys);
  String freeDiskOnData = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryFreeDiskSpaceOnData(serverDO, 1));
  System.err.println("freeDiskOnData:" + freeDiskOnData);
  //sysDiskRate = Long.parseLong(usedDiskSpaceOnSys) * 100 / Long.parseLong(totalDiskSpaceOnSys);
  //String usedDiskSpaceOnData = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryUsedDiskSpaceOnData(serverDO, 1));
  //String totalDiskSpaceOnData = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryTotalDiskSpaceOnData(serverDO, 1));
  //long dataDiskRate = Long.parseLong(usedDiskSpaceOnData) * 100 / Long.parseLong(totalDiskSpaceOnData);
  //System.err.println("sysDiskRate:" + sysDiskRate);
  //System.err.println("dataDiskRate:" + dataDiskRate);
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com