<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/appengine/v1/version.proto

namespace Google\Cloud\AppEngine\V1;

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

/**
 * Target scaling by CPU usage.
 *
 * Generated from protobuf message <code>google.appengine.v1.CpuUtilization</code>
 */
class CpuUtilization extends \Google\Protobuf\Internal\Message
{
    /**
     * Period of time over which CPU utilization is calculated.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration aggregation_window_length = 1;</code>
     */
    private $aggregation_window_length = null;
    /**
     * Target CPU utilization ratio to maintain when scaling. Must be between 0
     * and 1.
     *
     * Generated from protobuf field <code>double target_utilization = 2;</code>
     */
    private $target_utilization = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Duration $aggregation_window_length
     *           Period of time over which CPU utilization is calculated.
     *     @type float $target_utilization
     *           Target CPU utilization ratio to maintain when scaling. Must be between 0
     *           and 1.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Appengine\V1\Version::initOnce();
        parent::__construct($data);
    }

    /**
     * Period of time over which CPU utilization is calculated.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration aggregation_window_length = 1;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getAggregationWindowLength()
    {
        return $this->aggregation_window_length;
    }

    public function hasAggregationWindowLength()
    {
        return isset($this->aggregation_window_length);
    }

    public function clearAggregationWindowLength()
    {
        unset($this->aggregation_window_length);
    }

    /**
     * Period of time over which CPU utilization is calculated.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration aggregation_window_length = 1;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setAggregationWindowLength($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->aggregation_window_length = $var;

        return $this;
    }

    /**
     * Target CPU utilization ratio to maintain when scaling. Must be between 0
     * and 1.
     *
     * Generated from protobuf field <code>double target_utilization = 2;</code>
     * @return float
     */
    public function getTargetUtilization()
    {
        return $this->target_utilization;
    }

    /**
     * Target CPU utilization ratio to maintain when scaling. Must be between 0
     * and 1.
     *
     * Generated from protobuf field <code>double target_utilization = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setTargetUtilization($var)
    {
        GPBUtil::checkDouble($var);
        $this->target_utilization = $var;

        return $this;
    }

}

