diff --git a/CHANGELOG.md b/CHANGELOG.md index eac6a85..d2f2e05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +### Fixed + +- Course videos metrics were improperly collected + ## [0.4.2] - 2022-04-06 ### Fixed diff --git a/src/dashboards/teachers/common.libsonnet b/src/dashboards/teachers/common.libsonnet index 262a2e9..5c65ae3 100644 --- a/src/dashboards/teachers/common.libsonnet +++ b/src/dashboards/teachers/common.libsonnet @@ -41,6 +41,7 @@ local common = import '../common.libsonnet'; course_key: $.queries.course_key, school_course_session: $.queries.school_course_session, }, + course_videos: 'object.id.keyword:${COURSE_VIDEOS_IDS_WITH_UUID:lucene}', downloads: '%(video_query)s AND verb.id:"%(verb_downloaded)s"' % { video_query: $.queries.video_id, verb_downloaded: common.verb_ids.downloaded, diff --git a/src/dashboards/teachers/course.jsonnet b/src/dashboards/teachers/course.jsonnet index 8aec777..9ac220a 100644 --- a/src/dashboards/teachers/course.jsonnet +++ b/src/dashboards/teachers/course.jsonnet @@ -58,7 +58,7 @@ dashboard.new( ).addTarget( elasticsearch.target( datasource=common.datasources.lrs, - query=teachers_common.queries.course_query, + query=teachers_common.queries.course_videos, metrics=[common.metrics.count], bucketAggs=[ { @@ -113,8 +113,8 @@ dashboard.new( elasticsearch.target( alias='Views', datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { + course_videos: teachers_common.queries.course_videos, verb_played: common.verb_ids.played, time: common.utils.single_escape_string(teachers_common.fields.result_extensions_time), view_count_threshold: teachers_common.constants.view_count_threshold, @@ -138,8 +138,8 @@ dashboard.new( elasticsearch.target( alias='Complete views', datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_completed)s"' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_completed)s"' % { + course_videos: teachers_common.queries.course_videos, verb_completed: common.verb_ids.completed, }, metrics=[common.metrics.count], @@ -161,8 +161,8 @@ dashboard.new( elasticsearch.target( alias='Downloads', datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_downloaded)s"' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_downloaded)s"' % { + course_videos: teachers_common.queries.course_videos, verb_downloaded: common.verb_ids.downloaded, }, metrics=[common.metrics.count], @@ -200,8 +200,8 @@ dashboard.new( ).addTarget( elasticsearch.target( datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { + course_videos: teachers_common.queries.course_videos, verb_played: common.verb_ids.played, time: common.utils.single_escape_string(teachers_common.fields.result_extensions_time), view_count_threshold: teachers_common.constants.view_count_threshold, @@ -228,8 +228,8 @@ dashboard.new( ).addTarget( elasticsearch.target( datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { + course_videos: teachers_common.queries.course_videos, verb_played: common.verb_ids.played, time: common.utils.single_escape_string(teachers_common.fields.result_extensions_time), view_count_threshold: teachers_common.constants.view_count_threshold, @@ -266,8 +266,8 @@ dashboard.new( ).addTarget( elasticsearch.target( datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { + course_videos: teachers_common.queries.course_videos, verb_played: common.verb_ids.played, time: common.utils.single_escape_string(teachers_common.fields.result_extensions_time), view_count_threshold: teachers_common.constants.view_count_threshold, @@ -305,8 +305,8 @@ dashboard.new( ).addTarget( elasticsearch.target( datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_completed)s"' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_completed)s"' % { + course_videos: teachers_common.queries.course_videos, verb_completed: common.verb_ids.completed, }, metrics=[common.metrics.count], @@ -332,8 +332,8 @@ dashboard.new( ).addTarget( elasticsearch.target( datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_completed)s"' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_completed)s"' % { + course_videos: teachers_common.queries.course_videos, verb_completed: common.verb_ids.completed, }, metrics=[common.metrics.cardinality(common.fields.actor_account_name)], @@ -368,8 +368,8 @@ dashboard.new( ).addTarget( elasticsearch.target( datasource=common.datasources.lrs, - query='(%(course_query)s) AND verb.id:"%(verb_completed)s"' % { - course_query: teachers_common.queries.course_query, + query='%(course_videos)s AND verb.id:"%(verb_completed)s"' % { + course_videos: teachers_common.queries.course_videos, verb_completed: common.verb_ids.completed, }, metrics=[common.metrics.count], @@ -525,8 +525,8 @@ dashboard.new( type: 'count', }, ], - query: '(%(course_query)s) AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { - course_query: teachers_common.queries.course_query, + query: '%(course_videos)s AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { + course_videos: teachers_common.queries.course_videos, verb_played: common.verb_ids.played, time: common.utils.single_escape_string(teachers_common.fields.result_extensions_time), view_count_threshold: teachers_common.constants.view_count_threshold, @@ -594,8 +594,8 @@ dashboard.new( ], datasource: common.datasources.lrs, metrics: [common.metrics.cardinality(common.fields.actor_account_name)], - query: '(%(course_query)s) AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { - course_query: teachers_common.queries.course_query, + query: '%(course_videos)s AND verb.id:"%(verb_played)s" AND %(time)s:[0 TO %(view_count_threshold)s]' % { + course_videos: teachers_common.queries.course_videos, verb_played: common.verb_ids.played, time: common.utils.single_escape_string(teachers_common.fields.result_extensions_time), view_count_threshold: teachers_common.constants.view_count_threshold, @@ -619,8 +619,8 @@ dashboard.new( ], datasource: common.datasources.lrs, metrics: [common.metrics.count], - query: '(%(course_query)s) AND verb.id:"%(verb_completed)s"' % { - course_query: teachers_common.queries.course_query, + query: '%(course_videos)s AND verb.id:"%(verb_completed)s"' % { + course_videos: teachers_common.queries.course_videos, verb_completed: common.verb_ids.completed, }, refId: 'Videos complete views query', @@ -642,8 +642,8 @@ dashboard.new( ], datasource: common.datasources.lrs, metrics: [common.metrics.cardinality(common.fields.actor_account_name)], - query: '(%(course_query)s) AND verb.id:"%(verb_completed)s"' % { - course_query: teachers_common.queries.course_query, + query: '%(course_videos)s AND verb.id:"%(verb_completed)s"' % { + course_videos: teachers_common.queries.course_videos, verb_completed: common.verb_ids.completed, }, refId: 'Videos complete unique views query',