/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THRIFT_TEST_PERF_CLIENTWORKER2_H_ #define THRIFT_TEST_PERF_CLIENTWORKER2_H_ 1 #include #include #include namespace apache { namespace thrift { namespace test { class ClientLoadConfig; // Before updating for header format LoadTestClientT was specialized on // TBinaryProtocolT, but in practice it didn't seem to // affect the timing. class ClientWorker2 : public loadgen::Worker { public: typedef LoadTestAsyncClient Client; typedef loadgen::Worker Parent; std::shared_ptr createConnection() override; void performOperation( const std::shared_ptr& client, uint32_t opType) override; private: void performNoop(const std::shared_ptr& client); void performOnewayNoop(const std::shared_ptr& client); void performAsyncNoop(const std::shared_ptr& client); void performSleep(const std::shared_ptr& client); void performOnewaySleep(const std::shared_ptr& client); void performBurn(const std::shared_ptr& client); void performOnewayBurn(const std::shared_ptr& client); void performBadSleep(const std::shared_ptr& client); void performBadBurn(const std::shared_ptr& client); void performThrowError(const std::shared_ptr& client); void performThrowUnexpected(const std::shared_ptr& client); void performOnewayThrow(const std::shared_ptr& client); void performSend(const std::shared_ptr& client); void performOnewaySend(const std::shared_ptr& client); void performRecv(const std::shared_ptr& client); void performSendrecv(const std::shared_ptr& client); void performEcho(const std::shared_ptr& client); void performAdd(const std::shared_ptr& client); void performLargeContainer(const std::shared_ptr& client); void performIterAllFields(const std::shared_ptr& client); folly::EventBaseManager ebm_; }; } // namespace test } // namespace thrift } // namespace apache #endif // THRIFT_TEST_PERF_CLIENTWORKER2_H_