Disable weekly_active_addresses_number metric because it affects DB performance: query should be optimized in the future

pull/10289/head
Viktor Baranov 5 months ago
parent da082cc5c7
commit d534902539
  1. 6
      apps/explorer/lib/explorer/chain/metrics.ex
  2. 20
      apps/explorer/lib/explorer/prometheus/instrumenter.ex

@ -18,8 +18,10 @@ defmodule Explorer.Chain.Metrics do
:weekly_verified_smart_contracts_number,
:weekly_new_addresses_number,
:weekly_new_tokens_number,
:weekly_new_token_transfers_number,
:weekly_active_addresses_number
:weekly_new_token_transfers_number
# todo; this metric causes increasing of AccessShareLocks
# which increases DB loading. Disabling this metric for now.
# :weekly_active_addresses_number
]
@spec start_link(term()) :: GenServer.on_start()

@ -49,11 +49,13 @@ defmodule Explorer.Prometheus.Instrumenter do
registry: :public
]
@gauge [
name: :weekly_active_addresses_number,
help: "Number of active EOA addresses (participated in transactions in to/from) in the last 7 days",
registry: :public
]
# todo; this metric causes increasing of AccessShareLocks
# which increases DB loading. Disabling this metric for now.
# @gauge [
# name: :weekly_active_addresses_number,
# help: "Number of active EOA addresses (participated in transactions in to/from) in the last 7 days",
# registry: :public
# ]
def block_import_stage_runner(function, stage, runner, step) do
{time, result} = :timer.tc(function)
@ -87,7 +89,9 @@ defmodule Explorer.Prometheus.Instrumenter do
Gauge.set([name: :weekly_new_token_transfers_number, registry: :public], number)
end
def weekly_active_addresses_number(number) do
Gauge.set([name: :weekly_active_addresses_number, registry: :public], number)
end
# todo; this metric causes increasing of AccessShareLocks
# which increases DB loading. Disabling this metric for now.
# def weekly_active_addresses_number(number) do
# Gauge.set([name: :weekly_active_addresses_number, registry: :public], number)
# end
end

Loading…
Cancel
Save