Skip to content

Commit

Permalink
Display input root usage statistics
Browse files Browse the repository at this point in the history
When the File System Access Cache (FSAC) is enabled, bb_worker is
capable of counting how many files and directories in the input root are
actually being accessed. Let's display this information through
bb_browser as well.
  • Loading branch information
EdSchouten committed Aug 30, 2023
1 parent 4ab3ea9 commit 87177f2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/bb_browser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ func main() {
}
return &pb
},
"to_input_root_resource_usage": func(any *anypb.Any) *resourceusage.InputRootResourceUsage {
var pb resourceusage.InputRootResourceUsage
if any.UnmarshalTo(&pb) != nil {
return nil
}
return &pb
},
"to_posix_resource_usage": func(any *anypb.Any) *resourceusage.POSIXResourceUsage {
var pb resourceusage.POSIXResourceUsage
if any.UnmarshalTo(&pb) != nil {
Expand Down
14 changes: 14 additions & 0 deletions cmd/bb_browser/templates/page_action.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,20 @@ <h3 class="my-4">File pool resource usage</h3>
</table>
{{end}}

{{with to_input_root_resource_usage .}}
<h3 class="my-4">Input root resource usage</h3>
<table class="table" style="table-layout: fixed">
<tr>
<th style="width: 25%">Directories:</th>
<td style="width: 75%">{{.DirectoriesResolved}} resolved, {{.DirectoriesRead}} read</td>
</tr>
<tr>
<th style="width: 25%">Files:</th>
<td style="width: 75%">{{.FilesRead}} read</td>
</tr>
</table>
{{end}}

{{with to_posix_resource_usage .}}
<h3 class="my-4">POSIX resource usage</h3>
<table class="table" style="table-layout: fixed">
Expand Down

0 comments on commit 87177f2

Please sign in to comment.