Sha256: 236ddf6496427633ee59a58220457060e48e5aeb3951fb5ac716f69199fc3865

Contents?: true

Size: 1.56 KB

Versions: 6

Compression:

Stored size: 1.56 KB

Contents

/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *   Copyright 2020-2021 Couchbase, Inc.
 *
 *   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.
 */

#include "benchmark_helper_integration.hxx"

TEST_CASE("benchmark: get a document", "[benchmark]")
{
    test::utils::integration_test_guard integration;

    test::utils::open_bucket(integration.cluster, integration.ctx.bucket);

    couchbase::core::document_id id{ integration.ctx.bucket, "_default", "_default", test::utils::uniq_id("foo") };

    {
        const tao::json::value value = {
            { "a", 1.0 },
            { "b", 2.0 },
        };
        couchbase::core::operations::upsert_request req{ id, couchbase::core::utils::json::generate_binary(value) };
        auto resp = test::utils::execute(integration.cluster, req);
        REQUIRE_SUCCESS(resp.ctx.ec());
    }

    BENCHMARK("get")
    {
        couchbase::core::operations::get_request req{ id };
        auto resp = test::utils::execute(integration.cluster, req);
        REQUIRE_SUCCESS(resp.ctx.ec());
    };
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
couchbase-3.4.5 ext/couchbase/test/benchmark_integration_get.cxx
couchbase-3.4.4 ext/couchbase/test/benchmark_integration_get.cxx
couchbase-3.4.3 ext/couchbase/test/benchmark_integration_get.cxx
couchbase-3.4.2 ext/couchbase/test/benchmark_integration_get.cxx
couchbase-3.4.1 ext/couchbase/test/benchmark_integration_get.cxx
couchbase-3.4.0 ext/couchbase/test/benchmark_integration_get.cxx