Skip to content

Commit

Permalink
Implement pull-based logs collector (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalabukdima authored Nov 22, 2024
1 parent 9aefa09 commit 4e43990
Show file tree
Hide file tree
Showing 11 changed files with 402 additions and 408 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ members = ["crates/*"]
resolver = "2"

[workspace.dependencies]
sqd-contract-client = { git = "https://github.com/subsquid/subsquid-network.git", rev = "c25a986", version = "1.0.7" }
sqd-messages = { git = "https://github.com/subsquid/subsquid-network.git", rev = "c25a986", version = "2.0.0", features = ["bitstring"] }
sqd-network-transport = { git = "https://github.com/subsquid/subsquid-network.git", rev = "c25a986", version = "2.0.0" }
sqd-contract-client = { git = "https://github.com/subsquid/sqd-network.git", rev = "a311acc", version = "1.1.0" }
sqd-messages = { git = "https://github.com/subsquid/sqd-network.git", rev = "a311acc", version = "2.0.0", features = ["bitstring"] }
sqd-network-transport = { git = "https://github.com/subsquid/sqd-network.git", rev = "a311acc", version = "2.0.0" }
5 changes: 3 additions & 2 deletions crates/collector-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[package]
name = "collector-utils"
version = "1.0.0"
version = "2.0.0"
edition = "2021"

[dependencies]
anyhow = "1"
async-trait = "0.1"
base64 = "0.22"
clap = { version = "4", features = ["derive", "env"] }
clickhouse = "0.12"
lazy_static = "1"
Expand All @@ -15,8 +16,8 @@ serde_bytes = "0.11"
serde_repr = "0.1"

sqd-messages = { workspace = true }
sqd-network-transport = { workspace = true }

[dev-dependencies]
test-with = "0.13"
sqd-network-transport = { workspace = true }
tokio = { version = "1", features = ["full"] }
13 changes: 2 additions & 11 deletions crates/collector-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
use std::time::UNIX_EPOCH;

mod cli;
mod storage;
mod utils;

pub use crate::cli::ClickhouseArgs;
pub use crate::storage::{ClickhouseStorage, PingRow, QueryExecutedRow, Storage};

pub fn timestamp_now_ms() -> u64 {
UNIX_EPOCH
.elapsed()
.expect("We're after 1970")
.as_millis()
.try_into()
.expect("But not that far")
}
pub use crate::utils::*;
Loading

0 comments on commit 4e43990

Please sign in to comment.