Skip to content

Commit

Permalink
feat: add sync_id to recon conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 committed Apr 12, 2024
1 parent 8727cb8 commit 281aca4
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 49 deletions.
12 changes: 11 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions recon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ serde.workspace = true
serde_json.workspace = true
tokio.workspace = true
tracing.workspace = true
uuid = { version = "1.8.0", features = ["v4"] }
void.workspace = true

[dev-dependencies]
Expand Down
16 changes: 8 additions & 8 deletions recon/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use prometheus_client::{
};

use crate::{
protocol::{InitiatorMessage, ResponderMessage},
protocol::{InitiatorMessage, ReconMessage, ResponderMessage},
AssociativeHash, Key,
};

Expand All @@ -36,12 +36,12 @@ pub struct Metrics {

#[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelSet)]
pub(crate) struct MessageLabels {
message_type: &'static str,
pub(crate) message_type: &'static str,
}

impl<K: Key, H: AssociativeHash> From<&InitiatorMessage<K, H>> for MessageLabels {
fn from(value: &InitiatorMessage<K, H>) -> Self {
match value {
impl<K: Key, H: AssociativeHash> From<&ReconMessage<InitiatorMessage<K, H>>> for MessageLabels {
fn from(value: &ReconMessage<InitiatorMessage<K, H>>) -> Self {
match value.body {
InitiatorMessage::ValueRequest(_) => Self {
message_type: "ValueRequest",
},
Expand All @@ -64,9 +64,9 @@ impl<K: Key, H: AssociativeHash> From<&InitiatorMessage<K, H>> for MessageLabels
}
}

impl<K: Key, H: AssociativeHash> From<&ResponderMessage<K, H>> for MessageLabels {
fn from(value: &ResponderMessage<K, H>) -> Self {
match value {
impl<K: Key, H: AssociativeHash> From<&ReconMessage<ResponderMessage<K, H>>> for MessageLabels {
fn from(value: &ReconMessage<ResponderMessage<K, H>>) -> Self {
match value.body {
ResponderMessage::ValueRequest(_) => Self {
message_type: "ValueRequest",
},
Expand Down
Loading

0 comments on commit 281aca4

Please sign in to comment.