@@ -17,7 +17,7 @@ use hashing::Digest;
17
17
use log:: Level ;
18
18
use remexec:: content_addressable_storage_client:: ContentAddressableStorageClient ;
19
19
use tonic:: { Code , Request , Status } ;
20
- use workunit_store:: { in_workunit, ObservationMetric , WorkunitMetadata } ;
20
+ use workunit_store:: { in_workunit, Metric , ObservationMetric , WorkunitMetadata } ;
21
21
22
22
#[ derive( Clone ) ]
23
23
pub struct ByteStore {
@@ -257,7 +257,13 @@ impl ByteStore {
257
257
workunit_store,
258
258
workunit_name,
259
259
workunit_metadata,
260
- |_workunit| result_future,
260
+ |workunit| async move {
261
+ let result = result_future. await ;
262
+ if result. is_ok( ) {
263
+ workunit. increment_counter( Metric :: RemoteStoreBlobBytesUploaded , len as u64 ) ;
264
+ }
265
+ result
266
+ } ,
261
267
)
262
268
. await
263
269
} else {
@@ -366,7 +372,16 @@ impl ByteStore {
366
372
workunit_store_handle. store,
367
373
workunit_name,
368
374
workunit_metadata,
369
- |_workunit| result_future,
375
+ |workunit| async move {
376
+ let result = result_future. await ;
377
+ if result. is_ok( ) {
378
+ workunit. increment_counter(
379
+ Metric :: RemoteStoreBlobBytesDownloaded ,
380
+ digest. size_bytes as u64 ,
381
+ ) ;
382
+ }
383
+ result
384
+ } ,
370
385
)
371
386
. await
372
387
} else {
0 commit comments