limit-lens 0.6.1

A simple API for testing and visualizing rate limiters in real-time. Monitor request throughput and see how your rate limiting algorithms perform under load.
Documentation
/*
 * Limit Lens API
 *
 * A simple API for testing and visualizing rate limiters in real-time. Monitor request throughput and see how your rate limiting algorithms perform under load.
 *
 * The version of the OpenAPI document: 0.6.1
 * Contact: sharmaninenine@gmail.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// TimeBucket : Time-bucketed request counts
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TimeBucket {
    /// Number of requests in this 1-second window
    #[serde(rename = "count")]
    pub count: i32,
    /// Calculated rate limit of the session at this time (requests/second)
    #[serde(rename = "rate_limit")]
    pub rate_limit: f64,
    /// Start time of this 1-second bucket
    #[serde(rename = "timestamp")]
    pub timestamp: String,
}

impl TimeBucket {
    /// Time-bucketed request counts
    pub fn new(count: i32, rate_limit: f64, timestamp: String) -> TimeBucket {
        TimeBucket {
            count,
            rate_limit,
            timestamp,
        }
    }
}