<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/worker/v1/message.proto

namespace Temporal\Api\Worker\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Holds everything needed to identify the worker host/process context
 *
 * Generated from protobuf message <code>temporal.api.worker.v1.WorkerHostInfo</code>
 */
class WorkerHostInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Worker host identifier.
     *
     * Generated from protobuf field <code>string host_name = 1;</code>
     */
    protected $host_name = '';
    /**
     * Worker process identifier. This id should be unique for all _processes_
     * running workers in the namespace, and should be shared by all workers
     * in the same process.
     * This will be used to build the worker command nexus task queue name:
     * "temporal-sys/worker-commands/{process_key}"
     *
     * Generated from protobuf field <code>string process_key = 5;</code>
     */
    protected $process_key = '';
    /**
     * Worker process identifier. Unlike process_key, this id only needs to be unique
     * within one host (so using e.g. a unix pid would be appropriate).
     *
     * Generated from protobuf field <code>string process_id = 2;</code>
     */
    protected $process_id = '';
    /**
     * System used CPU as a float in the range [0.0, 1.0] where 1.0 is defined as all
     * cores on the host pegged.
     *
     * Generated from protobuf field <code>float current_host_cpu_usage = 3;</code>
     */
    protected $current_host_cpu_usage = 0.0;
    /**
     * System used memory as a float in the range [0.0, 1.0] where 1.0 is defined as
     * all available memory on the host is used.
     *
     * Generated from protobuf field <code>float current_host_mem_usage = 4;</code>
     */
    protected $current_host_mem_usage = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $host_name
     *           Worker host identifier.
     *     @type string $process_key
     *           Worker process identifier. This id should be unique for all _processes_
     *           running workers in the namespace, and should be shared by all workers
     *           in the same process.
     *           This will be used to build the worker command nexus task queue name:
     *           "temporal-sys/worker-commands/{process_key}"
     *     @type string $process_id
     *           Worker process identifier. Unlike process_key, this id only needs to be unique
     *           within one host (so using e.g. a unix pid would be appropriate).
     *     @type float $current_host_cpu_usage
     *           System used CPU as a float in the range [0.0, 1.0] where 1.0 is defined as all
     *           cores on the host pegged.
     *     @type float $current_host_mem_usage
     *           System used memory as a float in the range [0.0, 1.0] where 1.0 is defined as
     *           all available memory on the host is used.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Worker\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Worker host identifier.
     *
     * Generated from protobuf field <code>string host_name = 1;</code>
     * @return string
     */
    public function getHostName()
    {
        return $this->host_name;
    }

    /**
     * Worker host identifier.
     *
     * Generated from protobuf field <code>string host_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setHostName($var)
    {
        GPBUtil::checkString($var, True);
        $this->host_name = $var;

        return $this;
    }

    /**
     * Worker process identifier. This id should be unique for all _processes_
     * running workers in the namespace, and should be shared by all workers
     * in the same process.
     * This will be used to build the worker command nexus task queue name:
     * "temporal-sys/worker-commands/{process_key}"
     *
     * Generated from protobuf field <code>string process_key = 5;</code>
     * @return string
     */
    public function getProcessKey()
    {
        return $this->process_key;
    }

    /**
     * Worker process identifier. This id should be unique for all _processes_
     * running workers in the namespace, and should be shared by all workers
     * in the same process.
     * This will be used to build the worker command nexus task queue name:
     * "temporal-sys/worker-commands/{process_key}"
     *
     * Generated from protobuf field <code>string process_key = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setProcessKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->process_key = $var;

        return $this;
    }

    /**
     * Worker process identifier. Unlike process_key, this id only needs to be unique
     * within one host (so using e.g. a unix pid would be appropriate).
     *
     * Generated from protobuf field <code>string process_id = 2;</code>
     * @return string
     */
    public function getProcessId()
    {
        return $this->process_id;
    }

    /**
     * Worker process identifier. Unlike process_key, this id only needs to be unique
     * within one host (so using e.g. a unix pid would be appropriate).
     *
     * Generated from protobuf field <code>string process_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setProcessId($var)
    {
        GPBUtil::checkString($var, True);
        $this->process_id = $var;

        return $this;
    }

    /**
     * System used CPU as a float in the range [0.0, 1.0] where 1.0 is defined as all
     * cores on the host pegged.
     *
     * Generated from protobuf field <code>float current_host_cpu_usage = 3;</code>
     * @return float
     */
    public function getCurrentHostCpuUsage()
    {
        return $this->current_host_cpu_usage;
    }

    /**
     * System used CPU as a float in the range [0.0, 1.0] where 1.0 is defined as all
     * cores on the host pegged.
     *
     * Generated from protobuf field <code>float current_host_cpu_usage = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setCurrentHostCpuUsage($var)
    {
        GPBUtil::checkFloat($var);
        $this->current_host_cpu_usage = $var;

        return $this;
    }

    /**
     * System used memory as a float in the range [0.0, 1.0] where 1.0 is defined as
     * all available memory on the host is used.
     *
     * Generated from protobuf field <code>float current_host_mem_usage = 4;</code>
     * @return float
     */
    public function getCurrentHostMemUsage()
    {
        return $this->current_host_mem_usage;
    }

    /**
     * System used memory as a float in the range [0.0, 1.0] where 1.0 is defined as
     * all available memory on the host is used.
     *
     * Generated from protobuf field <code>float current_host_mem_usage = 4;</code>
     * @param float $var
     * @return $this
     */
    public function setCurrentHostMemUsage($var)
    {
        GPBUtil::checkFloat($var);
        $this->current_host_mem_usage = $var;

        return $this;
    }

}

