Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
d9630c7c
Commit
d9630c7c
authored
Apr 14, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sample xblock metrics at 10%
parent
e62e6b4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
common/lib/xmodule/xmodule/x_module.py
+7
-4
No files found.
common/lib/xmodule/xmodule/x_module.py
View file @
d9630c7c
...
...
@@ -39,6 +39,7 @@ log = logging.getLogger(__name__)
XMODULE_METRIC_NAME
=
'edxapp.xmodule'
XMODULE_DURATION_METRIC_NAME
=
XMODULE_METRIC_NAME
+
'.duration'
XMODULE_METRIC_SAMPLE_RATE
=
0.1
# Stats event sent to DataDog in order to determine if old XML parsing can be deprecated.
DEPRECATION_VSCOMPAT_EVENT
=
'deprecation.vscompat'
...
...
@@ -1195,11 +1196,12 @@ class MetricsMixin(object):
u'course_id:{}'
.
format
(
course_id
),
u'block_type:{}'
.
format
(
block
.
scope_ids
.
block_type
)
]
dog_stats_api
.
increment
(
XMODULE_METRIC_NAME
,
tags
=
tags
)
dog_stats_api
.
increment
(
XMODULE_METRIC_NAME
,
tags
=
tags
,
sample_rate
=
XMODULE_METRIC_SAMPLE_RATE
)
dog_stats_api
.
histogram
(
XMODULE_DURATION_METRIC_NAME
,
end_time
-
start_time
,
tags
=
tags
tags
=
tags
,
sample_rate
=
XMODULE_METRIC_SAMPLE_RATE
,
)
def
handle
(
self
,
block
,
handler_name
,
request
,
suffix
=
''
):
...
...
@@ -1222,11 +1224,12 @@ class MetricsMixin(object):
u'course_id:{}'
.
format
(
course_id
),
u'block_type:{}'
.
format
(
block
.
scope_ids
.
block_type
)
]
dog_stats_api
.
increment
(
XMODULE_METRIC_NAME
,
tags
=
tags
)
dog_stats_api
.
increment
(
XMODULE_METRIC_NAME
,
tags
=
tags
,
sample_rate
=
XMODULE_METRIC_SAMPLE_RATE
)
dog_stats_api
.
histogram
(
XMODULE_DURATION_METRIC_NAME
,
end_time
-
start_time
,
tags
=
tags
tags
=
tags
,
sample_rate
=
XMODULE_METRIC_SAMPLE_RATE
)
...
...
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