Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "holaplex-indexer-rabbitmq-geyser"
version = "0.8.0"
version = "0.8.1"
authors = [
"ryans <[email protected]>",
]
Expand Down
4 changes: 4 additions & 0 deletions crates/plugin/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ pub struct Metrics {
pub acct_sends: Counter,
pub acct_recvs: Counter,
pub ins_sends: Counter,
pub txn_sends: Counter,
pub txn_recvs: Counter,
pub txn_errs: Counter,
pub status_sends: Counter,
pub status_recvs: Counter,
pub errs: Counter,
Expand All @@ -58,7 +60,9 @@ impl Metrics {
acct_sends: Counter::new("geyser_acct_sends", Level::Info),
acct_recvs: Counter::new("geyser_acct_recvs", Level::Info),
ins_sends: Counter::new("geyser_ins_sends", Level::Info),
txn_sends: Counter::new("geyser_txn_sends", Level::Info),
txn_recvs: Counter::new("geyser_txn_recvs", Level::Info),
txn_errs: Counter::new("geyser_txn_errs", Level::Info),
status_sends: Counter::new("geyser_status_sends", Level::Info),
status_recvs: Counter::new("geyser_status_recvs", Level::Info),
errs: Counter::new("geyser_errs", Level::Error),
Expand Down
11 changes: 9 additions & 2 deletions crates/plugin/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,19 +346,21 @@ impl GeyserPlugin for GeyserPluginRabbitMq {
return Ok(());
}

this.metrics.txn_recvs.log(1);

match transaction {
ReplicaTransactionInfoVersions::V0_0_1(tx) => {
if matches!(tx.transaction_status_meta.status, Err(..)) {
this.metrics.txn_errs.log(1);
return Ok(());
}

this.metrics.txn_recvs.log(1);

let msg = tx.transaction.message();
let keys = msg.account_keys();

let txn_signature = tx.signature.as_ref();

let mut any_sent = false;
for ins in msg
.instructions()
.iter()
Expand All @@ -384,6 +386,7 @@ impl GeyserPlugin for GeyserPluginRabbitMq {
txn_signature,
) {
Ok(Some(m)) => {
any_sent = true;
this.spawn(|this| async move {
this.producer.send(m).await;
this.metrics.ins_sends.log(1);
Expand All @@ -398,6 +401,10 @@ impl GeyserPlugin for GeyserPluginRabbitMq {
},
}
}

if any_sent {
this.metrics.txn_sends.log(1);
}
},
}

Expand Down