diff options
author | Taseer Ahmed <taseer94@gmail.com> | 2017-01-09 20:41:23 +0500 |
---|---|---|
committer | Taseer Ahmed <taseer94@gmail.com> | 2017-01-17 19:02:31 +0500 |
commit | 81aaf88e151694a08ff3d4cf4a7fe50df7232731 (patch) | |
tree | 54cba3438763c78a4dd32de242b1b3e4c132d03d /qtip/cli/commands/cmd_perftest.py | |
parent | 2a3a0aec933566bc676ad259ca51e6eaa1f8ab76 (diff) |
Metric module outline
Change-Id: Id95b07f1c0821ae0883c761fdf8f507afba4e5c0
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'qtip/cli/commands/cmd_perftest.py')
-rw-r--r-- | qtip/cli/commands/cmd_perftest.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/qtip/cli/commands/cmd_perftest.py b/qtip/cli/commands/cmd_perftest.py deleted file mode 100644 index 129ee2d9..00000000 --- a/qtip/cli/commands/cmd_perftest.py +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################## -# Copyright (c) 2016 ZTE Corp and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -from prettytable import PrettyTable -import yaml -import click -import os -from qtip.cli import helper - - -class PerfTest: - - def __init__(self): - self.path = os.path.join(helper.fetch_root(), 'perftest/summary') - - def list(self): - table = PrettyTable(["Name", "Description"]) - table.align = 'l' - with open(self.path) as tests: - line = tests.read() - data = yaml.safe_load(line)['test_cases'] - for i in range(0, len(data)): - points = data[i] - table.add_row([points['name'], points['description']]) - click.echo(table) - - def run(self): - click.echo("Run a perftest") - - -@click.group() -def cli(): - pass - - -@cli.group() -@click.pass_context -def perftest(ctx): - pass - - -_perftest = PerfTest() - - -@perftest.command("list", help="Lists all perftest benchmarks.") -def list(): - _perftest.list() - - -@perftest.command("run", help="Executes a single perftest benchmark.") -def execute(): - _perftest.run() |