Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

532 B
Raw Blame
use std::collections::HashMap;

use crate::types::SerializedKafkaMessage;

pub fn message(key: &str, partition: i32, offset: i64) -> SerializedKafkaMessage {
    SerializedKafkaMessage {
        topic: "events".into(),
        partition,
        offset,
        timestamp: 0,
        key: Some(key.to_string()),
        value: Some("{}".to_string()),
        headers: HashMap::new(),
        generation: 0,
    }
}

pub fn offsets(messages: &[SerializedKafkaMessage]) -> Vec<i64> {
    messages.iter().map(|m| m.offset).collect()
}