Added samples, benchmarks and docs for nox format. (#556)
* Added samples for nox format. Signed-off-by: dblock <[email protected]> * Added space after #!/usr/bin/env python. Signed-off-by: dblock <[email protected]> * Added benchmarks and docs. Signed-off-by: dblock <[email protected]> --------- Signed-off-by: dblock <[email protected]>
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
|
||||
import asyncio
|
||||
import uuid
|
||||
@@ -25,7 +28,7 @@ async def index_records(client, item_count):
|
||||
client.index(
|
||||
index=index_name,
|
||||
body={
|
||||
"title": f"Moneyball",
|
||||
"title": "Moneyball",
|
||||
"director": "Bennett Miller",
|
||||
"year": "2011",
|
||||
},
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
|
||||
|
||||
import logging
|
||||
import sys
|
||||
@@ -36,7 +40,7 @@ def get_info(client, request_count):
|
||||
tt = 0
|
||||
for n in range(request_count):
|
||||
start = time.time() * 1000
|
||||
rc = client.info()
|
||||
client.info()
|
||||
total_time = time.time() * 1000 - start
|
||||
tt += total_time
|
||||
return tt
|
||||
|
||||
@@ -6,8 +6,13 @@
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
import time
|
||||
import uuid
|
||||
|
||||
@@ -21,9 +26,6 @@ auth = ("admin", "admin")
|
||||
index_name = "test-index-sync"
|
||||
item_count = 1000
|
||||
|
||||
import logging
|
||||
import sys
|
||||
|
||||
root = logging.getLogger()
|
||||
# root.setLevel(logging.DEBUG)
|
||||
# logging.getLogger("urllib3.connectionpool").setLevel(logging.DEBUG)
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
|
||||
|
||||
import bench_async
|
||||
import bench_sync
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
|
||||
|
||||
from threading import Thread
|
||||
|
||||
|
||||
Reference in New Issue
Block a user