Add byte counts to CAS
Description
Adds byte counts to CAS methods. ByteStream Read, BatchReadBlobs, and GetTree all publish to the cas-downloaded-bytes
metric, and ByteStream Write and BatchUpdateBlobs publish to the cas-uploaded-bytes
metric.
This uses the Counter
construct introduced in !365 (merged). It also fixes a small bug: since the empty string is a valid instance name, the Counter now uses None as the default instance name and checks that the instance name is not None
when determining whether to pass the instance name as metadata.
Changes included in this merge request
- Update all CAS methods that read data with metrics to count the bytes read/written using the
Counter
class introduced in !365 (merged) - Fix a bug in the
Counter
class where the empty instance name was not being properly passed as metadata - Rename
Counter._counter
toCounter._count
Edited by Rohit Kothur