Skip to content

Commit

Permalink
Add a ProducerKind field to oximeter registration requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
bnaecker committed Nov 16, 2023
1 parent 8d468d8 commit e164d99
Show file tree
Hide file tree
Showing 8 changed files with 980 additions and 1,188 deletions.
2,075 changes: 920 additions & 1,155 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ num_enum = "0.7"
num-derive = "0.4"
num-traits = "0.2"
omicron-zone-package = "0.9.1"
openapiv3 = "1.0"
openapiv3 = "2.0.0-rc.1"
opentelemetry = "0.21.0"
opentelemetry-jaeger = { version = "0.17.0" }
percent-encoding = "2.3"
Expand Down Expand Up @@ -105,10 +105,10 @@ uuid = { version = "1", features = [ "serde", "v4" ] }

# git
dropshot = { git = "https://github.com/oxidecomputer/dropshot", branch = "main", features = [ "usdt-probes" ] }
omicron-common = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
omicron-common = { git = "https://github.com/oxidecomputer/omicron", branch = "add-oximeter-producer-kind" }
openapi-lint = { git = "https://github.com/oxidecomputer/openapi-lint", branch = "main" }
oximeter = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
oximeter-producer = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
oximeter = { git = "https://github.com/oxidecomputer/omicron", branch = "add-oximeter-producer-kind" }
oximeter-producer = { git = "https://github.com/oxidecomputer/omicron", branch = "add-oximeter-producer-kind" }
progenitor = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }

# local path
Expand Down
4 changes: 3 additions & 1 deletion crutest/src/stats.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright 2022 Oxide Computer Company
// Copyright 2023 Oxide Computer Company
use anyhow::{bail, Result};
use dropshot::{
ConfigDropshot, ConfigLogging, ConfigLoggingLevel, HandlerTaskMode,
};
use omicron_common::api::internal::nexus::ProducerEndpoint;
use omicron_common::api::internal::nexus::ProducerKind;
use oximeter_producer::{Config, LogConfig, Server};
use std::net::SocketAddr;
use uuid::Uuid;
Expand Down Expand Up @@ -31,6 +32,7 @@ pub async fn client_oximeter(

let server_info = ProducerEndpoint {
id: Uuid::new_v4(),
kind: Some(ProducerKind::Service),
address: my_address,
base_route: "/collect".to_string(),
interval: tokio::time::Duration::from_secs(10),
Expand Down
4 changes: 3 additions & 1 deletion downstairs/src/stats.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright 2021 Oxide Computer Company
// Copyright 2023 Oxide Computer Company
use super::*;

use dropshot::{
ConfigDropshot, ConfigLogging, ConfigLoggingIfExists, ConfigLoggingLevel,
HandlerTaskMode,
};
use omicron_common::api::internal::nexus::ProducerEndpoint;
use omicron_common::api::internal::nexus::ProducerKind;
use oximeter::{
types::{Cumulative, Sample},
Metric, MetricsError, Producer, Target,
Expand Down Expand Up @@ -152,6 +153,7 @@ pub async fn ox_stats(

let server_info = ProducerEndpoint {
id: Uuid::new_v4(),
kind: Some(ProducerKind::Service),
address: my_address,
base_route: "/collect".to_string(),
interval: Duration::from_secs(10),
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.70"
channel = "1.73"
profile = "default"
16 changes: 12 additions & 4 deletions upstairs/src/active_jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ impl BlockMap {
// We record every job, even if it's empty
self.job_to_range.insert(job, r);

let Some(r) = Self::blocks_to_range(r) else { return; };
let Some(r) = Self::blocks_to_range(r) else {
return;
};
self.insert_splits(r.clone());

// Iterate over the range covered by our new job, either modifying
Expand Down Expand Up @@ -468,7 +470,9 @@ impl BlockMap {
.next()
.map(|(start, _)| *start)
.or_else(|| self.addr_to_jobs.first_key_value().map(|(k, _)| *k))
else { return; };
else {
return;
};
while pos <= r.end {
let (end, value) = self.addr_to_jobs.get(&pos).unwrap();
let end = *end;
Expand Down Expand Up @@ -496,7 +500,9 @@ impl BlockMap {
.range(end..)
.next()
.map(|(start, _)| *start)
else { break; };
else {
break;
};
pos = next_pos;
}
}
Expand Down Expand Up @@ -530,7 +536,9 @@ impl BlockMap {
.job_to_range
.remove(&job)
.and_then(Self::blocks_to_range)
else { return; };
else {
return;
};

self.insert_splits(r.clone());

Expand Down
11 changes: 8 additions & 3 deletions upstairs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,11 @@ where
* If in_progress returns None, it means that this job on this
* client should be skipped.
*/
let Some(job) = u.downstairs.lock().await.in_progress(new_id, client_id)
else { continue; };
let Some(job) =
u.downstairs.lock().await.in_progress(new_id, client_id)
else {
continue;
};

match job {
IOop::Write {
Expand Down Expand Up @@ -4940,7 +4943,9 @@ impl Downstairs {

/// Reserves repair IDs if impacted blocks overlap our extent under repair
fn check_repair_ids_for_range(&mut self, impacted_blocks: ImpactedBlocks) {
let Some(eur) = self.get_extent_under_repair() else { return; };
let Some(eur) = self.get_extent_under_repair() else {
return;
};
let mut future_repair = false;
for eid in impacted_blocks.extents().into_iter().flatten() {
if eid == *eur.start() {
Expand Down
48 changes: 29 additions & 19 deletions workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ publish = false

### BEGIN HAKARI SECTION
[dependencies]
bitflags = { version = "2", default-features = false, features = ["serde"] }
bitflags = { version = "2", default-features = false, features = ["serde", "std"] }
bytes = { version = "1", features = ["serde"] }
chrono = { version = "0.4", features = ["serde"] }
console = { version = "0.15" }
Expand All @@ -28,76 +28,83 @@ futures-executor = { version = "0.3" }
futures-sink = { version = "0.3" }
futures-util = { version = "0.3", features = ["channel", "io", "sink"] }
getrandom = { version = "0.2", default-features = false, features = ["std"] }
hashbrown = { version = "0.12", features = ["raw"] }
hashbrown = { version = "0.14", features = ["raw"] }
hex = { version = "0.4", features = ["serde"] }
indexmap = { version = "1", default-features = false, features = ["serde-1", "std"] }
indexmap = { version = "2", features = ["serde"] }
libc = { version = "0.2", features = ["extra_traits"] }
log = { version = "0.4", default-features = false, features = ["std"] }
num-traits = { version = "0.2", features = ["libm"] }
openapiv3 = { version = "1", default-features = false, features = ["skip_serializing_defaults"] }
parking_lot = { version = "0.12", features = ["send_guard"] }
num-integer = { version = "0.1", default-features = false, features = ["i128", "std"] }
num-iter = { version = "0.1", default-features = false, features = ["i128", "std"] }
num-traits = { version = "0.2", features = ["i128", "libm"] }
openapiv3 = { version = "2.0.0-rc.1", default-features = false, features = ["skip_serializing_defaults"] }
phf_shared = { version = "0.11" }
rand = { version = "0.8", features = ["min_const_gen", "small_rng"] }
rand_chacha = { version = "0.3" }
rand_core = { version = "0.6", default-features = false, features = ["std"] }
reqwest = { version = "0.11", features = ["blocking", "json", "rustls-tls", "stream"] }
schemars = { version = "0.8", features = ["bytes", "chrono", "uuid1"] }
semver = { version = "1", features = ["serde"] }
serde = { version = "1", features = ["alloc", "derive", "rc"] }
serde = { version = "1", features = ["alloc", "derive"] }
slog = { version = "2", features = ["dynamic-keys", "max_level_trace", "release_max_level_debug"] }
syn-dff4ba8e3ae991db = { package = "syn", version = "1", features = ["extra-traits", "full", "visit", "visit-mut"] }
syn-dff4ba8e3ae991db = { package = "syn", version = "1", features = ["extra-traits", "full"] }
syn-f595c2ba2a3f28df = { package = "syn", version = "2", features = ["extra-traits", "full", "visit", "visit-mut"] }
time = { version = "0.3", features = ["formatting", "local-offset", "macros", "parsing"] }
tokio = { version = "1", features = ["full", "test-util"] }
toml_datetime = { version = "0.6", default-features = false, features = ["serde"] }
toml_edit = { version = "0.19", features = ["serde"] }
tracing = { version = "0.1" }
tracing-core = { version = "0.1" }
unicode-bidi = { version = "0.3" }
unicode-normalization = { version = "0.1" }
usdt = { version = "0.3" }
uuid = { version = "1", features = ["serde", "v4"] }

[build-dependencies]
bitflags = { version = "2", default-features = false, features = ["serde", "std"] }
bytes = { version = "1", features = ["serde"] }
cc = { version = "1", default-features = false, features = ["parallel"] }
chrono = { version = "0.4", features = ["serde"] }
getrandom = { version = "0.2", default-features = false, features = ["std"] }
hashbrown = { version = "0.12", features = ["raw"] }
indexmap = { version = "1", default-features = false, features = ["serde-1", "std"] }
hashbrown = { version = "0.14", features = ["raw"] }
indexmap = { version = "2", features = ["serde"] }
libc = { version = "0.2", features = ["extra_traits"] }
log = { version = "0.4", default-features = false, features = ["std"] }
num-traits = { version = "0.2", features = ["libm"] }
openapiv3 = { version = "1", default-features = false, features = ["skip_serializing_defaults"] }
num-traits = { version = "0.2", features = ["i128", "libm"] }
openapiv3 = { version = "2.0.0-rc.1", default-features = false, features = ["skip_serializing_defaults"] }
phf_shared = { version = "0.11" }
rand = { version = "0.8", features = ["min_const_gen", "small_rng"] }
rand_chacha = { version = "0.3" }
rand_core = { version = "0.6", default-features = false, features = ["std"] }
schemars = { version = "0.8", features = ["bytes", "chrono", "uuid1"] }
semver = { version = "1", features = ["serde"] }
serde = { version = "1", features = ["alloc", "derive", "rc"] }
syn-dff4ba8e3ae991db = { package = "syn", version = "1", features = ["extra-traits", "full", "visit", "visit-mut"] }
serde = { version = "1", features = ["alloc", "derive"] }
syn-dff4ba8e3ae991db = { package = "syn", version = "1", features = ["extra-traits", "full"] }
syn-f595c2ba2a3f28df = { package = "syn", version = "2", features = ["extra-traits", "full", "visit", "visit-mut"] }
time = { version = "0.3", features = ["formatting", "local-offset", "macros", "parsing"] }
time-macros = { version = "0.2", default-features = false, features = ["formatting", "parsing"] }
toml_datetime = { version = "0.6", default-features = false, features = ["serde"] }
toml_edit = { version = "0.19", features = ["serde"] }
unicode-bidi = { version = "0.3" }
unicode-normalization = { version = "0.1" }
uuid = { version = "1", features = ["serde", "v4"] }

[target.x86_64-unknown-linux-gnu.dependencies]
hyper = { version = "0.14", features = ["full"] }
mio = { version = "0.8", features = ["net", "os-ext"] }
once_cell = { version = "1", features = ["unstable"] }
rustix = { version = "0.38", features = ["fs", "termios"] }
rustls = { version = "0.21", features = ["dangerous_configuration"] }
tokio-util = { version = "0.7", features = ["codec", "io"] }
spin = { version = "0.9", default-features = false, features = ["once", "spin_mutex"] }
syn-dff4ba8e3ae991db = { package = "syn", version = "1", default-features = false, features = ["visit"] }

[target.x86_64-unknown-linux-gnu.build-dependencies]
once_cell = { version = "1", features = ["unstable"] }
syn-dff4ba8e3ae991db = { package = "syn", version = "1", default-features = false, features = ["visit"] }

[target.aarch64-apple-darwin.dependencies]
hyper = { version = "0.14", features = ["full"] }
mio = { version = "0.8", features = ["net", "os-ext"] }
once_cell = { version = "1", features = ["unstable"] }
rustix = { version = "0.38", features = ["fs", "termios"] }
rustls = { version = "0.21", features = ["dangerous_configuration"] }
tokio-util = { version = "0.7", features = ["codec", "io"] }

[target.aarch64-apple-darwin.build-dependencies]
once_cell = { version = "1", features = ["unstable"] }
Expand All @@ -106,10 +113,13 @@ once_cell = { version = "1", features = ["unstable"] }
hyper = { version = "0.14", features = ["full"] }
mio = { version = "0.8", features = ["net", "os-ext"] }
once_cell = { version = "1", features = ["unstable"] }
rustix = { version = "0.38", features = ["fs", "termios"] }
rustls = { version = "0.21", features = ["dangerous_configuration"] }
tokio-util = { version = "0.7", features = ["codec", "io"] }
spin = { version = "0.9", default-features = false, features = ["once", "spin_mutex"] }
syn-dff4ba8e3ae991db = { package = "syn", version = "1", default-features = false, features = ["visit"] }

[target.x86_64-unknown-illumos.build-dependencies]
once_cell = { version = "1", features = ["unstable"] }
syn-dff4ba8e3ae991db = { package = "syn", version = "1", default-features = false, features = ["visit"] }

### END HAKARI SECTION

0 comments on commit e164d99

Please sign in to comment.