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

remove heavy metrics #379

Merged
merged 1 commit into from
Nov 26, 2024
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
6 changes: 0 additions & 6 deletions database/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,4 @@ lazy_static! {
&["method_name", "table_name"]
)
.unwrap();
pub(crate) static ref ACCOUNTS_DATABASE_READ_QUERIES: IntCounterVec = register_int_counter_vec(
"account_database_read_queries_counter",
"Total number of accounts database reads queries by method_name and table_name",
&["account_id", "shard_id", "method_name", "table_name"]
)
.unwrap();
}
64 changes: 0 additions & 64 deletions database/src/postgres/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
"state_changes_data",
])
.inc();
crate::metrics::ACCOUNTS_DATABASE_READ_QUERIES
.with_label_values(&[
account_id.as_ref(),
&shard_id_pool.shard_id.to_string(),
method_name,
"state_changes_data",
])
.inc();
let page_state = if let Some(page_state_token) = page_token {
borsh::from_slice::<crate::postgres::PageState>(&hex::decode(page_state_token)?)?
} else {
Expand Down Expand Up @@ -158,14 +150,6 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
"state_changes_data",
])
.inc();
crate::metrics::ACCOUNTS_DATABASE_READ_QUERIES
.with_label_values(&[
account_id.as_ref(),
&shard_id_pool.shard_id.to_string(),
method_name,
"state_changes_data",
])
.inc();
let mut items = std::collections::HashMap::new();
let mut stream = sqlx::query_as::<_, (String, Vec<u8>)>(
"
Expand Down Expand Up @@ -223,14 +207,6 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
"state_changes_data",
])
.inc();
crate::metrics::ACCOUNTS_DATABASE_READ_QUERIES
.with_label_values(&[
account_id.as_ref(),
&shard_id_pool.shard_id.to_string(),
method_name,
"state_changes_data",
])
.inc();
let mut items = std::collections::HashMap::new();
let mut stream = sqlx::query_as::<_, (String, Vec<u8>)>(
"
Expand Down Expand Up @@ -288,14 +264,6 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
"state_changes_data",
])
.inc();
crate::metrics::ACCOUNTS_DATABASE_READ_QUERIES
.with_label_values(&[
account_id.as_ref(),
&shard_id_pool.shard_id.to_string(),
method_name,
"state_changes_data",
])
.inc();
let (data_value,): (Vec<u8>,) = sqlx::query_as(
"
SELECT data_value
Expand Down Expand Up @@ -329,14 +297,6 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
"state_changes_account",
])
.inc();
crate::metrics::ACCOUNTS_DATABASE_READ_QUERIES
.with_label_values(&[
account_id.as_ref(),
&shard_id_pool.shard_id.to_string(),
method_name,
"state_changes_account",
])
.inc();
let (block_height, block_hash, data_value): (bigdecimal::BigDecimal, String, Vec<u8>) =
sqlx::query_as(
"
Expand Down Expand Up @@ -374,14 +334,6 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
"state_changes_contract",
])
.inc();
crate::metrics::ACCOUNTS_DATABASE_READ_QUERIES
.with_label_values(&[
account_id.as_ref(),
&shard_id_pool.shard_id.to_string(),
method_name,
"state_changes_contract",
])
.inc();
let (block_height, block_hash, contract_code): (bigdecimal::BigDecimal, String, Vec<u8>) =
sqlx::query_as(
"
Expand Down Expand Up @@ -420,14 +372,6 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
"state_changes_access_key",
])
.inc();
crate::metrics::ACCOUNTS_DATABASE_READ_QUERIES
.with_label_values(&[
account_id.as_ref(),
&shard_id_pool.shard_id.to_string(),
method_name,
"state_changes_access_key",
])
.inc();
let key_data = borsh::to_vec(&public_key)?;
let (block_height, block_hash, data_value): (bigdecimal::BigDecimal, String, Vec<u8>) =
sqlx::query_as(
Expand Down Expand Up @@ -468,14 +412,6 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
"state_changes_access_key",
])
.inc();
crate::metrics::ACCOUNTS_DATABASE_READ_QUERIES
.with_label_values(&[
account_id.as_ref(),
&shard_id_pool.shard_id.to_string(),
method_name,
"state_changes_access_key",
])
.inc();
let mut access_keys = vec![];
let mut stream = sqlx::query_as::<_, (String, Vec<u8>, bigdecimal::BigDecimal)>(
"
Expand Down
Loading