Package com.spotify.helios.common.descriptors

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


  @Override
  protected void runOneIteration() throws InterruptedException {
    final String hostname = exec("uname -n").trim();
    final String uname = exec("uname -a").trim();

    final HostInfo hostInfo = HostInfo.newBuilder()
        .setArchitecture(operatingSystemMXBean.getArch())
        .setCpus(Runtime.getRuntime().availableProcessors())
        .setHostname(hostname)
        .setLoadAvg(operatingSystemMXBean.getSystemLoadAverage())
        .setOsName(operatingSystemMXBean.getName())
        .setOsVersion(operatingSystemMXBean.getVersion())
        .setMemoryFreeBytes(operatingSystemMXBean.getFreePhysicalMemorySize())
        .setMemoryTotalBytes(operatingSystemMXBean.getTotalPhysicalMemorySize())
        .setSwapFreeBytes(operatingSystemMXBean.getFreeSwapSpaceSize())
        .setSwapTotalBytes(operatingSystemMXBean.getTotalSwapSpaceSize())
        .setUname(uname)
        .setDockerVersion(dockerVersion())
        .build();

    nodeUpdater.update(hostInfo.toJsonBytes());
  }
View Full Code Here

            if (taskStatus.getState() == TaskStatus.State.RUNNING) {
              runningDeployedJobs.add(taskStatus);
            }
          }

          final HostInfo hi = s.getHostInfo();
          final String memUsage;
          final String cpus;
          final String mem;
          final String loadAvg;
          final String os;
          final String docker;
          if (hi != null) {
            final long free = hi.getMemoryFreeBytes();
            final long total = hi.getMemoryTotalBytes();
            memUsage = format("%.2f", (float) (total - free) / total);
            cpus = String.valueOf(hi.getCpus());
            mem = hi.getMemoryTotalBytes() / (1024 * 1024 * 1024) + " gb";
            loadAvg = format("%.2f", hi.getLoadAvg());
            os = hi.getOsName() + " " + hi.getOsVersion();
            final DockerVersion dv = hi.getDockerVersion();
            docker = (dv != null) ? format("%s (%s)", dv.getVersion(), dv.getApiVersion()) : "";
          } else {
            memUsage = cpus = mem = loadAvg = os = docker = "";
          }

View Full Code Here

TOP

Related Classes of com.spotify.helios.common.descriptors.HostInfo

Copyright © 2018 www.massapicom. 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.