Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Monitoring and User Transaction Processors #597

Merged
merged 4 commits into from
Nov 8, 2024
Merged

Conversation

dermanyang
Copy link
Contributor

@dermanyang dermanyang commented Nov 7, 2024

Purpose

Add User Transaction Processor
image

Add Monitoring Processor
Its just the transaction stream since the processor just no-ops
image

@dermanyang dermanyang changed the title Add monitoring and user_txn processors Add Monitoring and User Transaction Processors Nov 7, 2024
@dermanyang dermanyang marked this pull request as ready for review November 7, 2024 22:22
@dermanyang dermanyang requested review from rtso and yuunlimm November 7, 2024 22:28
Comment on lines 41 to 70
let mut signatures = vec![];
let mut user_transactions = vec![];
for txn in item.data {
let txn_version = txn.version as i64;
let block_height = txn.block_height as i64;
let txn_data = match txn.txn_data.as_ref() {
Some(txn_data) => txn_data,
None => {
PROCESSOR_UNKNOWN_TYPE_COUNT
.with_label_values(&["UserTransactionProcessor"])
.inc();
tracing::warn!(
transaction_version = txn_version,
"Transaction data doesn't exist"
);
continue;
},
};
if let TxnData::User(inner) = txn_data {
let (user_transaction, sigs) = UserTransactionModel::from_transaction(
inner,
txn.timestamp.as_ref().unwrap(),
block_height,
txn.epoch as i64,
txn_version,
);
signatures.extend(sigs);
user_transactions.push(user_transaction);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we haven't been doing this for the other processors, but could we move this into a shared function to improve maintainability? someone could come in and edit the parsing logic for non-SDK processor and forget to also update the SDK processor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good shout. added

@dermanyang dermanyang merged commit 75afe5c into main Nov 8, 2024
7 checks passed
@dermanyang dermanyang deleted the sdy/new_processors branch November 8, 2024 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants