Examples of HostInfo


Examples of com.dianping.cat.core.dal.Hostinfo

        if (!insert) {
          m_logger.warn(String.format("Error when insert domain %s info", domain));
        }
      }
      Hostinfo info = m_hostinfoService.findByIp(ip);

      if (info == null) {
        m_hostinfoService.insert(domain, ip);
      } else {
        String oldDomain = info.getDomain();

        if (!domain.equals(oldDomain) && !Constants.CAT.equals(oldDomain)) {
          // only work on online environment
          long current = System.currentTimeMillis();
          Date lastModifiedDate = info.getLastModifiedDate();

          if (lastModifiedDate != null && (current - lastModifiedDate.getTime()) > ONE_HOUR) {
            m_hostinfoService.update(info.getId(), domain, ip);
            m_logger.info(String.format("old domain is %s , change ip %s to %s", oldDomain, ip, domain));
          }
        }
      }
    }
View Full Code Here

Examples of com.dianping.cat.report.page.cross.display.HostInfo

        }
      }
      break;
    case HOURLY_HOST:
      CrossReport hostReport = getHourlyReport(payload);
      HostInfo hostInfo = new HostInfo(payload.getHourDuration());

      hostInfo.setHostinfoService(m_hostinfoService);
      hostInfo.setClientIp(model.getIpAddress()).setCallSortBy(model.getCallSort())
            .setServiceSortBy(model.getServiceSort());
      hostInfo.setProjectName(payload.getProjectName());
      hostInfo.visitCrossReport(hostReport);
      model.setReport(hostReport);
      model.setHostInfo(hostInfo);
      break;
    case HOURLY_METHOD:
      CrossReport methodReport = getHourlyReport(payload);
      MethodInfo methodInfo = new MethodInfo(payload.getHourDuration());

      methodInfo.setHostinfoService(m_hostinfoService);
      methodInfo.setClientIp(model.getIpAddress()).setCallSortBy(model.getCallSort())
            .setServiceSortBy(model.getServiceSort()).setRemoteProject(payload.getProjectName());
      methodInfo.setRemoteIp(payload.getRemoteIp()).setQuery(model.getQueryName());
      methodInfo.visitCrossReport(methodReport);
      model.setReport(methodReport);
      model.setMethodInfo(methodInfo);
      break;
    case HISTORY_PROJECT:
      CrossReport historyProjectReport = getSummarizeReport(payload);
      ProjectInfo historyProjectInfo = new ProjectInfo(historyTime);

      historyProjectInfo.setHostinfoService(m_hostinfoService);
      historyProjectInfo.setClientIp(model.getIpAddress()).setCallSortBy(model.getCallSort())
            .setServiceSortBy(model.getServiceSort());
      historyProjectInfo.visitCrossReport(historyProjectReport);
      model.setProjectInfo(historyProjectInfo);
      model.setReport(historyProjectReport);

      List<TypeDetailInfo> historyDetails = historyProjectInfo.getServiceProjectsInfo();

      if (historyProjectInfo.getCallerProjectsInfo().isEmpty()) {
        for (TypeDetailInfo info : historyDetails) {
          String projectName = info.getProjectName();
          if (projectName.equalsIgnoreCase(payload.getDomain()) || projectName.equalsIgnoreCase("UnknownProject")
                || projectName.equalsIgnoreCase(ProjectInfo.ALL_CLIENT)) {
            continue;
          }
          Date start = payload.getHistoryStartDate();
          Date end = payload.getHistoryEndDate();
          ProjectInfo temp = buildHistoryCallProjectInfo(projectName, start, end);

          TypeDetailInfo detail = temp.getAllCallProjectInfo().get(domain);

          if (detail != null) {
            detail.setProjectName(projectName);
            historyProjectInfo.addCallerProjectInfo(projectName, detail);
          }
        }
      }
      break;
    case HISTORY_HOST:
      CrossReport historyHostReport = getSummarizeReport(payload);
      HostInfo historyHostInfo = new HostInfo(historyTime);

      historyHostInfo.setHostinfoService(m_hostinfoService);
      historyHostInfo.setClientIp(model.getIpAddress()).setCallSortBy(model.getCallSort())
            .setServiceSortBy(model.getServiceSort());
      historyHostInfo.setProjectName(payload.getProjectName());
      historyHostInfo.visitCrossReport(historyHostReport);
      model.setReport(historyHostReport);
      model.setHostInfo(historyHostInfo);
      break;
    case HISTORY_METHOD:
      CrossReport historyMethodReport = getSummarizeReport(payload);
View Full Code Here

Examples of com.github.theholywaffle.teamspeak3.api.wrapper.HostInfo

  }

  public HostInfo getHostInfo() {
    CHostInfo info = new CHostInfo();
    if (query.doCommand(info)) {
      return new HostInfo(info.getFirstResponse().getMap());
    }
    return null;
  }
View Full Code Here

Examples of com.spotify.helios.common.descriptors.HostInfo

    if (stat == null) {
      return null;
    }

    final boolean up = checkHostUp(client, host);
    final HostInfo hostInfo = getHostInfo(client, host);
    final AgentInfo agentInfo = getAgentInfo(client, host);
    final Map<JobId, Deployment> tasks = getTasks(client, host);
    final Map<JobId, TaskStatus> statuses = getTaskStatuses(client, host);
    final Map<String, String> environment = getEnvironment(client, host);
View Full Code Here

Examples of com.sun.grid.jgdi.monitoring.HostInfo

        return suite;
    }
   
    private void printResult(QHostResult res) {
        for (String hostname : res.getHostNames()) {
            HostInfo hostInfo = res.getHostInfo(hostname);
            logger.fine("Host " + hostname + " ---------------------");
            for (String hostValueNames : hostInfo.getHostValueKeys()) {
                logger.fine("HostValue: " + hostValueNames + " = " + hostInfo.getHostValue(hostValueNames));
            }
           
            for (QueueInfo qi : hostInfo.getQueueList()) {
                logger.fine("  Queue: " + qi.getQname());
                logger.fine("  Qtype: " + qi.getQtype());
                logger.fine("  State: " + qi.getState());
                logger.fine("  total: " + qi.getTotalSlots());
                logger.fine("  used:  " + qi.getUsedSlots());
            }
           
            for (String dom : hostInfo.getDominanceSet()) {
                for (String resourceValueName : hostInfo.getResourceValueNames(dom)) {
                    logger.fine("Resource: " + dom + ": " + resourceValueName + " = " + hostInfo.getResourceValue(dom, resourceValueName));
                }
            }
        }
    }
View Full Code Here

Examples of com.sun.grid.jgdi.monitoring.HostInfo

                HostFilter hf = new HostFilter();
                hf.addHost(eh.getName());
                qhostOptions.setHostFilter(hf);
                QHostResult res = jgdi.execQHost(qhostOptions);
                printResult(res);
                HostInfo hi = res.getHostInfo(eh.getName());
                assertNotNull(hi);
                for (ClusterQueue cq : cqList) {
                    for (QueueInstance cqi : cq.getQinstancesList()) {
                        if (cqi.getQhostname().equals(eh.getName())) {
                            boolean foundq = false;
                            for (QueueInfo qi : hi.getQueueList()) {
                                String hqname = qi.getQname();
                                // System.out.println("++ comparing cq.getName() " + cq.getName() +
                                //                      " and hqname " + hqname);
                                if (cq.getName().equals(hqname)) {
                                    //   System.out.println("-- matching cq.getName() " + cq.getName() +
View Full Code Here

Examples of com.sun.grid.jgdi.monitoring.HostInfo

                    ResourceAttributeFilter resourceAttributeFilter = new ResourceAttributeFilter();
                    resourceAttributeFilter.addValueName(loadValueName);
                    qhostOptions.setResourceAttributeFilter(resourceAttributeFilter);
                    QHostResult res = jgdi.execQHost(qhostOptions);
                    printResult(res);
                    HostInfo hi = res.getHostInfo(eh.getName());
                    assertNotNull(hi);
                    assertNotNull("Resource Value " + loadValueName + " not found", hi.getResourceValue("hl", loadValueName));
                }
            }
        } finally {
            jgdi.close();
        }
View Full Code Here

Examples of lcmc.crm.ui.resource.HostInfo

     */
    @Override
    protected void oneVertexPressed(final Vertex v) {
        pickVertex(v);
        if (vertexToHostMap.containsKey(v)) {
            final HostInfo hi = vertexToHostMap.get(v);
            if (hi != null) {
                guiData.setTerminalPanel(hi.getHost().getTerminalPanel());
                getClusterBrowser().setRightComponentInView(hi);
            }
        } else if (vertexToConstraintPHMap.containsKey(v)) {
            final ConstraintPHInfo cphi = vertexToConstraintPHMap.get(v);
            if (cphi != null) {
View Full Code Here

Examples of org.apache.ambari.server.agent.HostInfo

    injector.getInstance(PersistService.class).stop();
  }

  @Test
  public void testHostInfoImport() throws AmbariException{
    HostInfo info = new HostInfo();
    info.setMemorySize(100);
    info.setProcessorCount(10);
    info.setPhysicalProcessorCount(2);
    List<DiskInfo> mounts = new ArrayList<DiskInfo>();
    mounts.add(new DiskInfo("/dev/sda", "/mnt/disk1",
        "5000000", "4000000", "10%", "size", "fstype"));
    info.setMounts(mounts);

    info.setHostName("foo");
    info.setInterfaces("fip_4");
    info.setArchitecture("os_arch");
    info.setOS("os_type");
    info.setMemoryTotal(10);

    clusters.addHost("foo");
    Host host = clusters.getHost("foo");

    host.importHostInfo(info);

    Assert.assertEquals(info.getHostName(), host.getHostName());
    Assert.assertEquals(info.getFreeMemory(), host.getAvailableMemBytes());
    Assert.assertEquals(info.getMemoryTotal(), host.getTotalMemBytes());
    Assert.assertEquals(info.getProcessorCount(), host.getCpuCount());
    Assert.assertEquals(info.getPhysicalProcessorCount(), host.getPhCpuCount());
    Assert.assertEquals(info.getMounts().size(), host.getDisksInfo().size());
    Assert.assertEquals(info.getArchitecture(), host.getOsArch());
    Assert.assertEquals(info.getOS(), host.getOsType());
  }
View Full Code Here

Examples of org.apache.ambari.server.agent.HostInfo

    Assert.assertEquals("redhat6", os);
   
  }

  private void registerHost(Host host, boolean firstReg) throws Exception {
    HostInfo info = new HostInfo();
    info.setMemorySize(100);
    info.setProcessorCount(10);
    List<DiskInfo> mounts = new ArrayList<DiskInfo>();
    mounts.add(new DiskInfo("/dev/sda", "/mnt/disk1",
        "5000000", "4000000", "10%", "size", "fstype"));
    info.setMounts(mounts);

    info.setHostName("foo");
    info.setInterfaces("fip_4");
    info.setArchitecture("os_arch");
    info.setOS("os_type");
    info.setMemoryTotal(10);

    AgentVersion agentVersion = null;
    long currentTime = System.currentTimeMillis();
   
    AgentEnv agentEnv = new AgentEnv();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.