示例#1
0
文件: schema.py 项目: phanirajl/sperf
def run_func(args, cmd_name):
    """for code sharing with deprecated schema"""
    print("%s: %s\n" % (cmd_name, VERSION))
    config = schema.Config(args.files, args.diag_dir)
    files = diag.find_files(config, "schema")
    parsed_schema = schema.read(files)
    print(schema.generate_report(parsed_schema))
示例#2
0
文件: schema.py 项目: rsds143/sperf
def run_func(args, cmd_name):
    """for code sharing with deprecated schema"""
    print("%s version: %s\n" % (cmd_name, VERSION))
    config = schema.Config(args.files, args.diag_dir)
    # do not match on files with schema prefix only on files with schema
    files = diag.find_files(config, "schema", exact_filename=True)
    if env.DEBUG:
        print("found schema files: %s", files)
    parsed_schema = schema.read(files)
    print(schema.generate_report(parsed_schema))
示例#3
0
def test_read_schema():
    """test the read schema report"""
    test_file = os.path.join(test_dse_tarball(), "nodes", "10.101.33.205",
                             "driver", "schema")
    files = [test_file]
    parsed = schema.read(files)
    assert parsed["keyspaces"] == 15
    assert parsed["tables"] == 61
    assert parsed["2i"] == 1
    assert parsed["mvs"] == 0
    assert parsed["solr"] == 1
    assert parsed["solr_table"] == 1
示例#4
0
 def test_read_schema(self):
     """test the read schema report"""
     test_file = os.path.join(test_dse_tarball(), "nodes", "10.101.33.205",
                              "driver", "schema")
     files = [test_file]
     parsed = schema.read(files)
     self.assertEqual(parsed["keyspaces"], 15)
     self.assertEqual(parsed["tables"], 61)
     self.assertEqual(parsed["2i"], 1)
     self.assertEqual(parsed["mvs"], 0)
     self.assertEqual(parsed["udts"], 6)
     self.assertEqual(parsed["solr"], 1)
     self.assertEqual(parsed["solr_table"], 1)