Commit e6736688 by Nagy Gergő

Fixed test code formatting

parent 76948cf4
...@@ -6,16 +6,16 @@ server_port = "8080" ...@@ -6,16 +6,16 @@ server_port = "8080"
query = Query() query = Query()
query.setTarget("1889.foo.fook.fookie.com.DOMAIN") query.setTarget("1889.foo.fook.fookie.com.DOMAIN")
query.setMetric("cpu.usage") query.setMetric("cpu.usage")
query.setFormat("json") # Not neccesary, default is json query.setFormat("json") #Not neccesary, default is json
query.setRelativeStart(1, "minutes") # Current cpu usage query.setRelativeStart(1, "minutes") #Current cpu usage
query.generate() query.generate()
# print(query.getGenerated()) #print(query.getGenerated())
print(query.getStart()) print(query.getStart())
# query.setAbsoluteStart("1889", "04", "20", "00", "00") #query.setAbsoluteStart("1889", "04", "20", "00", "00")
# query.setRelativeEnd(...) #query.setRelativeEnd(...)
# query.setAbsoluteEnd(...) #query.setAbsoluteEnd(...)
handler = GraphiteHandler(server_name, server_port) handler = GraphiteHandler(server_name, server_port)
...@@ -25,5 +25,3 @@ response = handler.pop() ...@@ -25,5 +25,3 @@ response = handler.pop()
print(response["target"]) print(response["target"])
print(response["datapoints"]) print(response["datapoints"])
...@@ -7,12 +7,12 @@ query.setMetric("cpu.usage") ...@@ -7,12 +7,12 @@ query.setMetric("cpu.usage")
query.setAbsoluteStart("2013", "10", "23", "00", "00") query.setAbsoluteStart("2013", "10", "23", "00", "00")
query.generate() query.generate()
handler = GraphiteHandler("10.9.1.209") handler = GraphiteHandler("10.9.1.209")
times = int(input("How many requests do you intend to send? [postive integer] ")) times = int(input("How many requests do you intend to send? [postive integer] "))
global_start = datetime.datetime.now() global_start = datetime.datetime.now()
for i in range (1,times): for i in range(1, times):
local_start = datetime.datetime.now() local_start = datetime.datetime.now()
handler.put(query) handler.put(query)
handler.send() handler.send()
...@@ -24,5 +24,5 @@ print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*") ...@@ -24,5 +24,5 @@ print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*")
print("Summary:") print("Summary:")
print(global_end - global_start) print(global_end - global_start)
print("AVG:") print("AVG:")
print((global_end -global_start) / times) print((global_end - global_start) / times)
print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*") print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment