diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-18 03:02:49 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-18 03:02:49 +0200 |
commit | 7a4461355f7ee8e5ec71888516cbfd640dd7e110 (patch) | |
tree | 5f800152d48de71247177c4fca93fff24dc993ac /fbench | |
parent | 15e7bcd9e902407fbe14cf830968f06c9fb5fb89 (diff) |
Include only what you need.
Diffstat (limited to 'fbench')
-rw-r--r-- | fbench/src/fbench/client.cpp | 6 | ||||
-rw-r--r-- | fbench/src/fbench/client.h | 12 | ||||
-rw-r--r-- | fbench/src/fbench/fbench.cpp | 6 | ||||
-rw-r--r-- | fbench/src/httpclient/httpclient.cpp | 2 | ||||
-rw-r--r-- | fbench/src/test/clientstatus.cpp | 3 | ||||
-rw-r--r-- | fbench/src/test/httpclient.cpp | 2 | ||||
-rw-r--r-- | fbench/src/test/httpclient_splitstring.cpp | 1 |
7 files changed, 21 insertions, 11 deletions
diff --git a/fbench/src/fbench/client.cpp b/fbench/src/fbench/client.cpp index 5c828fc4282..0200ea2d067 100644 --- a/fbench/src/fbench/client.cpp +++ b/fbench/src/fbench/client.cpp @@ -1,8 +1,12 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "client.h" #include <util/timer.h> +#include <util/clientstatus.h> #include <httpclient/httpclient.h> #include <util/filereader.h> -#include "client.h" +#include <cassert> +#include <cstring> Client::Client(ClientArguments *args) : _args(args), diff --git a/fbench/src/fbench/client.h b/fbench/src/fbench/client.h index 107b4997d93..1e0b750dbb2 100644 --- a/fbench/src/fbench/client.h +++ b/fbench/src/fbench/client.h @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <util/clientstatus.h> #include <fstream> #include <atomic> #include <thread> @@ -150,6 +149,11 @@ private: ClientArguments &operator=(const ClientArguments &); }; + +class Timer; +class HTTPClient; +class FileReader; +class ClientStatus; /** * This class implements a single test client. The clients are run in * separate threads to simulate several simultanious users. The @@ -161,9 +165,9 @@ class Client private: std::unique_ptr<ClientArguments> _args; std::unique_ptr<ClientStatus> _status; - Timer::UP _reqTimer; - Timer::UP _cycleTimer; - Timer::UP _masterTimer; + std::unique_ptr<Timer> _reqTimer; + std::unique_ptr<Timer> _cycleTimer; + std::unique_ptr<Timer> _masterTimer; std::unique_ptr<HTTPClient> _http; std::unique_ptr<FileReader> _reader; std::unique_ptr<std::ofstream> _output; diff --git a/fbench/src/fbench/fbench.cpp b/fbench/src/fbench/fbench.cpp index c840797fc4e..c6a34099b3b 100644 --- a/fbench/src/fbench/fbench.cpp +++ b/fbench/src/fbench/fbench.cpp @@ -2,10 +2,10 @@ #include <util/timer.h> #include <httpclient/httpclient.h> #include <util/filereader.h> +#include <util/clientstatus.h> #include "client.h" #include "fbench.h" -#include <thread> - +#include <cstring> #include <cmath> sig_atomic_t exitSignal = 0; @@ -161,7 +161,7 @@ FBench::PrintSummary() if (_keepAlive) { printf("*** HTTP keep-alive statistics ***\n"); - printf("connection reuse count -- %" PRId64 "\n", status._reuseCnt); + printf("connection reuse count -- %zu\n", status._reuseCnt); } printf("***************** Benchmark Summary *****************\n"); printf("clients: %8ld\n", _clients.size()); diff --git a/fbench/src/httpclient/httpclient.cpp b/fbench/src/httpclient/httpclient.cpp index 56d8baa4264..c49ef5da12c 100644 --- a/fbench/src/httpclient/httpclient.cpp +++ b/fbench/src/httpclient/httpclient.cpp @@ -1,5 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "httpclient.h" +#include <cassert> +#include <cstring> #define FETCH_BUFLEN 5120 #define FIXED_REQ_MAX 256 diff --git a/fbench/src/test/clientstatus.cpp b/fbench/src/test/clientstatus.cpp index 751c578e4d3..c8b7bce1a34 100644 --- a/fbench/src/test/clientstatus.cpp +++ b/fbench/src/test/clientstatus.cpp @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <util/timer.h> -#include <util/filereader.h> -#include <httpclient/httpclient.h> +#include <util/clientstatus.h> #include <fbench/client.h> int diff --git a/fbench/src/test/httpclient.cpp b/fbench/src/test/httpclient.cpp index 31e3f8297c4..4201da68b97 100644 --- a/fbench/src/test/httpclient.cpp +++ b/fbench/src/test/httpclient.cpp @@ -49,6 +49,6 @@ main(int argc, char **argv) } else { printf("ERROR: could not fetch URL content.\n"); } - printf("REUSE COUNT: %" PRIu64 "\n", client->GetReuseCount()); + printf("REUSE COUNT: %zu\n", client->GetReuseCount()); return 0; } diff --git a/fbench/src/test/httpclient_splitstring.cpp b/fbench/src/test/httpclient_splitstring.cpp index 655738170bd..d766b0f8f4b 100644 --- a/fbench/src/test/httpclient_splitstring.cpp +++ b/fbench/src/test/httpclient_splitstring.cpp @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <httpclient/httpclient.h> +#include <cstring> class DebugHTTPClient : public HTTPClient { |