Skip to content

Commit

Permalink
CaptureType -> CaptureMode
Browse files Browse the repository at this point in the history
  • Loading branch information
frankh committed Aug 20, 2024
1 parent 09fb23f commit e349a3c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ services:
KAFKA_TOPIC: 'events_plugin_ingestion'
KAFKA_HOSTS: 'kafka:9092'
REDIS_URL: 'redis://redis:6379/'
CAPTURE_TYPE: events
CAPTURE_MODE: events

replay-capture:
image: ghcr.io/posthog/posthog/capture:master
Expand All @@ -179,7 +179,7 @@ services:
KAFKA_TOPIC: 'session_recording_snapshot_item_events'
KAFKA_HOSTS: 'kafka:9092'
REDIS_URL: 'redis://redis:6379/'
CAPTURE_TYPE: recordings
CAPTURE_MODE: recordings

plugins:
command: ./bin/plugin-server --no-restart-loop
Expand Down
8 changes: 4 additions & 4 deletions rust/capture/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
limiters::billing::BillingLimiter, redis::Client, sinks, time::TimeSource, v0_endpoint,
};

use crate::config::CaptureType;
use crate::config::CaptureMode;
use crate::prometheus::{setup_metrics_recorder, track_metrics};

const EVENT_BODY_SIZE: usize = 2 * 1024 * 1024; // 2MB
Expand Down Expand Up @@ -44,7 +44,7 @@ pub fn router<
redis: Arc<R>,
billing: BillingLimiter,
metrics: bool,
capture_type: CaptureType,
capture_type: CaptureMode,
) -> Router {
let state = State {
sink: Arc::new(sink),
Expand Down Expand Up @@ -123,8 +123,8 @@ pub fn router<
);

let router = match capture_type {
CaptureType::Events => Router::new().merge(batch_router).merge(event_router),
CaptureType::Recordings => Router::new().merge(recordings_router),
CaptureMode::Events => Router::new().merge(batch_router).merge(event_router),
CaptureMode::Recordings => Router::new().merge(recordings_router),
}
.merge(status_router)
.layer(TraceLayer::new_for_http())
Expand Down
4 changes: 2 additions & 2 deletions rust/capture/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use tokio::sync::Notify;
use tokio::time::timeout;
use tracing::{debug, warn};

use capture::config::{CaptureType, Config, KafkaConfig};
use capture::config::{CaptureMode, Config, KafkaConfig};
use capture::limiters::billing::QuotaResource;
use capture::server::serve;

Expand Down Expand Up @@ -55,7 +55,7 @@ pub static DEFAULT_CONFIG: Lazy<Config> = Lazy::new(|| Config {
otel_service_name: "capture-testing".to_string(),
export_prometheus: false,
redis_key_prefix: None,
capture_type: CaptureType::Events,
capture_type: CaptureMode::Events,
});

static TRACING_INIT: Once = Once::new();
Expand Down
4 changes: 2 additions & 2 deletions rust/capture/tests/django_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use axum_test_helper::TestClient;
use base64::engine::general_purpose;
use base64::Engine;
use capture::api::{CaptureError, CaptureResponse, CaptureResponseCode, DataType, ProcessedEvent};
use capture::config::CaptureType;
use capture::config::CaptureMode;
use capture::limiters::billing::BillingLimiter;
use capture::redis::MockRedisClient;
use capture::router::router;
Expand Down Expand Up @@ -111,7 +111,7 @@ async fn it_matches_django_capture_behaviour() -> anyhow::Result<()> {
redis,
billing,
false,
CaptureType::Events,
CaptureMode::Events,
);

let client = TestClient::new(app);
Expand Down

0 comments on commit e349a3c

Please sign in to comment.