/**
 * # Throttle Snapshots
 * Point-in-time information regarding throttle usage.
 *
 * ### Keywords
 * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
 * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
 * document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119)
 * and clarified in [RFC8174](https://www.ietf.org/rfc/rfc8174).
 */
syntax = "proto3";

package proto;

// SPDX-License-Identifier: Apache-2.0
import "services_timestamp.proto";

option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.throttles">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
 * All point-in-time snapshots of throttle usage for TPS, "gas" throttle
 * values for a given point in time and evm ops duration throttle.
 *
 * > Question:
 * >> What point in time?  Should this store consensus timestamp here?
 */
message ThrottleUsageSnapshots {

    /**
     * A list of snapshots for TPS throttles.
     * <p>
     * <blockquote>Question:<blockquote>What is the order?</blockquote></blockquote>
     */
    repeated ThrottleUsageSnapshot tps_throttles = 1;

    /**
     * A single snapshot for the gas throttle.
     */
    ThrottleUsageSnapshot gas_throttle = 2;

    /**
     * A single snapshot for evm ops duration throttle.
     */
    ThrottleUsageSnapshot evm_ops_duration_throttle = 3;
}

/**
 * A single snapshot of the used throttle capacity for a throttle and point in
 * time.
 *
 * > Question:
 * >> What throttle does this apply to? How is that determined?
 */
message ThrottleUsageSnapshot {
    /**
     * Used throttle capacity.
     */
    int64 used = 1;

    /**
     * The time at which the this snapshot of capacity was calculated.<br/>
     * Stored as an offset from the `epoch`.
     * <p>
     * For this purpose, `epoch` SHALL be the UNIX epoch with 0 at `1970-01-01T00:00:00.000Z`.
     */
    Timestamp last_decision_time = 2;
}
