make the setup_metrics configurable
setup_metrics always try to send messages in batch. this patch set will allow the program sending messages either in batch or singles Change-Id: I0d15eb3172b1ba7307a02e13a1a69b7d77dac052
This commit is contained in:
parent
2e0a2a5e1a
commit
fbfa441d1f
|
@ -75,7 +75,8 @@ def setup_metrics(argv):
|
|||
print(json.dumps(MOLD))
|
||||
print('StatusCode is %s' % res.status_code)
|
||||
exit(0)
|
||||
# multiple messages
|
||||
# multiple messages in one request
|
||||
if argv[2] == 'true':
|
||||
for k in range(3):
|
||||
msg = "["
|
||||
factor = round(random.random(), 2) * 100
|
||||
|
@ -95,12 +96,13 @@ def setup_metrics(argv):
|
|||
print(json.dumps(MOLD))
|
||||
print('StatusCode is %s' % res.status_code)
|
||||
exit(0)
|
||||
|
||||
del MOLD_DIMENSIONS['key_' + str(a)]
|
||||
print('round finished %s' % a)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 2:
|
||||
if len(sys.argv) == 3:
|
||||
setup_metrics(sys.argv)
|
||||
else:
|
||||
print('Usage: setup_metrics endpoint. For example:')
|
||||
print(' setup_metrics http://<host_ip>:9090/v20/metrics')
|
||||
print(' setup_metrics http://<host_ip>:9090/v2.0/metrics false')
|
||||
|
|
Loading…
Reference in New Issue