Commit af486423 by Calen Pennington

Merge pull request #3179 from cpennington/problem-check-metrics

Rename metrics so that we capture checks as well as scores and number of attempts
parents 269cd19a 7e23e265
...@@ -876,7 +876,7 @@ class CapaMixin(CapaFields): ...@@ -876,7 +876,7 @@ class CapaMixin(CapaFields):
answers_without_files = convert_files_to_filenames(answers) answers_without_files = convert_files_to_filenames(answers)
event_info['answers'] = answers_without_files event_info['answers'] = answers_without_files
metric_name = 'capa.check_problem' metric_name = u'capa.check_problem.{}'.format
_ = self.runtime.service(self, "i18n").ugettext _ = self.runtime.service(self, "i18n").ugettext
...@@ -885,7 +885,7 @@ class CapaMixin(CapaFields): ...@@ -885,7 +885,7 @@ class CapaMixin(CapaFields):
event_info['failure'] = 'closed' event_info['failure'] = 'closed'
self.runtime.track_function('problem_check_fail', event_info) self.runtime.track_function('problem_check_fail', event_info)
if dog_stats_api: if dog_stats_api:
dog_stats_api.increment(metric_name, [u'result:failed', u'failure:closed']) dog_stats_api.increment(metric_name('checks'), [u'result:failed', u'failure:closed'])
raise NotFoundError(_("Problem is closed.")) raise NotFoundError(_("Problem is closed."))
# Problem submitted. Student should reset before checking again # Problem submitted. Student should reset before checking again
...@@ -893,7 +893,7 @@ class CapaMixin(CapaFields): ...@@ -893,7 +893,7 @@ class CapaMixin(CapaFields):
event_info['failure'] = 'unreset' event_info['failure'] = 'unreset'
self.runtime.track_function('problem_check_fail', event_info) self.runtime.track_function('problem_check_fail', event_info)
if dog_stats_api: if dog_stats_api:
dog_stats_api.increment(metric_name, [u'result:failed', u'failure:unreset']) dog_stats_api.increment(metric_name('checks'), [u'result:failed', u'failure:unreset'])
raise NotFoundError(_("Problem must be reset before it can be checked again.")) raise NotFoundError(_("Problem must be reset before it can be checked again."))
# Problem queued. Students must wait a specified waittime before they are allowed to submit # Problem queued. Students must wait a specified waittime before they are allowed to submit
...@@ -962,13 +962,13 @@ class CapaMixin(CapaFields): ...@@ -962,13 +962,13 @@ class CapaMixin(CapaFields):
self.runtime.track_function('problem_check', event_info) self.runtime.track_function('problem_check', event_info)
if dog_stats_api: if dog_stats_api:
dog_stats_api.increment(metric_name, [u'result:success']) dog_stats_api.increment(metric_name('checks'), [u'result:success'])
dog_stats_api.histogram( dog_stats_api.histogram(
u'{}.correct_pct'.format(metric_name), metric_name('correct_pct'),
float(published_grade['grade']) / published_grade['max_grade'], float(published_grade['grade']) / published_grade['max_grade'],
) )
dog_stats_api.histogram( dog_stats_api.histogram(
u'{}.attempts'.format(metric_name), metric_name('attempts'),
self.attempts, self.attempts,
) )
......
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 to comment