Skip to content
4 changes: 2 additions & 2 deletions api/read/arbitrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
HTTPDebugTraceBlockByNumberLatencyMetric,
HTTPDebugTraceTxLatencyMetric,
HTTPEthCallLatencyMetric,
HTTPGetLogsLatencyMetric,
HTTPTxReceiptLatencyMetric,
)
from metrics.ethereum import (
WSBlockLatencyMetric,
# WSLogLatencyMetric,
)

metric_name = f"{MetricsServiceConfig.METRIC_PREFIX}response_latency_seconds"

METRICS = [
(WSBlockLatencyMetric, metric_name),
# (WSLogLatencyMetric, metric_name),
(HTTPBlockNumberLatencyMetric, metric_name),
(HTTPEthCallLatencyMetric, metric_name),
(HTTPAccBalanceLatencyMetric, metric_name),
(HTTPDebugTraceBlockByNumberLatencyMetric, metric_name),
(HTTPDebugTraceTxLatencyMetric, metric_name),
(HTTPTxReceiptLatencyMetric, metric_name),
(HTTPGetLogsLatencyMetric, metric_name),
]


Expand Down
4 changes: 2 additions & 2 deletions api/read/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
HTTPDebugTraceBlockByNumberLatencyMetric,
HTTPDebugTraceTxLatencyMetric,
HTTPEthCallLatencyMetric,
HTTPGetLogsLatencyMetric,
HTTPTxReceiptLatencyMetric,
)
from metrics.ethereum import (
WSBlockLatencyMetric,
# WSLogLatencyMetric,
)

metric_name = f"{MetricsServiceConfig.METRIC_PREFIX}response_latency_seconds"

METRICS = [
(WSBlockLatencyMetric, metric_name),
# (WSLogLatencyMetric, metric_name),
(HTTPBlockNumberLatencyMetric, metric_name),
(HTTPEthCallLatencyMetric, metric_name),
(HTTPAccBalanceLatencyMetric, metric_name),
(HTTPDebugTraceBlockByNumberLatencyMetric, metric_name),
(HTTPDebugTraceTxLatencyMetric, metric_name),
(HTTPTxReceiptLatencyMetric, metric_name),
(HTTPGetLogsLatencyMetric, metric_name),
]


Expand Down
4 changes: 2 additions & 2 deletions api/read/bnbsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
HTTPDebugTraceBlockByNumberLatencyMetric,
HTTPDebugTraceTxLatencyMetric,
HTTPEthCallLatencyMetric,
HTTPGetLogsLatencyMetric,
HTTPTxReceiptLatencyMetric,
)
from metrics.ethereum import (
WSBlockLatencyMetric,
# WSLogLatencyMetric,
)

metric_name = f"{MetricsServiceConfig.METRIC_PREFIX}response_latency_seconds"

METRICS = [
(WSBlockLatencyMetric, metric_name),
# (WSLogLatencyMetric, metric_name),
(HTTPBlockNumberLatencyMetric, metric_name),
(HTTPEthCallLatencyMetric, metric_name),
(HTTPAccBalanceLatencyMetric, metric_name),
(HTTPDebugTraceBlockByNumberLatencyMetric, metric_name),
(HTTPDebugTraceTxLatencyMetric, metric_name),
(HTTPTxReceiptLatencyMetric, metric_name),
(HTTPGetLogsLatencyMetric, metric_name),
]


Expand Down
4 changes: 2 additions & 2 deletions api/read/ethereum.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
HTTPDebugTraceBlockByNumberLatencyMetric,
HTTPDebugTraceTxLatencyMetric,
HTTPEthCallLatencyMetric,
HTTPGetLogsLatencyMetric,
HTTPTxReceiptLatencyMetric,
WSBlockLatencyMetric,
# WSLogLatencyMetric,
)

metric_name = f"{MetricsServiceConfig.METRIC_PREFIX}response_latency_seconds"

METRICS = [
(WSBlockLatencyMetric, metric_name),
# (WSLogLatencyMetric, metric_name),
(HTTPBlockNumberLatencyMetric, metric_name),
(HTTPEthCallLatencyMetric, metric_name),
(HTTPAccBalanceLatencyMetric, metric_name),
(HTTPDebugTraceBlockByNumberLatencyMetric, metric_name),
(HTTPDebugTraceTxLatencyMetric, metric_name),
(HTTPTxReceiptLatencyMetric, metric_name),
(HTTPGetLogsLatencyMetric, metric_name),
]


Expand Down
21 changes: 21 additions & 0 deletions metrics/arbitrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,24 @@ def method(self) -> str:
def get_params_from_state(state_data: dict) -> list:
"""Get empty parameter list for block number query."""
return []


class HTTPGetLogsLatencyMetric(HttpCallLatencyMetricBase):
"""Collects call latency for the eth_getLogs method."""

@property
def method(self) -> str:
return "eth_getLogs"

@staticmethod
def get_params_from_state(state_data: dict) -> list:
"""Get parameters for USDC transfer logs from latest block."""
return [
{
"fromBlock": "latest",
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", # USDC on Arbitrum
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" # Transfer event
],
}
]
21 changes: 21 additions & 0 deletions metrics/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,24 @@ def method(self) -> str:
def get_params_from_state(state_data: dict) -> list:
"""Get empty parameter list for block number query."""
return []


class HTTPGetLogsLatencyMetric(HttpCallLatencyMetricBase):
"""Collects call latency for the eth_getLogs method."""

@property
def method(self) -> str:
return "eth_getLogs"

@staticmethod
def get_params_from_state(state_data: dict) -> list:
"""Get parameters for USDC transfer logs from latest block."""
return [
{
"fromBlock": "latest",
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", # USDC on Base
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" # Transfer event
],
}
]
21 changes: 21 additions & 0 deletions metrics/bnbsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,24 @@ def method(self) -> str:
def get_params_from_state(state_data: dict) -> list:
"""Get empty parameter list for block number query."""
return []


class HTTPGetLogsLatencyMetric(HttpCallLatencyMetricBase):
"""Collects call latency for the eth_getLogs method."""

@property
def method(self) -> str:
return "eth_getLogs"

@staticmethod
def get_params_from_state(state_data: dict) -> list:
"""Get parameters for Wrapped BNB transfer logs from latest block."""
return [
{
"fromBlock": "latest",
"address": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", # Wrapped BNB on BSC
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" # Transfer event
],
}
]
Loading