Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e6736688
authored
Nov 11, 2013
by
Nagy Gergő
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test code formatting
parent
76948cf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
circle/monitor/calvin/examples/basic.py
+6
-8
circle/monitor/calvin/examples/test.py
+3
-3
No files found.
circle/monitor/calvin/examples/basic.py
View file @
e6736688
...
@@ -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"
])
circle/monitor/calvin/examples/test.py
View file @
e6736688
...
@@ -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
(
"*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment