Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
carve out limiters submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed Dec 12, 2023
1 parent f714f32 commit c9b22b4
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion capture/src/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use metrics::counter;
use time::OffsetDateTime;
use tracing::instrument;

use crate::billing_limits::QuotaResource;
use crate::event::{Compression, ProcessingContext};
use crate::limiters::billing_limits::QuotaResource;
use crate::prometheus::report_dropped_events;
use crate::token::validate_token;
use crate::{
Expand Down
3 changes: 1 addition & 2 deletions capture/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
pub mod api;
pub mod billing_limits;
pub mod capture;
pub mod config;
pub mod event;
pub mod health;
pub mod partition_limits;
pub mod limiters;
pub mod prometheus;
pub mod redis;
pub mod router;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ mod tests {
use time::Duration;

use crate::{
billing_limits::{BillingLimiter, QuotaResource},
limiters::billing_limits::{BillingLimiter, QuotaResource},
redis::MockRedisClient,
};

Expand Down
2 changes: 2 additions & 0 deletions capture/src/limiters/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod billing_limits;
pub mod partition_limits;
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl PartitionLimiter {

#[cfg(test)]
mod tests {
use crate::partition_limits::PartitionLimiter;
use crate::limiters::partition_limits::PartitionLimiter;
use std::num::NonZeroU32;

#[tokio::test]
Expand Down
4 changes: 3 additions & 1 deletion capture/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ use tower_http::cors::{AllowHeaders, AllowOrigin, CorsLayer};
use tower_http::trace::TraceLayer;

use crate::health::HealthRegistry;
use crate::{billing_limits::BillingLimiter, capture, redis::Client, sink, time::TimeSource};
use crate::{
capture, limiters::billing_limits::BillingLimiter, redis::Client, sink, time::TimeSource,
};

use crate::prometheus::{setup_metrics_recorder, track_metrics};

Expand Down
4 changes: 2 additions & 2 deletions capture/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use std::sync::Arc;

use time::Duration;

use crate::billing_limits::BillingLimiter;
use crate::config::Config;
use crate::health::{ComponentStatus, HealthRegistry};
use crate::partition_limits::PartitionLimiter;
use crate::limiters::billing_limits::BillingLimiter;
use crate::limiters::partition_limits::PartitionLimiter;
use crate::redis::RedisClient;
use crate::{router, sink};

Expand Down
4 changes: 2 additions & 2 deletions capture/src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::api::CaptureError;
use crate::config::KafkaConfig;
use crate::event::ProcessedEvent;
use crate::health::HealthHandle;
use crate::partition_limits::PartitionLimiter;
use crate::limiters::partition_limits::PartitionLimiter;
use crate::prometheus::report_dropped_events;

#[async_trait]
Expand Down Expand Up @@ -294,7 +294,7 @@ mod tests {
use crate::config;
use crate::event::ProcessedEvent;
use crate::health::HealthRegistry;
use crate::partition_limits::PartitionLimiter;
use crate::limiters::partition_limits::PartitionLimiter;
use crate::sink::{EventSink, KafkaSink};
use crate::utils::uuid_v7;
use rand::distributions::Alphanumeric;
Expand Down
2 changes: 1 addition & 1 deletion capture/tests/django_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use axum_test_helper::TestClient;
use base64::engine::general_purpose;
use base64::Engine;
use capture::api::{CaptureError, CaptureResponse, CaptureResponseCode};
use capture::billing_limits::BillingLimiter;
use capture::event::ProcessedEvent;
use capture::health::HealthRegistry;
use capture::limiters::billing_limits::BillingLimiter;
use capture::redis::MockRedisClient;
use capture::router::router;
use capture::sink::EventSink;
Expand Down

0 comments on commit c9b22b4

Please sign in to comment.