Update to ads v16.

Google ads api v13 is sunsetted.

PiperOrigin-RevId: 618321878
pull/16217/head
Protobuf Team Bot 2024-03-22 16:54:21 -07:00 committed by Copybara-Service
parent c56de479a4
commit 41aeb3c7ed
3 changed files with 10 additions and 10 deletions

View File

@ -153,9 +153,9 @@ http_archive(
http_archive(
name = "com_google_googleapis",
urls = ["https://github.com/googleapis/googleapis/archive/30ed2662a85403cbdeb9ea38df1e414a2a276b83.zip"],
strip_prefix = "googleapis-30ed2662a85403cbdeb9ea38df1e414a2a276b83",
sha256 = "4dfc28101127d22abd6f0f6308d915d490c4594c0cfcf7643769c446d6763a46",
urls = ["https://github.com/googleapis/googleapis/archive/d81d0b9e6993d6ab425dff4d7c3d05fb2e59fa57.zip"],
strip_prefix = "googleapis-d81d0b9e6993d6ab425dff4d7c3d05fb2e59fa57",
sha256 = "d986023c3d8d2e1b161e9361366669cac9fb97c2a07e656c2548aca389248bb4",
build_file = "//benchmarks:BUILD.googleapis",
patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
)

View File

@ -36,7 +36,7 @@ load(
proto_library(
name = "ads_proto",
srcs = glob([
"google/ads/googleads/v13/**/*.proto",
"google/ads/googleads/v16/**/*.proto",
"google/api/**/*.proto",
"google/rpc/**/*.proto",
"google/longrunning/**/*.proto",

View File

@ -14,7 +14,7 @@
#include <string>
#include <vector>
#include "google/ads/googleads/v13/services/google_ads_service.upbdefs.h"
#include "google/ads/googleads/v16/services/google_ads_service.upbdefs.h"
#include "google/protobuf/descriptor.pb.h"
#include "absl/container/flat_hash_set.h"
#include "absl/log/absl_check.h"
@ -181,14 +181,14 @@ static void BM_LoadAdsDescriptor_Upb(benchmark::State& state) {
for (auto _ : state) {
upb::DefPool defpool;
if (Mode == NoLayout) {
google_ads_googleads_v13_services_SearchGoogleAdsRequest_getmsgdef(
google_ads_googleads_v16_services_SearchGoogleAdsRequest_getmsgdef(
defpool.ptr());
bytes_per_iter = _upb_DefPool_BytesLoaded(defpool.ptr());
} else {
bytes_per_iter = 0;
LoadDefInit_BuildLayout(
defpool.ptr(),
&google_ads_googleads_v13_services_google_ads_service_proto_upbdefinit,
&google_ads_googleads_v16_services_google_ads_service_proto_upbdefinit,
&bytes_per_iter);
}
}
@ -200,11 +200,11 @@ BENCHMARK_TEMPLATE(BM_LoadAdsDescriptor_Upb, WithLayout);
template <LoadDescriptorMode Mode>
static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) {
extern _upb_DefPool_Init
google_ads_googleads_v13_services_google_ads_service_proto_upbdefinit;
google_ads_googleads_v16_services_google_ads_service_proto_upbdefinit;
std::vector<upb_StringView> serialized_files;
absl::flat_hash_set<const _upb_DefPool_Init*> seen_files;
CollectFileDescriptors(
&google_ads_googleads_v13_services_google_ads_service_proto_upbdefinit,
&google_ads_googleads_v16_services_google_ads_service_proto_upbdefinit,
serialized_files, seen_files);
size_t bytes_per_iter = 0;
for (auto _ : state) {
@ -227,7 +227,7 @@ static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) {
if (Mode == WithLayout) {
protobuf::DynamicMessageFactory factory;
const protobuf::Descriptor* d = pool.FindMessageTypeByName(
"google.ads.googleads.v13.services.SearchGoogleAdsResponse");
"google.ads.googleads.v16.services.SearchGoogleAdsResponse");
if (!d) {
printf("Failed to find descriptor.\n");
exit(1);