<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: src/proto/grpc/testing/stats.proto

namespace Grpc\Testing;

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

/**
 * Generated from protobuf message <code>grpc.testing.ServerStats</code>
 */
class ServerStats extends \Google\Protobuf\Internal\Message
{
    /**
     * wall clock time change in seconds since last reset
     *
     * Generated from protobuf field <code>double time_elapsed = 1;</code>
     */
    protected $time_elapsed = 0.0;
    /**
     * change in user time (in seconds) used by the server since last reset
     *
     * Generated from protobuf field <code>double time_user = 2;</code>
     */
    protected $time_user = 0.0;
    /**
     * change in server time (in seconds) used by the server process and all
     * threads since last reset
     *
     * Generated from protobuf field <code>double time_system = 3;</code>
     */
    protected $time_system = 0.0;
    /**
     * change in total cpu time of the server (data from proc/stat)
     *
     * Generated from protobuf field <code>uint64 total_cpu_time = 4;</code>
     */
    protected $total_cpu_time = 0;
    /**
     * change in idle time of the server (data from proc/stat)
     *
     * Generated from protobuf field <code>uint64 idle_cpu_time = 5;</code>
     */
    protected $idle_cpu_time = 0;
    /**
     * Number of polls called inside completion queue
     *
     * Generated from protobuf field <code>uint64 cq_poll_count = 6;</code>
     */
    protected $cq_poll_count = 0;
    /**
     * Core library stats
     *
     * Generated from protobuf field <code>.grpc.core.Stats core_stats = 7;</code>
     */
    protected $core_stats = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $time_elapsed
     *           wall clock time change in seconds since last reset
     *     @type float $time_user
     *           change in user time (in seconds) used by the server since last reset
     *     @type float $time_system
     *           change in server time (in seconds) used by the server process and all
     *           threads since last reset
     *     @type int|string $total_cpu_time
     *           change in total cpu time of the server (data from proc/stat)
     *     @type int|string $idle_cpu_time
     *           change in idle time of the server (data from proc/stat)
     *     @type int|string $cq_poll_count
     *           Number of polls called inside completion queue
     *     @type \Grpc\Core\Stats $core_stats
     *           Core library stats
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Src\Proto\Grpc\Testing\Stats::initOnce();
        parent::__construct($data);
    }

    /**
     * wall clock time change in seconds since last reset
     *
     * Generated from protobuf field <code>double time_elapsed = 1;</code>
     * @return float
     */
    public function getTimeElapsed()
    {
        return $this->time_elapsed;
    }

    /**
     * wall clock time change in seconds since last reset
     *
     * Generated from protobuf field <code>double time_elapsed = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setTimeElapsed($var)
    {
        GPBUtil::checkDouble($var);
        $this->time_elapsed = $var;

        return $this;
    }

    /**
     * change in user time (in seconds) used by the server since last reset
     *
     * Generated from protobuf field <code>double time_user = 2;</code>
     * @return float
     */
    public function getTimeUser()
    {
        return $this->time_user;
    }

    /**
     * change in user time (in seconds) used by the server since last reset
     *
     * Generated from protobuf field <code>double time_user = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setTimeUser($var)
    {
        GPBUtil::checkDouble($var);
        $this->time_user = $var;

        return $this;
    }

    /**
     * change in server time (in seconds) used by the server process and all
     * threads since last reset
     *
     * Generated from protobuf field <code>double time_system = 3;</code>
     * @return float
     */
    public function getTimeSystem()
    {
        return $this->time_system;
    }

    /**
     * change in server time (in seconds) used by the server process and all
     * threads since last reset
     *
     * Generated from protobuf field <code>double time_system = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setTimeSystem($var)
    {
        GPBUtil::checkDouble($var);
        $this->time_system = $var;

        return $this;
    }

    /**
     * change in total cpu time of the server (data from proc/stat)
     *
     * Generated from protobuf field <code>uint64 total_cpu_time = 4;</code>
     * @return int|string
     */
    public function getTotalCpuTime()
    {
        return $this->total_cpu_time;
    }

    /**
     * change in total cpu time of the server (data from proc/stat)
     *
     * Generated from protobuf field <code>uint64 total_cpu_time = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setTotalCpuTime($var)
    {
        GPBUtil::checkUint64($var);
        $this->total_cpu_time = $var;

        return $this;
    }

    /**
     * change in idle time of the server (data from proc/stat)
     *
     * Generated from protobuf field <code>uint64 idle_cpu_time = 5;</code>
     * @return int|string
     */
    public function getIdleCpuTime()
    {
        return $this->idle_cpu_time;
    }

    /**
     * change in idle time of the server (data from proc/stat)
     *
     * Generated from protobuf field <code>uint64 idle_cpu_time = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setIdleCpuTime($var)
    {
        GPBUtil::checkUint64($var);
        $this->idle_cpu_time = $var;

        return $this;
    }

    /**
     * Number of polls called inside completion queue
     *
     * Generated from protobuf field <code>uint64 cq_poll_count = 6;</code>
     * @return int|string
     */
    public function getCqPollCount()
    {
        return $this->cq_poll_count;
    }

    /**
     * Number of polls called inside completion queue
     *
     * Generated from protobuf field <code>uint64 cq_poll_count = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCqPollCount($var)
    {
        GPBUtil::checkUint64($var);
        $this->cq_poll_count = $var;

        return $this;
    }

    /**
     * Core library stats
     *
     * Generated from protobuf field <code>.grpc.core.Stats core_stats = 7;</code>
     * @return \Grpc\Core\Stats
     */
    public function getCoreStats()
    {
        return $this->core_stats;
    }

    /**
     * Core library stats
     *
     * Generated from protobuf field <code>.grpc.core.Stats core_stats = 7;</code>
     * @param \Grpc\Core\Stats $var
     * @return $this
     */
    public function setCoreStats($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Core\Stats::class);
        $this->core_stats = $var;

        return $this;
    }

}

