예제 #1
0
   elif option == '--db':
     db = arg
   elif option == '--hd':
     hd_logging = True
   elif option == '--dbstats':
     dbstats_logging = True
   elif option == '--query':
     query_logging = True
   elif option == '--help':
     usage()
   else:
     assert False, "unhandled option"
 
 '''Carry out the benchmarks, given the command line options'''
 # Get a logger instance to write benchmark data
 benchmarkDB = MongoLogger.mongoCRUD(host, port)
 benchmarkDB.initBenchmarkDB(db)
 
 if hd_logging: # Do harddrive stats benchmarking
   driveStatsEntry = DriveStats.getDriveStatsLogEntry()
   benchmarkDB.addHdUsageEntry(driveStatsEntry);
 
 if dbstats_logging: # Do database status benchmarking
   status_db = DatabaseStatus.databaseStatus(host, port, "data")
   db_entries_list = []
   db_entries_list.append(status_db.getServerStatusLogEntry())
   db_entries_list.append(status_db.getDatabaseStatsLogEntry())
   db_entries_list.append(status_db.getAvailableShardsLogEntry())
   db_entries_list.append(status_db.getCollectionStatsLogEntry("historical"))
   db_entries_list.append(status_db.getChunkDistributionLogEntry())
   # Use printLogEntry(test_entry) to debug a test entry
예제 #2
0
 def __init__(self, host, port, db_name, coll_name):
   self.logger = MongoLogger.mongoCRUD(host, port)
   self.logger.initDataDB(db_name, coll_name)