def METHOD_NAME(instrument, elasticapm_client, mc_conn):
    elasticapm_client.begin_transaction("transaction.test")
    host = os.environ.get("MEMCACHED_HOST", "localhost")
    with capture_span("test_pymemcache", "test"):
        mc_conn.set("mykey", "a")
        assert b"a" == mc_conn.get("mykey")
        assert {"mykey": b"a"} == mc_conn.get_many(["mykey", "myotherkey"])
    elasticapm_client.end_transaction("BillingView")
    transactions = elasticapm_client.events[TRANSACTION]
    spans = elasticapm_client.spans_for_transaction(transactions[0])
    expected_signatures = {"test_pymemcache", "Client.set", "Client.get", "Client.get_many"}
    assert {t["name"] for t in spans} == expected_signatures
    assert spans[0]["name"] == "Client.set"
    assert spans[0]["type"] == "cache"
    assert spans[0]["subtype"] == "memcached"
    assert spans[0]["action"] == "query"
    assert spans[0]["parent_id"] == spans[3]["id"]
    assert spans[1]["name"] == "Client.get"
    assert spans[1]["type"] == "cache"
    assert spans[1]["subtype"] == "memcached"
    assert spans[1]["action"] == "query"
    assert spans[1]["parent_id"] == spans[3]["id"]
    assert spans[1]["context"]["destination"] == {
        "address": host,
        "port": 11211,
        "service": {"name": "", "resource": "memcached", "type": ""},
    }
    assert spans[2]["name"] == "Client.get_many"
    assert spans[2]["type"] == "cache"
    assert spans[2]["subtype"] == "memcached"
    assert spans[2]["action"] == "query"
    assert spans[2]["parent_id"] == spans[3]["id"]
    assert spans[3]["name"] == "test_pymemcache"
    assert spans[3]["type"] == "test"
    assert len(spans) == 4