Skip to content

WIP: Do not calculate cache quota when we don't need to

James Ennis requested to merge jennis/cache_quota into master

Description

The latter commit of this MR is related to #996 (closed). After having read through the issue, it sounded like we may be doing work when we don't need to. It does not look like we need to calculate the cache quota upon instantiation of a the CASQuota object, as we calculate it when we need to.

The former commit ensures that we pretty print the cache quota in the UI:

Without patch:

 $ bst build hello.bst 

[snip]

BuildStream Version 1.3.0+2090.g58d8b1c7
  Session Start: Wednesday, 24-04-2019 at 11:09:23
  Project:       autotools (/home/jennis/scratch/autotools)
  Targets:       hello.bst
  Cache Usage:   135.4M / 5368709120 (2%)

With patch:

 $ bst build hello.bst 

[snip]

BuildStream Version 1.3.0+2094.g7e03f415
  Session Start: Wednesday, 24-04-2019 at 11:08:44
  Project:       autotools (/home/jennis/scratch/autotools)
  Targets:       hello.bst
  Cache Usage:   135.4M / 5G (2%)

Notice the change of 5368709120 -> 5G

Edited by James Ennis

Merge request reports

Loading