Skip to content

Commit

Permalink
revert: Run cargo hack on each workspace member and all targets (vect…
Browse files Browse the repository at this point in the history
…ordotdev#11462)

This reverts commit 3596e31.
  • Loading branch information
jszwedko authored Feb 18, 2022
1 parent 3596e31 commit 7d07201
Show file tree
Hide file tree
Showing 23 changed files with 479 additions and 469 deletions.
6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -791,12 +791,6 @@ dnstap-integration-tests = ["sources-dnstap", "bollard"]
disable-resolv-conf = []
shutdown-tests = ["api", "rdkafka", "sinks-blackhole", "sinks-console", "sinks-prometheus", "sources", "transforms-log_to_metric", "transforms-lua", "transforms-remap", "unix"]
cli-tests = ["sinks-blackhole", "sinks-socket", "sources-demo_logs", "sources-file"]
vector-api-tests = [
"sources-demo_logs",
"transforms-log_to_metric",
"transforms-remap",
"sinks-blackhole"
]
vector-unit-test-tests = [
"sources-demo_logs",
"transforms-add_fields",
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ check-all: check-scripts

.PHONY: check-component-features
check-component-features: ## Check that all component features are setup properly
${MAYBE_ENVIRONMENT_EXEC} cargo hack check --workspace --each-feature --exclude-features "sources-utils-http sources-utils-http-encoding sources-utils-http-prelude sources-utils-http-query sources-utils-tcp-keepalive sources-utils-tcp-socket sources-utils-tls sources-utils-udp sources-utils-unix sinks-utils-udp" --all-targets
${MAYBE_ENVIRONMENT_EXEC} cargo hack check --each-feature --exclude-features "sources-utils-http sources-utils-http-encoding sources-utils-http-prelude sources-utils-http-query sources-utils-tcp-keepalive sources-utils-tcp-socket sources-utils-tls sources-utils-udp sources-utils-unix sinks-utils-udp"

.PHONY: check-clippy
check-clippy: ## Check code with Clippy
Expand Down
8 changes: 3 additions & 5 deletions benches/codecs/character_delimited_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use criterion::{
};
use std::{fmt, time::Duration};
use tokio_util::codec::Decoder;
use vector::codecs::{
self, decoding::Deserializer, decoding::Framer, BytesDeserializer, CharacterDelimitedDecoder,
};
use vector::codecs::{self, BytesDeserializer, CharacterDelimitedDecoder};

#[derive(Debug)]
struct Param {
Expand Down Expand Up @@ -46,13 +44,13 @@ fn decoding(c: &mut Criterion) {
|b, param| {
b.iter_batched(
|| {
let framer = Framer::CharacterDelimited(
let framer = Box::new(
param
.max_length
.map(|ml| CharacterDelimitedDecoder::new_with_max_length(b'a', ml))
.unwrap_or(CharacterDelimitedDecoder::new(b'a')),
);
let deserializer = Deserializer::Bytes(BytesDeserializer::new());
let deserializer = Box::new(BytesDeserializer::new());
let decoder = codecs::Decoder::new(framer, deserializer);

(Box::new(decoder), param.input.clone())
Expand Down
8 changes: 3 additions & 5 deletions benches/codecs/newline_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use criterion::{
};
use std::{fmt, time::Duration};
use tokio_util::codec::Decoder;
use vector::codecs::{
self, decoding::Deserializer, decoding::Framer, BytesDeserializer, NewlineDelimitedDecoder,
};
use vector::codecs::{self, BytesDeserializer, NewlineDelimitedDecoder};

#[derive(Debug)]
struct Param {
Expand Down Expand Up @@ -46,13 +44,13 @@ fn decoding(c: &mut Criterion) {
|b, param| {
b.iter_batched(
|| {
let framer = Framer::NewlineDelimited(
let framer = Box::new(
param
.max_length
.map(|ml| NewlineDelimitedDecoder::new_with_max_length(ml))
.unwrap_or(NewlineDelimitedDecoder::new()),
);
let deserializer = Deserializer::Bytes(BytesDeserializer::new());
let deserializer = Box::new(BytesDeserializer::new());
let decoder = codecs::Decoder::new(framer, deserializer);

(Box::new(decoder), param.input.clone())
Expand Down
30 changes: 29 additions & 1 deletion benches/transform/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,35 @@ use std::{
};

use futures::{task::noop_waker, Stream};
use vector::event::Event;
use vector::{conditions::Condition, event::Event};

// == Conditions ==

// ==== AlwaysPass ====

#[derive(Debug, Clone)]
/// A struct that will always pass its check `Event`s.
pub struct AlwaysPass;

impl Condition for AlwaysPass {
#[inline]
fn check(&self, _event: &Event) -> bool {
true
}
}

// ==== AlwaysFail ====

#[derive(Debug, Clone)]
/// A struct that will always fail its check `Event`s.
pub struct AlwaysFail;

impl Condition for AlwaysFail {
#[inline]
fn check(&self, _event: &Event) -> bool {
false
}
}

// == Streams ==

Expand Down
2 changes: 1 addition & 1 deletion benches/transform/dedupe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn dedupe(c: &mut Criterion) {
(Box::new(dedupe), Box::pin(param.input.clone()))
},
|(dedupe, input)| {
let output = dedupe.transform_events(input);
let output = dedupe.transform(input);
consume(output)
},
BatchSize::SmallInput,
Expand Down
18 changes: 10 additions & 8 deletions benches/transform/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ use criterion::{
};
use vector::{
conditions::Condition,
transforms::{filter::Filter, FunctionTransform, OutputBuffer},
transforms::{filter::Filter, FunctionTransform},
};
use vector_core::event::{Event, LogEvent};

use crate::common::{AlwaysFail, AlwaysPass};

#[derive(Debug)]
struct Payload {
filter: Filter,
output: OutputBuffer,
output: Vec<Event>,
events: Vec<Event>,
}

fn setup(total_events: usize, condition: Condition) -> Payload {
fn setup(total_events: usize, condition: Box<dyn Condition>) -> Payload {
let filter = Filter::new(condition);
let output = OutputBuffer::from(Vec::with_capacity(total_events));
let output = Vec::with_capacity(total_events);
let events = vec![Event::Log(LogEvent::default()); total_events];
Payload {
filter,
Expand All @@ -43,8 +45,8 @@ fn measurement(payload: Payload) {
///
/// This benchmark examines the `transform` of `Filter`, demonstrating that its
/// performance is bounded entirely by that of the `Condition`. The two cases
/// below, `always_pass` and `always_fail` use `Condition::AlwaysPass` and
/// `Condition::AlwaysFail` as the interior condition of the filter.
/// below, `always_pass` and `always_fail` use `common::AlwaysPass` and
/// `common::AlwaysFail` as the interior condition of the filter.
///
fn filter(c: &mut Criterion) {
let mut group: BenchmarkGroup<WallTime> =
Expand All @@ -55,14 +57,14 @@ fn filter(c: &mut Criterion) {
group.throughput(Throughput::Elements(total_events as u64));
group.bench_function("transform/always_fail", |b| {
b.iter_batched(
|| setup(total_events, Condition::AlwaysFail),
|| setup(total_events, Box::new(AlwaysFail)),
measurement,
BatchSize::SmallInput,
)
});
group.bench_function("transform/always_pass", |b| {
b.iter_batched(
|| setup(total_events, Condition::AlwaysPass),
|| setup(total_events, Box::new(AlwaysPass)),
measurement,
BatchSize::SmallInput,
)
Expand Down
2 changes: 1 addition & 1 deletion benches/transform/reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn reduce(c: &mut Criterion) {
(Box::new(reduce), Box::pin(param.input.clone()))
},
|(reduce, input)| async {
let output = reduce.transform_events(input);
let output = reduce.transform(input);
consume(output)
},
BatchSize::SmallInput,
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog/search-syntax/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ pest_derive = "2.1.0"
ordered-float = "2"
regex = "1"
itertools = "0.10.3"
once_cell = { version = "1.9", default-features = false, features = ["std"] }
once_cell = { version = "1.9", default-features = false }
4 changes: 2 additions & 2 deletions lib/tracing-limit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ license = "MPL-2.0"
[dependencies]
ansi_term = { version = "0.12", default-features = false }
tracing-core = { version = "0.1", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false, features = ["registry", "std"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["std"] }
dashmap = { version = "5", default-features = false }

[dev-dependencies]
criterion = "0.3"
tracing = "0.1.30"
mock_instant = { version = "0.2" }
tracing-subscriber = { version = "0.3.8", default-features = false, features = ["env-filter", "fmt"] }
tracing-subscriber = { version = "0.3.8", default-features = false, features = ["env-filter"] }

[[bench]]
name = "limit"
Expand Down
7 changes: 5 additions & 2 deletions lib/tracing-limit/examples/basic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use tracing::{info, trace, Dispatch};
#[macro_use]
extern crate tracing;

use tracing::Dispatch;
use tracing_limit::RateLimitedLayer;
use tracing_subscriber::layer::SubscriberExt;

Expand All @@ -12,7 +15,7 @@ fn main() {
let dispatch = Dispatch::new(subscriber);

tracing::dispatcher::with_default(&dispatch, || {
for i in 0..40usize {
for i in 0..40 {
trace!("This field is not rate limited!");
info!(
message = "This message is rate limited",
Expand Down
7 changes: 5 additions & 2 deletions lib/tracing-limit/examples/by_span.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use tracing::{info, info_span, trace, Dispatch};
#[macro_use]
extern crate tracing;

use tracing::Dispatch;
use tracing_limit::RateLimitedLayer;
use tracing_subscriber::layer::SubscriberExt;

Expand All @@ -12,7 +15,7 @@ fn main() {
let dispatch = Dispatch::new(subscriber);

tracing::dispatcher::with_default(&dispatch, || {
for i in 0..40usize {
for i in 0..40 {
trace!("This field is not rate limited!");
for key in &["foo", "bar"] {
for line_number in &[1, 2] {
Expand Down
2 changes: 1 addition & 1 deletion lib/vector-buffers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tokio-stream = { version = "0.1", default-features = false, features = ["sync"]
tokio-util = { version = "0.6", default-features = false }
tokio = { version = "1.16.1", default-features = false, features = ["rt", "macros", "rt-multi-thread", "sync", "fs", "io-util", "time"] }
tracing = { version = "0.1.30", default-features = false, features = ["attributes"] }
vector_common = { path = "../vector-common", default-features = false, features = ["byte_size_of"] }
vector_common = { path = "../vector-common", default-features = false }

[dev-dependencies]
clap = "3.1.0"
Expand Down
2 changes: 0 additions & 2 deletions lib/vector-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ aws_cloudwatch_logs_subscription = [

btreemap = []

byte_size_of = ["bytes", "chrono"]

conversion = [
"bytes",
"chrono",
Expand Down
1 change: 0 additions & 1 deletion lib/vector-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub mod aws_cloudwatch_logs_subscription;
#[cfg(feature = "btreemap")]
pub mod btreemap;

#[cfg(feature = "byte_size_of")]
pub mod byte_size_of;

#[cfg(feature = "conversion")]
Expand Down
1 change: 0 additions & 1 deletion lib/vector-core/src/transform/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ impl Default for TransformContext {
Self {
key: Default::default(),
globals: Default::default(),
#[cfg(feature = "vrl")]
enrichment_tables: Default::default(),
schema_ids: HashMap::from([(None, schema::Id::empty())]),
}
Expand Down
6 changes: 0 additions & 6 deletions lib/vector-core/src/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,6 @@ impl EventDataEq<Vec<Event>> for OutputBuffer {
}
}

impl From<Vec<Event>> for OutputBuffer {
fn from(events: Vec<Event>) -> Self {
Self(events)
}
}

struct WrapEventTask<T>(T);

impl<T: TaskTransform<Event> + Send + 'static> TaskTransform<EventArray> for WrapEventTask<T> {
Expand Down
25 changes: 12 additions & 13 deletions lib/vrl/stdlib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ roxmltree = { version = "0.14.1", optional = true }
woothee = { version = "0.13.0", optional = true }
uaparser = { version = "0.5.0", optional = true }
utf8-width = { version = "0.1.5", optional = true }
vector_common = { path = "../../vector-common", default-features = false, features = ["btreemap"] }
vector_common = { path = "../../vector-common", default-features = false, optional = true }

[dev-dependencies]
anyhow = "1"
Expand Down Expand Up @@ -188,13 +188,13 @@ decode_percent = ["percent-encoding"]
del = []
downcase = []
encode_base64 = ["base64"]
encode_json = ["serde_json", "value/json", "chrono", "regex"]
encode_json = ["serde_json", "value/json"]
encode_key_value = ["vector_common/encoding", "value/json"]
encode_logfmt = ["encode_key_value"]
encode_percent = ["percent-encoding"]
ends_with = []
exists = []
find = ["regex"]
find = []
find_table_row = []
flatten = []
float = []
Expand All @@ -220,9 +220,9 @@ is_integer = []
is_null = []
is_nullish = []
is_object = []
is_regex = ["regex"]
is_regex = []
is_string = []
is_timestamp = ["chrono"]
is_timestamp = []
join = []
length = []
log = ["tracing"]
Expand All @@ -236,7 +236,7 @@ now = ["chrono"]
object = []
parse_apache_log = ["chrono", "once_cell", "regex", "vector_common/conversion"]
parse_aws_alb_log = ["nom"]
parse_aws_cloudwatch_log_subscription_message = ["serde_json", "vector_common/aws_cloudwatch_logs_subscription", "vector_common/btreemap", "chrono"]
parse_aws_cloudwatch_log_subscription_message = ["serde_json", "vector_common/aws_cloudwatch_logs_subscription", "vector_common/btreemap"]
parse_aws_vpc_flow_log = []
parse_common_log = ["chrono", "once_cell", "regex", "vector_common/conversion"]
parse_csv = ["csv"]
Expand All @@ -256,34 +256,34 @@ parse_regex = ["regex"]
parse_regex_all = ["regex"]
parse_ruby_hash = ["nom"]
parse_syslog = ["syslog_loose", "chrono", "vector_common/conversion"]
parse_timestamp = ["vector_common/conversion", "chrono"]
parse_timestamp = ["vector_common/conversion"]
parse_tokens = ["vector_common/tokenize"]
parse_url = ["url"]
parse_user_agent = ["woothee","uaparser","once_cell"]
parse_xml = ["roxmltree", "once_cell", "regex"]
push = []
redact = ["once_cell", "regex"]
remove = ["vector_common/btreemap"]
replace = ["regex"]
replace = []
reverse_dns = ["dns-lookup"]
round = []
set = ["vector_common/btreemap"]
sha1 = ["sha-1", "hex"]
sha2 = ["sha-2", "hex"]
sha3 = ["sha-3", "hex"]
slice = []
split = ["regex"]
split = []
starts_with = ["utf8-width"]
string = []
strip_ansi_escape_codes = ["bytes", "strip-ansi-escapes"]
strip_whitespace = []
tag_types_externally = ["vector_common/btreemap", "chrono", "regex"]
tag_types_externally = ["vector_common/btreemap"]
tally = []
tally_value = []
timestamp = []
to_bool = ["vector_common/conversion"]
to_float = ["vector_common/conversion", "chrono"]
to_int = ["vector_common/conversion", "chrono"]
to_float = ["vector_common/conversion"]
to_int = ["vector_common/conversion"]
to_regex = ["tracing", "regex"]
to_string = ["chrono"]
to_syslog_facility = []
Expand All @@ -304,4 +304,3 @@ bench = false
name = "benches"
harness = false
test = true
required-features = ["default"]
2 changes: 0 additions & 2 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ mod handler;
mod schema;
mod server;
pub mod tap;
#[cfg(all(test, feature = "vector-api-tests"))]
mod tests;

pub use schema::build_schema;
pub use server::Server;
Expand Down
Loading

0 comments on commit 7d07201

Please sign in to comment.