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 Packing Difficulty in v2_index_data_size_by_packing #649

Merged
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
5 changes: 3 additions & 2 deletions apps/arweave/src/ar_metrics.erl
Original file line number Diff line number Diff line change
@@ -158,10 +158,11 @@ register() ->
]),
prometheus_gauge:new([
{name, v2_index_data_size_by_packing},
{labels, [store_id, packing, partition_number, storage_module_size, storage_module_index]},
{labels, [store_id, packing, partition_number, storage_module_size, storage_module_index,
packing_difficulty]},
{help, "The size (in bytes) of the data stored and indexed. Grouped by the "
"store ID, packing, partition number, storage module size, "
"and storage module index."}
"storage module index, and packing difficulty."}
]),

%% Disk pool.
5 changes: 4 additions & 1 deletion apps/arweave/src/ar_mining_stats.erl
Original file line number Diff line number Diff line change
@@ -162,8 +162,11 @@ set_storage_module_data_size(
StoreLabel = ar_storage_module:label_by_id(StoreID),
PackingLabel = ar_storage_module:packing_label(Packing),
try
PackingDifficulty = get_packing_difficulty(Packing),
prometheus_gauge:set(v2_index_data_size_by_packing,
[StoreLabel, PackingLabel, PartitionNumber, StorageModuleSize, StorageModuleIndex],
[StoreLabel, PackingLabel, PartitionNumber,
StorageModuleSize, StorageModuleIndex,
PackingDifficulty],
DataSize),
ets:insert(?MODULE, {
{partition, PartitionNumber, storage_module, StoreID, packing, Packing}, DataSize})