Skip to content

Commit

Permalink
Merge pull request #42 from holaplex/dev
Browse files Browse the repository at this point in the history
Release v0.8.1
  • Loading branch information
ray-kast authored Dec 19, 2022
2 parents 3e71006 + f224c3d commit aedb4f1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
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

0 comments on commit aedb4f1

Please sign in to comment.