Skip to content

Commit

Permalink
s/tracer/store/g
Browse files Browse the repository at this point in the history
  • Loading branch information
drmorr0 committed Sep 28, 2023
1 parent ff1f37c commit aaf2350
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 517 deletions.
2 changes: 1 addition & 1 deletion ctrl/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use kube::ResourceExt;
use reqwest::Url;
use simkube::k8s::add_common_fields;
use simkube::prelude::*;
use simkube::trace::storage;
use simkube::store::storage;
use tokio::time::Duration;
use tracing::*;

Expand Down
10 changes: 5 additions & 5 deletions driver/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use simkube::k8s::{
GVK,
};
use simkube::prelude::*;
use simkube::trace::Tracer;
use simkube::store::TraceStore;
use tokio::time::sleep;
use tracing::*;

Expand Down Expand Up @@ -91,7 +91,7 @@ async fn run(args: &Options) -> EmptyResult {
info!("Simulation driver starting");

let trace_data = fs::read(&args.trace_path)?;
let tracer = Tracer::import(trace_data)?;
let trace_store = TraceStore::import(trace_data)?;

let client = kube::Client::try_default().await?;
let mut apiset = ApiSet::new(&client);
Expand All @@ -100,12 +100,12 @@ async fn run(args: &Options) -> EmptyResult {

let root = roots_api.get(&args.sim_root).await?;

let mut sim_ts = tracer.start_ts().ok_or(anyhow!("no trace data"))?;
for (evt, next_ts) in tracer.iter() {
let mut sim_ts = trace_store.start_ts().ok_or(anyhow!("no trace data"))?;
for (evt, next_ts) in trace_store.iter() {
for obj in evt.applied_objs {
let gvk = GVK::from_dynamic_obj(&obj)?;
let vns_name = prefixed_ns(&args.sim_namespace_prefix, &obj);
let vobj = build_virtual_obj(&obj, &vns_name, &args.sim_name, &root, tracer.config())?;
let vobj = build_virtual_obj(&obj, &vns_name, &args.sim_name, &root, trace_store.config())?;

let vns = build_virtual_ns(&args.sim_name, &vns_name, &root)?;
ns_api.create(&Default::default(), &vns).await?;
Expand Down
2 changes: 1 addition & 1 deletion lib/rust/k8s/gvk.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::fmt;
use std::ops::Deref;

use k8s_openapi::apimachinery::pkg::apis::meta::v1 as metav1;
use kube::api::{
DynamicObject,
GroupVersionKind,
Expand All @@ -14,6 +13,7 @@ use serde::{
Serializer,
};

use super::*;
use crate::errors::*;

#[derive(Clone, Debug, Hash, Eq, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion lib/rust/k8s/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ trait StartEndTimeable {
}

#[cfg(test)]
mod test;
mod tests;
19 changes: 0 additions & 19 deletions lib/rust/k8s/test/mod.rs

This file was deleted.

99 changes: 0 additions & 99 deletions lib/rust/k8s/test/pod_lifecycle_test.rs

This file was deleted.

169 changes: 0 additions & 169 deletions lib/rust/k8s/test/util_test.rs

This file was deleted.

2 changes: 1 addition & 1 deletion lib/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pub mod jsonutils;
pub mod k8s;
pub mod logging;
mod macros;
pub mod store;
pub mod time;
pub mod trace;
pub mod util;
pub mod watch;

Expand Down
8 changes: 4 additions & 4 deletions lib/rust/trace/mod.rs → lib/rust/store/mod.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
pub mod storage;
mod trace_filter;
mod tracer;
mod trace_store;

use std::collections::HashMap;

pub use self::trace_filter::TraceFilter;
pub use self::tracer::{
pub use self::trace_store::{
TraceEvent,
Tracer,
TraceStore,
};

type OwnedPodMap = HashMap<String, HashMap<u64, Vec<(i64, i64)>>>;

#[cfg(test)]
mod test;
mod tests;
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/rust/trace/test/mod.rs → lib/rust/store/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod tracer;
mod trace_store;

use rstest::*;

Expand Down
Loading

0 comments on commit aaf2350

Please sign in to comment.