-
Notifications
You must be signed in to change notification settings - Fork 2k
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
UI: Showing Block Size Stats #7233
UI: Showing Block Size Stats #7233
Conversation
{sizeStats && ( | ||
<> | ||
<div data-testid="total-size"> | ||
<b>Total size:</b> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those non breaking spaces are mostly because Prettier (?) trims my trailing spaces at the end of the line :(
A block can have a list of contained files set in `.thanos.files`. If the `files` array is set, all referenced files with `size_bytes` set are counted: - sum of all `chunk/*` file sizes - size of index file - total size (sum of both) Shows statistics about the selected block in the block details view: - Total size of block - Size of index (and percentage of total) - Size of all chunks (and percentage of total) - Daily growth, based on total size and block duration Output is humanized up to Pebibytes and fixed to two decimal places; raw bytes are accessible through mouse over / title text. Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev>
Added total size of all blocks from a source to the row title, beneath the source name. The shown total size is humanized up to pebibytes and fixed to two decimal places; raw bytes value is accessible through mouse over / title text. The shown value will refresh with selected compaction levels, but doesn't take block filter into account. I thought about showing daily growth as well, but just summing all milliseconds of all blocks doesn't work with overlapping blocks / multiple resolutions. Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev>
Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev>
cc14368
to
ce31f00
Compare
</span> | ||
</div> | ||
<div data-testid="daily-bytes"> | ||
<b>Daily:</b> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too happy about Daily as label, but it's shorter than something like Total per day.
Automatic code formatting duplicated some comments near import statements. Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this change. Great work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Thank you 🙇
That was fast, thank you to both of you too! :) |
@outofrange this is awesome stuff, as others said... thank you! If you want another idea for a contribution, here's one: each block stream (indexed from 1 to n) has a set of external labels. Currently we have to click on any block inside a stream to see them and this is annoying when you are looking for an specific stream. It would be super helpful to be able to see the external labels there together with the block stream's index and size (that you just added), so that you could just use your browser "find text" feature to find the block stream you want. 💡 |
I created this ticket for further discussions about this: #7237 |
* feat(ui): added BlockSizeStats calculation to blocks page A block can have a list of contained files set in `.thanos.files`. If the `files` array is set, all referenced files with `size_bytes` set are counted: - sum of all `chunk/*` file sizes - size of index file - total size (sum of both) Shows statistics about the selected block in the block details view: - Total size of block - Size of index (and percentage of total) - Size of all chunks (and percentage of total) - Daily growth, based on total size and block duration Output is humanized up to Pebibytes and fixed to two decimal places; raw bytes are accessible through mouse over / title text. Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev> * feat(ui): added aggregated BlockSizeStats to blocks row title Added total size of all blocks from a source to the row title, beneath the source name. The shown total size is humanized up to pebibytes and fixed to two decimal places; raw bytes value is accessible through mouse over / title text. The shown value will refresh with selected compaction levels, but doesn't take block filter into account. I thought about showing daily growth as well, but just summing all milliseconds of all blocks doesn't work with overlapping blocks / multiple resolutions. Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev> * chore(docs): added UI block size PR to CHANGELOG.md Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev> * chore(ui): removed comments Automatic code formatting duplicated some comments near import statements. Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev> --------- Signed-off-by: Markus Möslinger <markus.moeslinger@socra.dev>
This PR adds details about block sizes to the blocks UI page.
Each source block row shows an aggregated sum of all chunks and indices of all blocks in this row, respecting the currently selected compaction level.
When selecting a block, the details view shows the following:
All sizes are humanized up to Pebibytes, and display the raw bytes value on mouse over via their title text.
As I wasn't sure about all compatibility, block stats are only calculated and taken into account if
.thanos.files
array setsize_bytes
setAt the moment, only chunks and index are counted -
meta.json
might be present as well, but often hasn't a size assigned to it.Other
rel_path
thanindex
andchunks/*
are ignored as well.Fixes #7205
Changes
Verification