forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep daily history of hits-by-size histograms (openzfs#912)
`zcache hits` displays the hits-by-size histogram, showing the predicted cache hit rate with varying cache size. The data is based on cache accesses since the last `zcache hits --clear`. The problem is that the relevant time period for evaluating cache effectiveness may not match the time since the histogram was cleared. This commit makes the zettacache store a history of hits-by-size histograms, by default one each day. The `zcache hits` command will now sum up the histograms for the requested time/date range, which by default is the entire history (since the cache size was last changed by `zcache add` or `zcache remove`). The new `--begin`, `--end`, and `--duration` flags can be used to select a more specific time range. The `zcache hits --clear` command will create a new histogram, saving the current one in the history. The internal representation of the history can be dumped with `zcache hits --raw`. This can be fed into `zcache hits --from-raw` to query and display the histogram from a different system. The implementation required a new kind of block-based log to store the large, variable-size histograms. The JsonBlockBasedLog stores Rust structs that are serializable by Serde (as opposed to a normal BlockBasedLog which stores fixed-size C structs, anotated with `#[repr(C)]`). There is no mechanism to discard the historical hits-by-size histograms. Performance evaluation found good performance even with enough entries to cover many decades of history. Therefore, reducing the number of entries is left to future work.
- Loading branch information
Showing
17 changed files
with
652 additions
and
207 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.