Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ members = [
"crates/control-plane",
"crates/data-plane",
"crates/internal-metrics",
"crates/precompute",
"crates/query",
"crates/storage",
]

Expand Down Expand Up @@ -39,7 +41,10 @@ tokio = { version = "1.0", features = ["full"] }
axum = "0.7"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
control_plane = { path = "crates/control-plane" }
common = { path = "crates/common" }
internal_metrics = { path = "crates/internal-metrics" }
precompute = { path = "crates/precompute" }
query = { path = "crates/query" }
storage = { path = "crates/storage" }

# asap_sketchlib#271's head, ahead of the Planner's pin (389530c): DDSketch
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,11 @@ not stored) with a Prometheus `execution` error (422,
| Path | Holds |
|---|---|
| `crates/control-plane/` | package `control_plane`: workload → `asap-planner` → plan file |
| `crates/data-plane/` | package `data_plane`: the data plane and its binary |
| `crates/storage/` | package `storage`: raw samples and views in memory, the view cache, segments and persistence |
| `crates/common/` | package `common`: the engine boundary's types and the `FallbackClient` trait |
| `crates/data-plane/` | package `data_plane`: the binary, its CLI and HTTP routes, and the engine that wires the crates below |
| `crates/precompute/` | package `precompute`: ingest shards, the ingest coordinator, push pipelines and the precompute pool |
| `crates/query/` | package `query`: planned queries on the query workers, and the result cache |
| `crates/storage/` | package `storage`: raw samples and views in memory, the view cache, segments, persistence and the persist threads |
| `crates/internal-metrics/` | package `internal_metrics`: the backend's measurements of itself, exported on `/metrics` |
| `benchmarks/` | the backend alone: `micro/` benchmarks (examples of `data_plane`) and `scripts/` |
| `eval/` | comparisons with other systems and the live demo; see [eval/README.md](eval/README.md) |
Expand Down
11 changes: 6 additions & 5 deletions benchmarks/micro/ingest_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ use std::time::Instant;
use axum::body::Body;
use axum::http::{Request, StatusCode};
use control_plane::{plan_workload, DeploymentInputs};
use data_plane::engine::{EngineOptions, PrecomputeMode};
use data_plane::ingestion::IngestionOptions;
use data_plane::engine::EngineOptions;
use data_plane::remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use data_plane::{router, DataPlane};
use internal_metrics::thread_cpu_seconds;
use precompute::engine::PrecomputeMode;
use precompute::ingestion::IngestionOptions;
use tower::ServiceExt;

#[tokio::main(flavor = "multi_thread")]
Expand Down Expand Up @@ -125,13 +126,13 @@ async fn main() {
.map_or(EngineOptions::default().ingest_threads, |n| {
n.parse().unwrap()
}),
push_batching: data_plane::push::MorselBatching {
push_batching: precompute::push::MorselBatching {
max_samples: std::env::var("PUSH_BATCH_SAMPLES").map_or(
data_plane::push::MorselBatching::default().max_samples,
precompute::push::MorselBatching::default().max_samples,
|n| n.parse().unwrap(),
),
max_age_ms: std::env::var("PUSH_BATCH_MAX_MS").map_or(
data_plane::push::MorselBatching::default().max_age_ms,
precompute::push::MorselBatching::default().max_age_ms,
|n| n.parse().unwrap(),
),
},
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/micro/matrix_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::sync::Arc;
use std::time::Instant;

use data_plane::prometheus::range_response_body;
use data_plane::query::ResultSample;
use query::ResultSample;

fn main() {
let args: Vec<usize> = std::env::args()
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/micro/offset_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use axum::http::{Request, StatusCode};
use axum::Router;
use control_plane::plan_workload;
use data_plane::engine::EngineOptions;
use data_plane::ingestion::IngestionOptions;
use data_plane::remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use data_plane::{router, DataPlane};
use http_body_util::BodyExt;
use precompute::ingestion::IngestionOptions;
use serde_json::json;
use tower::ServiceExt;

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/micro/range_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ use axum::http::{Request, StatusCode};
use axum::Router;
use control_plane::{plan_workload, DeploymentInputs};
use data_plane::engine::EngineOptions;
use data_plane::ingestion::IngestionOptions;
use data_plane::remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use data_plane::{router, DataPlane, EXECUTION_HEADER};
use http_body_util::BodyExt;
use internal_metrics::thread_cpu_seconds;
use precompute::ingestion::IngestionOptions;
use tower::ServiceExt;

const STEP_MS: i64 = 15_000;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/micro/tier_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ use axum::http::{Request, StatusCode};
use axum::Router;
use control_plane::{plan_workload, DeploymentInputs};
use data_plane::engine::EngineOptions;
use data_plane::ingestion::IngestionOptions;
use data_plane::remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use data_plane::{router, DataPlane};
use http_body_util::BodyExt;
use precompute::ingestion::IngestionOptions;
use storage::persist::ViewRead;
use tower::ServiceExt;

Expand Down
6 changes: 6 additions & 0 deletions crates/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ pub use query_result::{
Table, TableValue,
};

/// The largest time, in milliseconds either side of the epoch, the data
/// plane takes a sample at or answers a query at; beyond it a sample is
/// dropped and a query refused, as Prometheus refuses a time it cannot
/// represent. Leaves room for any window offset.
pub const MAX_TIME_MS: i64 = i64::MAX / 4;

/// One series' labels, name to value, `__name__` included, as query results
/// carry them.
pub type LabelSet = std::collections::BTreeMap<String, String>;
Expand Down
3 changes: 3 additions & 0 deletions crates/data-plane/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ edition.workspace = true
[dependencies]
asap-planner.workspace = true
asap-executor.workspace = true
common.workspace = true
internal_metrics.workspace = true
precompute.workspace = true
query.workspace = true
storage.workspace = true
ahash = "0.8"
# The per-thread series cache of the Remote Write decoder (a table of
Expand Down
Loading