Skip to content
Open
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
17 changes: 9 additions & 8 deletions book/api/websocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -1619,14 +1619,15 @@ rooted.
:::

**`SlotRankings`**
| Field | Type | Description |
|-----------------------------------------------|------------|-------------|
| {slots|vals}_{smallest|largest}_tips | `number[]` | Rankings for the {smallest|largest} tips this epoch |
| {slots|vals}_{smallest|largest}_fees | `number[]` | Rankings for the {smallest|largest} fees this epoch |
| {slots|vals}_{smallest|largest}_rewards | `number[]` | Rankings for the {smallest|largest} rewards this epoch |
| {slots|vals}_{smallest|largest}_duration | `number[]` | Rankings for the {smallest|largest} slot durations this epoch |
| {slots|vals}_{smallest|largest}_compute_units | `number[]` | Rankings for the {smallest|largest} compute units this epoch |
| {slots|vals}_{smallest|largest}_skipped | `number[]` | Rankings for the {earliest|latest} skipped slots this epoch |
| Field | Type | Description |
|------------------------------------------------|------------|-------------|
| {slots|vals}_{smallest|largest}_tips | `number[]` | Rankings for the {smallest|largest} tips this epoch |
| {slots|vals}_{smallest|largest}_fees | `number[]` | Rankings for the {smallest|largest} fees this epoch |
| {slots|vals}_{smallest|largest}_rewards | `number[]` | Rankings for the {smallest|largest} rewards this epoch |
| {slots|vals}_{smallest|largest}_rewards_per_cu | `number[]` | Rankings for the {smallest|largest} rewards/cu ratio this epoch |
| {slots|vals}_{smallest|largest}_duration | `number[]` | Rankings for the {smallest|largest} slot durations this epoch |
| {slots|vals}_{smallest|largest}_compute_units | `number[]` | Rankings for the {smallest|largest} compute units this epoch |
| {slots|vals}_{smallest|largest}_skipped | `number[]` | Rankings for the {earliest|latest} skipped slots this epoch |

Each metric in this message will have four associated arrays.

Expand Down
11 changes: 6 additions & 5 deletions src/disco/gui/fd_gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,11 +1094,12 @@ fd_gui_try_insert_ranking( fd_gui_t * gui,
}

ulong dur = fd_gui_slot_duration( gui, slot );
if( FD_LIKELY( dur!=ULONG_MAX ) ) TRY_INSERT_SLOT( duration, slot->slot, dur );
TRY_INSERT_SLOT( tips, slot->slot, slot->tips );
TRY_INSERT_SLOT( fees, slot->slot, slot->priority_fee );
TRY_INSERT_SLOT( rewards, slot->slot, slot->tips + slot->priority_fee );
TRY_INSERT_SLOT( compute_units, slot->slot, slot->compute_units );
if( FD_LIKELY( dur!=ULONG_MAX ) ) TRY_INSERT_SLOT( duration, slot->slot, dur );
TRY_INSERT_SLOT( tips, slot->slot, slot->tips );
TRY_INSERT_SLOT( fees, slot->slot, slot->priority_fee );
TRY_INSERT_SLOT( rewards, slot->slot, slot->tips + slot->priority_fee );
TRY_INSERT_SLOT( rewards_per_cu, slot->slot, (slot->tips + slot->priority_fee) / slot->compute_units );
TRY_INSERT_SLOT( compute_units, slot->slot, slot->compute_units );
#undef TRY_INSERT_SLOT
}

Expand Down
26 changes: 14 additions & 12 deletions src/disco/gui/fd_gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,18 +311,20 @@ typedef struct fd_gui_slot_ranking fd_gui_slot_ranking_t;
#include "../../util/tmpl/fd_sort.c"

struct fd_gui_slot_rankings {
fd_gui_slot_ranking_t largest_tips [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_fees [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_rewards [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_duration [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_compute_units [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_skipped [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_tips [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_fees [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_rewards [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_duration [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_compute_units[ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_skipped [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_tips [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_fees [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_rewards [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_duration [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_compute_units [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_skipped [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t largest_rewards_per_cu [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_tips [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_fees [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_rewards [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_rewards_per_cu[ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_duration [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_compute_units [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
fd_gui_slot_ranking_t smallest_skipped [ FD_GUI_SLOT_RANKINGS_SZ+1UL ];
};

typedef struct fd_gui_slot_rankings fd_gui_slot_rankings_t;
Expand Down
2 changes: 2 additions & 0 deletions src/disco/gui/fd_gui_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,12 +1185,14 @@ fd_gui_printf_slot_rankings_request( fd_gui_t * gui,
OUTPUT_RANKING_ARRAY( largest_tips );
OUTPUT_RANKING_ARRAY( largest_fees );
OUTPUT_RANKING_ARRAY( largest_rewards );
OUTPUT_RANKING_ARRAY( largest_rewards_per_cu );
OUTPUT_RANKING_ARRAY( largest_duration );
OUTPUT_RANKING_ARRAY( largest_compute_units );
OUTPUT_RANKING_ARRAY( largest_skipped );
OUTPUT_RANKING_ARRAY( smallest_tips );
OUTPUT_RANKING_ARRAY( smallest_fees );
OUTPUT_RANKING_ARRAY( smallest_rewards );
OUTPUT_RANKING_ARRAY( smallest_rewards_per_cu );
OUTPUT_RANKING_ARRAY( smallest_duration );
OUTPUT_RANKING_ARRAY( smallest_compute_units );
OUTPUT_RANKING_ARRAY( smallest_skipped );
Expand Down
Loading