Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: third_party/grpc/test/cpp/qps/qps_test_with_poll.cc

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/grpc/test/cpp/qps/qps_test.cc ('k') | third_party/grpc/test/cpp/qps/qps_worker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/test/cpp/qps/qps_test_with_poll.cc
diff --git a/third_party/WebKit/Source/core/animation/animatable/AnimatableImage.cpp b/third_party/grpc/test/cpp/qps/qps_test_with_poll.cc
similarity index 55%
copy from third_party/WebKit/Source/core/animation/animatable/AnimatableImage.cpp
copy to third_party/grpc/test/cpp/qps/qps_test_with_poll.cc
index 171bbfa52853035aac9a5a8b842d92fe40fdd058..8340a6386a5f8c433ee1dcd9fff69f918119188f 100644
--- a/third_party/WebKit/Source/core/animation/animatable/AnimatableImage.cpp
+++ b/third_party/grpc/test/cpp/qps/qps_test_with_poll.cc
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Copyright 2015-2016, Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,40 +28,58 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
*/
-#include "core/animation/animatable/AnimatableImage.h"
+#include <set>
-#include "core/css/CSSImageValue.h"
-#include "core/style/StyleGeneratedImage.h"
-#include "wtf/MathExtras.h"
+#include <grpc/support/log.h>
-namespace blink {
+#include "test/cpp/qps/driver.h"
+#include "test/cpp/qps/report.h"
+#include "test/cpp/util/benchmark_config.h"
-// FIXME: Once cross-fade works on generated image types, remove this method.
-bool AnimatableImage::usesDefaultInterpolationWith(const AnimatableValue* value) const
-{
- if (!m_value->isImageValue())
- return true;
- if (!toAnimatableImage(value)->toCSSValue()->isImageValue())
- return true;
- return false;
+extern "C" {
+#include "src/core/iomgr/pollset_posix.h"
}
-PassRefPtr<AnimatableValue> AnimatableImage::interpolateTo(const AnimatableValue* value, double fraction) const
-{
- if (fraction <= 0 || fraction >= 1 || usesDefaultInterpolationWith(value))
- return defaultInterpolateTo(this, value, fraction);
+namespace grpc {
+namespace testing {
- CSSValue* fromValue = toCSSValue();
- CSSValue* toValue = toAnimatableImage(value)->toCSSValue();
+static const int WARMUP = 5;
+static const int BENCHMARK = 5;
- return create(CSSCrossfadeValue::create(fromValue, toValue, CSSPrimitiveValue::create(fraction, CSSPrimitiveValue::UnitType::Number)));
-}
+static void RunQPS() {
+ gpr_log(GPR_INFO, "Running QPS test");
+
+ ClientConfig client_config;
+ client_config.set_client_type(ASYNC_CLIENT);
+ client_config.set_outstanding_rpcs_per_channel(1000);
+ client_config.set_client_channels(8);
+ client_config.set_async_client_threads(8);
+ client_config.set_rpc_type(UNARY);
+ client_config.mutable_load_params()->mutable_closed_loop();
+
+ ServerConfig server_config;
+ server_config.set_server_type(ASYNC_SERVER);
+ server_config.set_async_server_threads(4);
+
+ const auto result =
+ RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);
-bool AnimatableImage::equalTo(const AnimatableValue* value) const
-{
- return m_value->equals(*toAnimatableImage(value)->m_value.get());
+ GetReporter()->ReportQPSPerCore(*result);
+ GetReporter()->ReportLatency(*result);
}
-} // namespace blink
+} // namespace testing
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ grpc::testing::InitBenchmark(&argc, &argv, true);
+
+ grpc_platform_become_multipoller = grpc_poll_become_multipoller;
+
+ grpc::testing::RunQPS();
+
+ return 0;
+}
« no previous file with comments | « third_party/grpc/test/cpp/qps/qps_test.cc ('k') | third_party/grpc/test/cpp/qps/qps_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698