Пример #1
0
 def __init__(self, args):
     try:
         self.client = voltdbclient.FastSerializer(args.server, args.port, False, args.username, args.password)
     except socket.error,e:
         print "Can't connect to " + args.server + ":" + str(args.port)
         print str(e)
         exit(-1)
Пример #2
0
                  (0 is exactly even, > 1 is very skewed)
  inMB/s:        MB/s passed in as procedure invocation parameters
  outMB/s:       MB/s returned as results of procedure invocations
'''


parser = argparse.ArgumentParser(description="This script is used to monitor current performance metrics.", usage=print_usage())
parser.add_argument('-s', '--server', help='Hostname or IP of VoltDB server', default='localhost')
parser.add_argument('-p', '--port', help='Port number of VoltDB server', type=int, default=21211)
parser.add_argument('-u', '--username', help='User name (if security is enabled)', default='')
parser.add_argument('-pw', '--password', help='Password (if security is enabled)', default='')
parser.add_argument('-f', '--frequency', help='Frequency of gathering statistics in seconds (default = 5 seconds)', type=int, default=5)
parser.add_argument('-d', '--duration', help='Duration of gathering statistics in minutes (default = 30)', type=int, default=30)
args = parser.parse_args()

client = voltdbclient.FastSerializer(args.server, args.port, False, args.username, args.password)

# procedure call response error handling
def check_response(response):
    status = response.status
    if status != 1:
        status_codes = {
            -1: "User Abort",
            -2: "Graceful Failure",
            -3: "Unexpected Failure",
            -4: "Connection Lost",
            -5: "Server Unavailable",
            -6: "Connection Timeout",
            -7: "Response Unkonwn",
            -8: "Transaction Restart",
            -9: "Operational Failure"