[skip ci] change type of tps and qps from int64_t to double (#4705)

fix bug: QPS will be zero when TPS is less than 1 in sdk/examples/sdk_qps

Signed-off-by: WangJian <wangjian4500@gmail.com>
pull/4713/head
WangJian 2021-02-09 10:25:04 +08:00 committed by GitHub
parent c8dec9f02f
commit 3cd1b37278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -336,9 +336,8 @@ ClientTest::Search() {
std::chrono::system_clock::time_point end = std::chrono::system_clock::now();
int64_t span = (std::chrono::duration_cast<std::chrono::milliseconds>(end - start)).count();
double sec = (double)span / 1000.0;
double tps_s = parameters_.query_count_ / sec;
int64_t tps = (int64_t)tps_s;
int64_t qps = tps * parameters_.nq_;
double tps = parameters_.query_count_ / sec;
double qps = tps * parameters_.nq_;
std::cout << "TPS = " << tps << " \tQPS = " << qps << std::endl;
// print search detail statistics