Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
refactor(client): remove benchmark client
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Sep 29, 2019
1 parent a087626 commit 66b78f9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 85 deletions.
7 changes: 0 additions & 7 deletions gnes/cli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ def client(args):
return _client_http(args)
elif args.client == 'cli':
return _client_cli(args)
elif args.client == 'benchmark':
return _client_bm(args)
else:
raise ValueError('gnes client must follow with a client type from {http, cli, benchmark...}\n'
'see "gnes client --help" for details')
Expand Down Expand Up @@ -94,11 +92,6 @@ def _client_cli(args):
CLIClient(args)


def _client_bm(args):
from ..client.benchmark import BenchmarkClient
BenchmarkClient(args)


def compose(args):
from ..composer.base import YamlComposer
from ..composer.flask import YamlComposerFlask
Expand Down
17 changes: 0 additions & 17 deletions gnes/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,21 +365,6 @@ def set_client_cli_parser(parser=None):
return parser


def set_client_benchmark_parser(parser=None):
if not parser:
parser = set_base_parser()
_set_grpc_parser(parser)
parser.add_argument('--batch_size', type=int, default=64,
help='the size of the request to split')
parser.add_argument('--request_length', type=int,
default=1024,
help='binary string length of each request')
parser.add_argument('--num_requests', type=int,
default=128,
help='number of total requests')
return parser


def set_client_http_parser(parser=None):
if not parser:
parser = set_base_parser()
Expand Down Expand Up @@ -422,8 +407,6 @@ def get_main_parser():
set_client_http_parser(
spp.add_parser('http', help='start a client that allows HTTP requests as input', formatter_class=adf))
set_client_cli_parser(spp.add_parser('cli', help='start a client that allows stdin as input', formatter_class=adf))
set_client_benchmark_parser(
spp.add_parser('benchmark', help='start a client for benchmark and unittest', formatter_class=adf))

# others
set_composer_flask_parser(
Expand Down
52 changes: 0 additions & 52 deletions gnes/client/benchmark.py

This file was deleted.

10 changes: 1 addition & 9 deletions tests/test_stream_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import grpc

from gnes.cli.parser import set_frontend_parser, set_router_parser, set_client_benchmark_parser
from gnes.client.benchmark import BenchmarkClient
from gnes.cli.parser import set_frontend_parser, set_router_parser
from gnes.helper import TimeContext
from gnes.proto import RequestGenerator, gnes_pb2_grpc
from gnes.service.base import SocketType, MessageHandler, BaseService as BS
Expand Down Expand Up @@ -55,13 +54,6 @@ def test_bm_frontend(self):
'--yaml_path', 'BaseRouter'
])

b_args = set_client_benchmark_parser().parse_args([
'--num_requests', '10',
'--request_length', '65536'
])
with RouterService(p_args), FrontendService(args):
BenchmarkClient(b_args)

def test_grpc_frontend(self):
args = set_frontend_parser().parse_args([
'--grpc_host', '127.0.0.1',
Expand Down

0 comments on commit 66b78f9

Please sign in to comment.