Skip to content

Commit

Permalink
Update to ads v16.
Browse files Browse the repository at this point in the history
Google ads api v13 is sunsetted.

PiperOrigin-RevId: 618321878
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Mar 23, 2024
1 parent c56de47 commit 41aeb3c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/BUILD.googleapis
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 41aeb3c

Please sign in to comment.