Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
0af94560
Commit
0af94560
authored
Aug 23, 2017
by
syed-awais-ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
863e1087
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
util/jenkins/cloudflare-hit-rate.py
+3
-3
No files found.
util/jenkins/cloudflare-hit-rate.py
View file @
0af94560
...
...
@@ -14,10 +14,10 @@ def calcualte_cache_hit_rate(zone_id, auth_key, email, threshold):
HEADERS
=
{
"Accept"
:
"application/json"
,
"X-Auth-Key"
:
auth_key
,
"X-Auth-Email"
:
email
}
# for
last 7 hours, -41
9 indicates minutes, we can go
# for
the past one hour, -5
9 indicates minutes, we can go
# beyond that as well, for example for last 15
# hours it will be -899
PARAMS
=
{
"since"
:
"-
41
9"
,
"continuous"
:
"true"
}
PARAMS
=
{
"since"
:
"-
5
9"
,
"continuous"
:
"true"
}
res
=
requests
.
get
(
CLOUDFLARE_API_ENDPOINT
+
"zones/"
+
zone_id
+
"/analytics/dashboard"
,
headers
=
HEADERS
,
params
=
PARAMS
)
...
...
@@ -30,7 +30,7 @@ def calcualte_cache_hit_rate(zone_id, auth_key, email, threshold):
sys
.
exit
(
1
)
except
Exception
as
error
:
print
"JSON Error: {}
"
.
format
(
error
)
print
"JSON Error: {}
\n
Content returned from API call: {}"
.
format
(
error
,
res
.
text
)
...
...
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