Skip to content

Commit aedb4f1

Browse files
authored
Merge pull request #42 from holaplex/dev
Release v0.8.1
2 parents 3e71006 + f224c3d commit aedb4f1

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/plugin/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "holaplex-indexer-rabbitmq-geyser"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
authors = [
55
"ryans <[email protected]>",
66
]

crates/plugin/src/metrics.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ pub struct Metrics {
4545
pub acct_sends: Counter,
4646
pub acct_recvs: Counter,
4747
pub ins_sends: Counter,
48+
pub txn_sends: Counter,
4849
pub txn_recvs: Counter,
50+
pub txn_errs: Counter,
4951
pub status_sends: Counter,
5052
pub status_recvs: Counter,
5153
pub errs: Counter,
@@ -58,7 +60,9 @@ impl Metrics {
5860
acct_sends: Counter::new("geyser_acct_sends", Level::Info),
5961
acct_recvs: Counter::new("geyser_acct_recvs", Level::Info),
6062
ins_sends: Counter::new("geyser_ins_sends", Level::Info),
63+
txn_sends: Counter::new("geyser_txn_sends", Level::Info),
6164
txn_recvs: Counter::new("geyser_txn_recvs", Level::Info),
65+
txn_errs: Counter::new("geyser_txn_errs", Level::Info),
6266
status_sends: Counter::new("geyser_status_sends", Level::Info),
6367
status_recvs: Counter::new("geyser_status_recvs", Level::Info),
6468
errs: Counter::new("geyser_errs", Level::Error),

crates/plugin/src/plugin.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,19 +346,21 @@ impl GeyserPlugin for GeyserPluginRabbitMq {
346346
return Ok(());
347347
}
348348

349-
this.metrics.txn_recvs.log(1);
350-
351349
match transaction {
352350
ReplicaTransactionInfoVersions::V0_0_1(tx) => {
353351
if matches!(tx.transaction_status_meta.status, Err(..)) {
352+
this.metrics.txn_errs.log(1);
354353
return Ok(());
355354
}
356355

356+
this.metrics.txn_recvs.log(1);
357+
357358
let msg = tx.transaction.message();
358359
let keys = msg.account_keys();
359360

360361
let txn_signature = tx.signature.as_ref();
361362

363+
let mut any_sent = false;
362364
for ins in msg
363365
.instructions()
364366
.iter()
@@ -384,6 +386,7 @@ impl GeyserPlugin for GeyserPluginRabbitMq {
384386
txn_signature,
385387
) {
386388
Ok(Some(m)) => {
389+
any_sent = true;
387390
this.spawn(|this| async move {
388391
this.producer.send(m).await;
389392
this.metrics.ins_sends.log(1);
@@ -398,6 +401,10 @@ impl GeyserPlugin for GeyserPluginRabbitMq {
398401
},
399402
}
400403
}
404+
405+
if any_sent {
406+
this.metrics.txn_sends.log(1);
407+
}
401408
},
402409
}
403410

0 commit comments

Comments
 (0)