Commit 7fbe80fa authored by Sophie Chang's avatar Sophie Chang Committed by Commit Bot

Add DownloadClient for optimization guide prediction models

Will add the client itself in a separate CL
This is basically following the template of https://chromium-review.googlesource.com/c/chromium/src/+/1416131

Bug: 1146151
Change-Id: I77a32bdf4021768d902f9975c1077f3c0fbd3c77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522399Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825904}
parent cf054220
......@@ -56,6 +56,8 @@ std::string ClientToString(DownloadClient client) {
return "MountainInternal";
case DownloadClient::PLUGIN_VM_IMAGE:
return "PluginVmImage";
case DownloadClient::OPTIMIZATION_GUIDE_PREDICTION_MODELS:
return "OptimizationGuidePredictionModels";
case DownloadClient::BOUNDARY: // Intentional fallthrough.
default:
NOTREACHED();
......
......@@ -23,7 +23,10 @@ enum DownloadClient {
DEBUGGING = 6;
MOUNTAIN_INTERNAL = 7;
PLUGIN_VM_IMAGE = 8;
BOUNDARY = 9;
OPTIMIZATION_GUIDE_PREDICTION_MODELS = 9;
// New clients should be added above here.
BOUNDARY = 10;
}
// Stores the request params, internal state, metrics and metadata associated
......
......@@ -72,6 +72,8 @@ protodb::DownloadClient ProtoConversions::DownloadClientToProto(
return protodb::DownloadClient::MOUNTAIN_INTERNAL;
case DownloadClient::PLUGIN_VM_IMAGE:
return protodb::DownloadClient::PLUGIN_VM_IMAGE;
case DownloadClient::OPTIMIZATION_GUIDE_PREDICTION_MODELS:
return protodb::DownloadClient::OPTIMIZATION_GUIDE_PREDICTION_MODELS;
case DownloadClient::BOUNDARY:
return protodb::DownloadClient::BOUNDARY;
}
......@@ -101,6 +103,8 @@ DownloadClient ProtoConversions::DownloadClientFromProto(
return DownloadClient::MOUNTAIN_INTERNAL;
case protodb::DownloadClient::PLUGIN_VM_IMAGE:
return DownloadClient::PLUGIN_VM_IMAGE;
case protodb::DownloadClient::OPTIMIZATION_GUIDE_PREDICTION_MODELS:
return DownloadClient::OPTIMIZATION_GUIDE_PREDICTION_MODELS;
case protodb::DownloadClient::BOUNDARY:
return DownloadClient::BOUNDARY;
}
......
......@@ -96,6 +96,8 @@ std::string ClientToHistogramSuffix(DownloadClient client) {
return "MountainInternal";
case DownloadClient::PLUGIN_VM_IMAGE:
return "PluginVmImage";
case DownloadClient::OPTIMIZATION_GUIDE_PREDICTION_MODELS:
return "OptimizationGuidePredictionModels";
case DownloadClient::BOUNDARY:
NOTREACHED();
break;
......
......@@ -41,7 +41,10 @@ enum class DownloadClient {
PLUGIN_VM_IMAGE = 5,
BOUNDARY = 6,
OPTIMIZATION_GUIDE_PREDICTION_MODELS = 6,
// New clients should be added above here.
BOUNDARY = 7,
};
using DownloadClientMap = std::map<DownloadClient, std::unique_ptr<Client>>;
......
......@@ -5457,6 +5457,8 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<suffix name="Debugging" label="Debugging client."/>
<suffix name="MountainInternal" label="Mountain internal client."/>
<suffix name="OfflinePage" label="Offline page prefetch."/>
<suffix name="OptimizationGuidePredictionModels"
label="Optimization Guide prediction models."/>
<suffix name="PluginVmImage" label="PluginVm image."/>
<affected-histogram name="Download.Service.Clients.InflatedFullBrowser"/>
<affected-histogram name="Download.Service.Request.ClientAction"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment