-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53b600d
commit e92b381
Showing
10 changed files
with
390 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use std::sync::Arc; | ||
|
||
use common_types::ClickHouseEvent; | ||
use cymbal::{ | ||
get_props, | ||
hack::kafka::{create_kafka_producer, send_iter_to_kafka, KafkaConfig}, | ||
}; | ||
use envconfig::Envconfig; | ||
use health::HealthRegistry; | ||
|
||
const EXCEPTION_DATA: &str = include_str!("../../tests/static/raw_ch_exception_list.json"); | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let config = KafkaConfig::init_from_env().unwrap(); | ||
let health = Arc::new(HealthRegistry::new("test")); | ||
let handle = health | ||
.register("rdkafka".to_string(), std::time::Duration::from_secs(30)) | ||
.await; | ||
let producer = create_kafka_producer(&config, handle).await.unwrap(); | ||
|
||
let exception: ClickHouseEvent = serde_json::from_str(EXCEPTION_DATA).unwrap(); | ||
let exceptions = (0..10000).map(|_| exception.clone()).collect::<Vec<_>>(); | ||
get_props(&exception).unwrap(); | ||
|
||
loop { | ||
println!("Sending {} exception kafka", exceptions.len()); | ||
send_iter_to_kafka(&producer, "exception_symbolification_events", &exceptions) | ||
.await | ||
.unwrap(); | ||
tokio::time::sleep(std::time::Duration::from_secs(1)).await; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export KAFKA_CONSUMER_GROUP="cymbal" | ||
export KAFKA_CONSUMER_TOPIC="exception_symbolification_events" | ||
export OBJECT_STORAGE_BUCKET="posthog" | ||
export OBJECT_STORAGE_ACCESS_KEY_ID="object_storage_root_user" | ||
export OBJECT_STORAGE_SECRET_ACCESS_KEY="object_storage_root_password" | ||
|
||
cargo run --bin cymbal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.