Skip to content

Commit

Permalink
Use auxon-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jonlamb-gh committed Apr 5, 2024
1 parent 12fc4cd commit b01216d
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 153 deletions.
279 changes: 158 additions & 121 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "modality-trace-recorder-plugin"
version = "0.11.0"
version = "0.12.0"
edition = "2021"
authors = ["Jon Lamb <jon@auxon.io>"]
description = "A Modality reflector plugin suite and ingest adapter library for Percepio's TraceRecorder data"
Expand Down Expand Up @@ -50,10 +50,7 @@ goblin = "0.8"
clap = { version = "4.5", features = ["derive", "env", "color"] }
ctrlc = { version = "3.4", features=["termination"] }
exitcode = "1"
modality-api = "0.2"
modality-ingest-client = "0.3"
modality-ingest-protocol = "0.2"
modality-reflector-config = "0.3"
auxon-sdk = { version = "1.3", features = ["modality"] }
trace-recorder-parser = "0.5"

[dev-dependencies]
Expand Down
6 changes: 4 additions & 2 deletions src/attr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use auxon_sdk::{
ingest_client::{BoundTimelineState, IngestClient, IngestError},
ingest_protocol::InternedAttrKey,
};
use derive_more::Display;
use modality_ingest_client::{BoundTimelineState, IngestClient, IngestError};
use modality_ingest_protocol::InternedAttrKey;
use std::{collections::HashMap, fmt, hash::Hash};

pub trait AttrKeyIndex: Hash + Eq + Clone + fmt::Display {}
Expand Down
6 changes: 4 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::attr::{AttrKeyIndex, AttrKeys};
use modality_ingest_client::{BoundTimelineState, IngestClient, IngestError};
use modality_ingest_protocol::InternedAttrKey;
use auxon_sdk::{
ingest_client::{BoundTimelineState, IngestClient, IngestError},
ingest_protocol::InternedAttrKey,
};

pub struct Client<TAK: AttrKeyIndex, EAK: AttrKeyIndex> {
timeline_keys: AttrKeys<TAK>,
Expand Down
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::import::ImportProtocol;
use crate::opts::{
FormatArgAttributeKeysSet, IgnoredObjectClasses, ReflectorOpts, RenameMap, TraceRecorderOpts,
};
use auxon_sdk::reflector_config::{Config, TomlValue, TopLevelIngest, CONFIG_ENV_VAR};
use derive_more::{Deref, From, Into};
use modality_reflector_config::{Config, TomlValue, TopLevelIngest, CONFIG_ENV_VAR};
use serde::Deserialize;
use std::env;
use std::net::SocketAddr;
Expand Down Expand Up @@ -202,12 +202,12 @@ impl TraceRecorderConfig {
ignore_env: bool,
) -> Result<Self, Box<dyn std::error::Error>> {
let cfg = if let Some(cfg_path) = &rf_opts.config_file {
modality_reflector_config::try_from_file(cfg_path)?
auxon_sdk::reflector_config::try_from_file(cfg_path)?
} else if let Ok(env_path) = env::var(CONFIG_ENV_VAR) {
if ignore_env {
Config::default()
} else {
modality_reflector_config::try_from_file(Path::new(&env_path))?
auxon_sdk::reflector_config::try_from_file(Path::new(&env_path))?
}
} else {
Config::default()
Expand Down Expand Up @@ -485,7 +485,7 @@ impl PluginConfig {
mod test {
use super::*;
use crate::opts::{FormatArgAttributeKeysItem, RenameMapItem};
use modality_reflector_config::{AttrKeyEqValuePair, TimelineAttributes};
use auxon_sdk::reflector_config::{AttrKeyEqValuePair, TimelineAttributes};
use pretty_assertions::assert_eq;
use std::{env, fs::File, io::Write};
use trace_recorder_parser::types::ObjectClass;
Expand Down
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use modality_api::TimelineId;
use auxon_sdk::api::TimelineId;
use std::hash::Hash;
use trace_recorder_parser::{snapshot, streaming, time::Timestamp, types::ObjectHandle};

Expand Down
2 changes: 1 addition & 1 deletion src/deviant_event_parser.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::trace_recorder::Error;
use auxon_sdk::api::AttrVal;
use byteordered::ByteOrdered;
use modality_api::AttrVal;
use std::io::Read;
use trace_recorder_parser::{
streaming::event::{BaseEvent, EventId},
Expand Down
8 changes: 4 additions & 4 deletions src/import/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use crate::{
AttrKeyIndex, Client, ContextHandle, ContextSwitchOutcome, TraceRecorderConfig,
TraceRecorderExt,
};
use modality_api::{AttrVal, TimelineId};
use modality_ingest_client::{
IngestClient, IngestClientInitializationError, IngestError, ReadyState,
use auxon_sdk::{
api::{AttrVal, TimelineId},
ingest_client::{IngestClient, IngestClientInitializationError, IngestError, ReadyState},
ingest_protocol::InternedAttrKey,
};
use modality_ingest_protocol::InternedAttrKey;
use std::{
collections::{HashMap, HashSet},
io::{self, Read, Seek, SeekFrom},
Expand Down
6 changes: 4 additions & 2 deletions src/import/snapshot.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::import::{arg_to_attr_val, Error, SnapshotImporter};
use crate::{CommonEventAttrKey, ContextSwitchOutcome, NanosecondsExt, TraceRecorderConfig};
use modality_api::{AttrVal, BigInt};
use modality_ingest_client::IngestClient;
use auxon_sdk::{
api::{AttrVal, BigInt},
ingest_client::IngestClient,
};
use std::{
collections::HashMap,
io::{Read, Seek},
Expand Down
6 changes: 4 additions & 2 deletions src/import/streaming.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use crate::deviant_event_parser::DeviantEventParser;
use crate::import::{arg_to_attr_val, Error, StreamingImporter};
use crate::{CommonEventAttrKey, ContextSwitchOutcome, NanosecondsExt, TraceRecorderConfig};
use modality_api::{AttrVal, BigInt};
use modality_ingest_client::IngestClient;
use auxon_sdk::{
api::{AttrVal, BigInt},
ingest_client::IngestClient,
};
use std::{collections::HashMap, io::Read};
use trace_recorder_parser::{
time::StreamingInstant,
Expand Down
6 changes: 3 additions & 3 deletions src/snapshot/trace_recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use crate::{
TraceRecorderConfig, TraceRecorderExt,
};
use async_trait::async_trait;
use modality_api::AttrVal;
use modality_ingest_protocol::InternedAttrKey;
use modality_reflector_config::AttrKeyEqValuePair;
use auxon_sdk::{
api::AttrVal, ingest_protocol::InternedAttrKey, reflector_config::AttrKeyEqValuePair,
};
use std::collections::HashMap;
use trace_recorder_parser::snapshot::{
object_properties::{IsrObjectClass, ObjectProperties, TaskObjectClass},
Expand Down
8 changes: 5 additions & 3 deletions src/streaming/trace_recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ use crate::{
TraceRecorderConfig, TraceRecorderExt,
};
use async_trait::async_trait;
use auxon_sdk::{
api::{AttrVal, BigInt},
ingest_protocol::InternedAttrKey,
reflector_config::AttrKeyEqValuePair,
};
use derive_more::Display;
use modality_api::{AttrVal, BigInt};
use modality_ingest_protocol::InternedAttrKey;
use modality_reflector_config::AttrKeyEqValuePair;
use std::collections::HashMap;
use trace_recorder_parser::streaming::RecorderData;
use trace_recorder_parser::types::{ObjectClass, ObjectHandle, STARTUP_TASK_NAME, UNNAMED_OBJECT};
Expand Down
8 changes: 5 additions & 3 deletions src/trace_recorder.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use crate::{AttrKeyIndex, Client, ContextHandle, TraceRecorderConfig};
use async_trait::async_trait;
use modality_api::{AttrVal, Nanoseconds};
use modality_ingest_client::IngestError;
use modality_ingest_protocol::InternedAttrKey;
use auxon_sdk::{
api::{AttrVal, Nanoseconds},
ingest_client::IngestError,
ingest_protocol::InternedAttrKey,
};
use std::collections::HashMap;
use thiserror::Error;
use trace_recorder_parser::{
Expand Down

0 comments on commit b01216d

Please sign in to comment.