File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
base/cvd/cuttlefish/host/commands/cvd/cli/commands Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ cf_cc_library(
144144 "//cuttlefish/host/commands/cvd/fetch:fetch_cvd_parser" ,
145145 "//cuttlefish/host/commands/cvd/utils" ,
146146 "//cuttlefish/host/commands/cvd/utils:common" ,
147+ "//cuttlefish/host/libs/metrics:fetch_metrics_orchestration" ,
147148 "//cuttlefish/result" ,
148149 "//libbase" ,
149150 "@abseil-cpp//absl/log" ,
Original file line number Diff line number Diff line change 3434#include " cuttlefish/host/commands/cvd/fetch/fetch_cvd.h"
3535#include " cuttlefish/host/commands/cvd/fetch/fetch_cvd_parser.h"
3636#include " cuttlefish/host/commands/cvd/utils/common.h"
37+ #include " cuttlefish/host/libs/metrics/fetch_metrics_orchestration.h"
3738#include " cuttlefish/result/result.h"
3839
3940namespace cuttlefish {
@@ -55,6 +56,7 @@ Result<void> CvdFetchCommandHandler::Handle(const CommandRequest& request) {
5556 std::vector<std::string> args = request.SubcommandArguments ();
5657 const FetchFlags flags = CF_EXPECT (FetchFlags::Parse (args));
5758 CF_EXPECT (EnsureDirectoryExists (flags.target_directory ));
59+ GatherFetchStartMetrics (flags);
5860
5961 std::string log_file = GetFetchLogsFileName (flags.target_directory );
6062 ScopedLogger logger (SeverityTarget::FromFile (log_file), " " );
@@ -74,6 +76,12 @@ Result<void> CvdFetchCommandHandler::Handle(const CommandRequest& request) {
7476 flags.build_api_flags .max_cache_size_gb );
7577 }
7678 }
79+
80+ if (result.ok ()) {
81+ GatherFetchCompleteMetrics (flags.target_directory , *result);
82+ } else {
83+ GatherFetchFailedMetrics (flags.target_directory );
84+ }
7785 CF_EXPECT (std::move (result));
7886 return {};
7987}
You can’t perform that action at this time.
0 commit comments