Skip to content

Commit

Permalink
Stop asset_price_pairs cryptocompare exporter
Browse files Browse the repository at this point in the history
It exports all prices and volumes into a kafka topic that has never been
used, but is very large. We still have asset_price_pairs_only which
exports only the prices, which are in active use.
  • Loading branch information
IvanIvanoff committed Feb 4, 2025
1 parent 4d556ce commit 58f8de5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
11 changes: 0 additions & 11 deletions lib/sanbase/cryptocompare/price/price_websocket_scraper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ defmodule Sanbase.Cryptocompare.Price.WebsocketScraper do
# giving it a name makes sure only one instance of the scraper is alive at a time
@name :cryptocompare_websocket_scraper

@asset_price_pairs_exporter :asset_price_pairs_exporter
@asset_price_pairs_only_exporter :asset_price_pairs_only_exporter
@asset_prices_exporter :prices_exporter

Expand Down Expand Up @@ -237,7 +236,6 @@ defmodule Sanbase.Cryptocompare.Price.WebsocketScraper do

defp export_data_point(point, last_points) do
export_asset_prices_topic(point, last_points)
export_asset_price_pairs_topic(point)
export_asset_price_pairs_only_topic(point)
rescue
e ->
Expand Down Expand Up @@ -279,15 +277,6 @@ defmodule Sanbase.Cryptocompare.Price.WebsocketScraper do

defp export_asset_prices_topic(_point, _last_points), do: :ok

defp export_asset_price_pairs_topic(point) do
tuple =
point
|> CryptocompareAssetPricesPoint.new()
|> CryptocompareAssetPricesPoint.json_kv_tuple()

:ok = Sanbase.KafkaExporter.persist_async(tuple, @asset_price_pairs_exporter)
end

defp export_asset_price_pairs_only_topic(point) do
tuple =
point
Expand Down
14 changes: 0 additions & 14 deletions lib/sanbase/cryptocompare/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,6 @@ defmodule Sanbase.Cryptocompare.Supervisor do
Price.WebsocketScraper.enabled?() or Price.HistoricalScheduler.enabled?()
end
),
# Kafka exporter for the websocket price exporter
start_if(
fn ->
Sanbase.KafkaExporter.child_spec(
id: :asset_price_pairs_exporter,
name: :asset_price_pairs_exporter,
topic: Config.module_get!(Sanbase.KafkaExporter, :asset_price_pairs_topic),
buffering_max_messages: 1000,
can_send_after_interval: 250,
kafka_flush_timeout: 1000
)
end,
fn -> Price.WebsocketScraper.enabled?() end
),
# Kafka exporter for the open interest scraper
start_if(
fn ->
Expand Down

0 comments on commit 58f8de5

Please sign in to comment.