From 578adcb0afa40f841e6bc7449dea0ffe0f93692f Mon Sep 17 00:00:00 2001 From: Christopher Rupley Date: Tue, 12 Nov 2024 08:04:40 -0800 Subject: [PATCH] [FAI-13039] - Add AI Copilot Evaluation dashboards and mock data (#372) * add metric value endpoint * add metric definition endpoint * tag endpoint * metric value tag endpoint * user tool endpoint * add hasura functions and mock data test writes * giant user tool usage * shrink to essential usage params with mock data test * comment * tags and metric defs * add metric values with tags * fix user tool endpoint metric definition * add value type * add deletes and fixes * user tool usage * reorder deletes * coordiante tool usage with metrics * add copilot dashboard * copilot metrics and lines of code by team * more charts * more charts and filters * include current month * add copilot impact dashboard * add pr size info * fix pr size chart * rename dashboards * layout * add survey endpoints * add delete survey endpoints * add post/delete survey functions, call delete functions * fix names * fix endpoints * first survey data * add cadence survey questions * add pr questions and refactor writeQuestions * fix survey uid and association * add surveys dashboard * add copilot tasks chart and move dashboard folder * time savings * tasks and activity charts * align filters * fix space * fix sql charts, add summary numbers, fix layout * small updates * newlines * fix import * lint * lint * pr size to 2 bars * only 2 tool users out of 3 --- .../delete_faros_metric_definition.gql | 5 + .../endpoints/delete_faros_metric_value.gql | 5 + .../delete_faros_metric_value_tag.gql | 5 + .../hasura/endpoints/delete_faros_tag.gql | 5 + .../endpoints/delete_survey_question.gql | 5 + .../delete_survey_question_response.gql | 5 + .../hasura/endpoints/delete_survey_survey.gql | 5 + ...ete_survey_survey_question_association.gql | 5 + .../hasura/endpoints/delete_vcs_user_tool.gql | 5 + .../endpoints/delete_vcs_user_tool_usage.gql | 5 + .../endpoints/faros_metric_definition.gql | 24 + .../hasura/endpoints/faros_metric_value.gql | 34 + .../endpoints/faros_metric_value_tag.gql | 34 + init/resources/hasura/endpoints/faros_tag.gql | 26 + .../hasura/endpoints/survey_question.gql | 39 + .../endpoints/survey_question_response.gql | 47 + .../hasura/endpoints/survey_survey.gql | 32 + .../survey_survey_question_association.gql | 36 + .../hasura/endpoints/vcs_pull_request.gql | 6 + .../hasura/endpoints/vcs_user_tool.gql | 47 + .../hasura/endpoints/vcs_user_tool_usage.gql | 52 + .../metabase/dashboards/copilot_impact.json | 1435 ++++++++++ .../metabase/dashboards/copilot_surveys.json | 2265 +++++++++++++++ .../metabase/dashboards/copilot_usage.json | 2456 +++++++++++++++++ mock-data/src/hasura.ts | 239 +- mock-data/src/mockdata.ts | 314 +++ 26 files changed, 7133 insertions(+), 3 deletions(-) create mode 100644 init/resources/hasura/endpoints/delete_faros_metric_definition.gql create mode 100644 init/resources/hasura/endpoints/delete_faros_metric_value.gql create mode 100644 init/resources/hasura/endpoints/delete_faros_metric_value_tag.gql create mode 100644 init/resources/hasura/endpoints/delete_faros_tag.gql create mode 100644 init/resources/hasura/endpoints/delete_survey_question.gql create mode 100644 init/resources/hasura/endpoints/delete_survey_question_response.gql create mode 100644 init/resources/hasura/endpoints/delete_survey_survey.gql create mode 100644 init/resources/hasura/endpoints/delete_survey_survey_question_association.gql create mode 100644 init/resources/hasura/endpoints/delete_vcs_user_tool.gql create mode 100644 init/resources/hasura/endpoints/delete_vcs_user_tool_usage.gql create mode 100644 init/resources/hasura/endpoints/faros_metric_definition.gql create mode 100644 init/resources/hasura/endpoints/faros_metric_value.gql create mode 100644 init/resources/hasura/endpoints/faros_metric_value_tag.gql create mode 100644 init/resources/hasura/endpoints/faros_tag.gql create mode 100644 init/resources/hasura/endpoints/survey_question.gql create mode 100644 init/resources/hasura/endpoints/survey_question_response.gql create mode 100644 init/resources/hasura/endpoints/survey_survey.gql create mode 100644 init/resources/hasura/endpoints/survey_survey_question_association.gql create mode 100644 init/resources/hasura/endpoints/vcs_user_tool.gql create mode 100644 init/resources/hasura/endpoints/vcs_user_tool_usage.gql create mode 100644 init/resources/metabase/dashboards/copilot_impact.json create mode 100644 init/resources/metabase/dashboards/copilot_surveys.json create mode 100644 init/resources/metabase/dashboards/copilot_usage.json diff --git a/init/resources/hasura/endpoints/delete_faros_metric_definition.gql b/init/resources/hasura/endpoints/delete_faros_metric_definition.gql new file mode 100644 index 00000000..d05538d0 --- /dev/null +++ b/init/resources/hasura/endpoints/delete_faros_metric_definition.gql @@ -0,0 +1,5 @@ +mutation delete_faros_metric_definition($data_origin: String) { + delete_faros_MetricDefinition(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_faros_metric_value.gql b/init/resources/hasura/endpoints/delete_faros_metric_value.gql new file mode 100644 index 00000000..daa20cc5 --- /dev/null +++ b/init/resources/hasura/endpoints/delete_faros_metric_value.gql @@ -0,0 +1,5 @@ +mutation delete_faros_metric_value($data_origin: String) { + delete_faros_MetricValue(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_faros_metric_value_tag.gql b/init/resources/hasura/endpoints/delete_faros_metric_value_tag.gql new file mode 100644 index 00000000..5f5018a4 --- /dev/null +++ b/init/resources/hasura/endpoints/delete_faros_metric_value_tag.gql @@ -0,0 +1,5 @@ +mutation delete_faros_metric_value_tag($data_origin: String) { + delete_faros_MetricValueTag(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_faros_tag.gql b/init/resources/hasura/endpoints/delete_faros_tag.gql new file mode 100644 index 00000000..a62597fc --- /dev/null +++ b/init/resources/hasura/endpoints/delete_faros_tag.gql @@ -0,0 +1,5 @@ +mutation delete_faros_tag($data_origin: String) { + delete_faros_Tag(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_survey_question.gql b/init/resources/hasura/endpoints/delete_survey_question.gql new file mode 100644 index 00000000..2f080d54 --- /dev/null +++ b/init/resources/hasura/endpoints/delete_survey_question.gql @@ -0,0 +1,5 @@ +mutation delete_survey_question($data_origin: String) { + delete_survey_Question(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_survey_question_response.gql b/init/resources/hasura/endpoints/delete_survey_question_response.gql new file mode 100644 index 00000000..6ba99980 --- /dev/null +++ b/init/resources/hasura/endpoints/delete_survey_question_response.gql @@ -0,0 +1,5 @@ +mutation delete_survey_question_response($data_origin: String) { + delete_survey_QuestionResponse(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_survey_survey.gql b/init/resources/hasura/endpoints/delete_survey_survey.gql new file mode 100644 index 00000000..36ff1334 --- /dev/null +++ b/init/resources/hasura/endpoints/delete_survey_survey.gql @@ -0,0 +1,5 @@ +mutation delete_survey_survey($data_origin: String) { + delete_survey_Survey(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_survey_survey_question_association.gql b/init/resources/hasura/endpoints/delete_survey_survey_question_association.gql new file mode 100644 index 00000000..6d16cf3c --- /dev/null +++ b/init/resources/hasura/endpoints/delete_survey_survey_question_association.gql @@ -0,0 +1,5 @@ +mutation delete_survey_survey_question_association($data_origin: String) { + delete_survey_SurveyQuestionAssociation(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_vcs_user_tool.gql b/init/resources/hasura/endpoints/delete_vcs_user_tool.gql new file mode 100644 index 00000000..9642dedd --- /dev/null +++ b/init/resources/hasura/endpoints/delete_vcs_user_tool.gql @@ -0,0 +1,5 @@ +mutation delete_vcs_user_tool($data_origin: String) { + delete_vcs_UserTool(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/delete_vcs_user_tool_usage.gql b/init/resources/hasura/endpoints/delete_vcs_user_tool_usage.gql new file mode 100644 index 00000000..df16b2e1 --- /dev/null +++ b/init/resources/hasura/endpoints/delete_vcs_user_tool_usage.gql @@ -0,0 +1,5 @@ +mutation delete_vcs_user_tool_usage($data_origin: String) { + delete_vcs_UserToolUsage(where: { origin: { _eq: $data_origin } }) { + affected_rows + } +} diff --git a/init/resources/hasura/endpoints/faros_metric_definition.gql b/init/resources/hasura/endpoints/faros_metric_definition.gql new file mode 100644 index 00000000..4fc26ca7 --- /dev/null +++ b/init/resources/hasura/endpoints/faros_metric_definition.gql @@ -0,0 +1,24 @@ +mutation insert_faros_metric_definition( + $data_uid: String! + $data_name: String! + $data_value_type: jsonb + $data_origin: String +) { + insert_faros_MetricDefinition_one( + object: { + uid: $data_uid + name: $data_name + valueType: $data_value_type + origin: $data_origin + } + on_conflict: { + constraint: faros_MetricDefinition_pkey + update_columns: [ + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/faros_metric_value.gql b/init/resources/hasura/endpoints/faros_metric_value.gql new file mode 100644 index 00000000..5c747887 --- /dev/null +++ b/init/resources/hasura/endpoints/faros_metric_value.gql @@ -0,0 +1,34 @@ +mutation insert_faros_metric_value( + $data_uid: String! + $data_computedAt: timestamptz! + $data_value: String! + $data_definition: String! + $data_origin: String +) { + insert_faros_MetricValue_one( + object: { + uid: $data_uid + computedAt: $data_computedAt + value: $data_value + faros_MetricDefinition: { + data: { + uid: $data_definition + } + on_conflict: {constraint: faros_MetricDefinition_pkey, update_columns:refreshedAt} + } + origin: $data_origin + } + on_conflict: { + constraint: faros_MetricValue_pkey + update_columns: [ + computedAt + value + definition + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/faros_metric_value_tag.gql b/init/resources/hasura/endpoints/faros_metric_value_tag.gql new file mode 100644 index 00000000..8d571aef --- /dev/null +++ b/init/resources/hasura/endpoints/faros_metric_value_tag.gql @@ -0,0 +1,34 @@ +mutation insert_faros_metric_value_tag( + $data_value_uid: String! + $data_value_definition_uid: String! + $data_tag_id: String! + $data_origin: String +) { + insert_faros_MetricValueTag_one( + object: { + faros_Tag: { + data: { + uid: $data_tag_id + } + on_conflict: {constraint: faros_Tag_pkey, update_columns: refreshedAt} + } + faros_MetricValue: { + data: { + uid: $data_value_uid + definition: $data_value_definition_uid + } + on_conflict: {constraint: faros_MetricValue_pkey, update_columns: refreshedAt} + } + origin: $data_origin + } + on_conflict: { + constraint: faros_MetricValueTag_pkey + update_columns: [ + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/faros_tag.gql b/init/resources/hasura/endpoints/faros_tag.gql new file mode 100644 index 00000000..7bd2b5d4 --- /dev/null +++ b/init/resources/hasura/endpoints/faros_tag.gql @@ -0,0 +1,26 @@ +mutation insert_faros_tag( + $data_uid: String! + $data_key: String! + $data_value: String! + $data_origin: String +) { + insert_faros_Tag_one( + object: { + uid: $data_uid + key: $data_key + value: $data_value + origin: $data_origin + } + on_conflict: { + constraint: faros_Tag_pkey + update_columns: [ + key + value + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/survey_question.gql b/init/resources/hasura/endpoints/survey_question.gql new file mode 100644 index 00000000..78dcfa46 --- /dev/null +++ b/init/resources/hasura/endpoints/survey_question.gql @@ -0,0 +1,39 @@ +mutation insert_survey_question( + $data_uid: String! + $data_question: String + $data_response_category: String + $data_response_detail: String + $data_question_category: String + $data_question_detail: String + $data_source: String! + $data_origin: String! +) { + insert_survey_Question_one( + object: { + uid: $data_uid + question: $data_question + responseType: { + category: $data_response_category + detail: $data_response_detail + } + questionCategory: { + category: $data_question_category + detail: $data_question_detail + } + source: $data_source + origin: $data_origin + } + on_conflict: { + constraint: survey_Question_pkey + update_columns: [ + question + responseType + questionCategory + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/survey_question_response.gql b/init/resources/hasura/endpoints/survey_question_response.gql new file mode 100644 index 00000000..476c17f0 --- /dev/null +++ b/init/resources/hasura/endpoints/survey_question_response.gql @@ -0,0 +1,47 @@ +mutation insert_survey_question_response( + $data_uid: String! + $data_origin: String! + $data_submitted_at: timestamptz + $data_response: String + $data_survey_uid: String + $data_survey_source: String + $data_question_uid: String + $data_question_source:String +) { + insert_survey_QuestionResponse_one( + object: { + uid: $data_uid + submittedAt: $data_submitted_at + response: $data_response + survey_SurveyQuestionAssociation: { + data: { + survey_Survey: { + data: { + uid: $data_survey_uid + source: $data_survey_source + } + on_conflict: {constraint: survey_Survey_pkey, update_columns: refreshedAt} + } + survey_Question: { + data: { + uid: $data_question_uid + source: $data_question_source + } + on_conflict: {constraint: survey_Question_pkey, update_columns: refreshedAt} + } + } + on_conflict: {constraint: survey_SurveyQuestionAssociation_pkey, update_columns: refreshedAt} + } + origin: $data_origin + } + on_conflict: { + constraint: survey_QuestionResponse_pkey + update_columns: [ + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/survey_survey.gql b/init/resources/hasura/endpoints/survey_survey.gql new file mode 100644 index 00000000..78fd9d9a --- /dev/null +++ b/init/resources/hasura/endpoints/survey_survey.gql @@ -0,0 +1,32 @@ +mutation insert_survey_survey( + $data_uid: String! + $data_name: String + $data_type_category: String + $data_type_detail: String + $data_source: String! + $data_origin: String +) { + insert_survey_Survey_one( + object: { + uid: $data_uid + name: $data_name + type: { + category: $data_type_category + detail: $data_type_detail + } + source: $data_source + origin: $data_origin + } + on_conflict: { + constraint: survey_Survey_pkey + update_columns: [ + name + type + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/survey_survey_question_association.gql b/init/resources/hasura/endpoints/survey_survey_question_association.gql new file mode 100644 index 00000000..a982a457 --- /dev/null +++ b/init/resources/hasura/endpoints/survey_survey_question_association.gql @@ -0,0 +1,36 @@ +mutation insert_survey_question( + $data_survey_uid: String! + $data_survey_source: String! + $data_question_uid: String! + $data_question_source: String! + $data_origin: String! +) { + insert_survey_SurveyQuestionAssociation_one( + object: { + survey_Survey: { + data: { + uid: $data_survey_uid + source: $data_survey_source + } + on_conflict: {constraint: survey_Survey_pkey, update_columns: refreshedAt} + } + survey_Question: { + data: { + uid: $data_question_uid + source: $data_question_source + } + on_conflict: {constraint: survey_Question_pkey, update_columns: refreshedAt} + } + origin: $data_origin + } + on_conflict: { + constraint: survey_SurveyQuestionAssociation_pkey + update_columns: [ + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/vcs_pull_request.gql b/init/resources/hasura/endpoints/vcs_pull_request.gql index 110e906c..8b9fa773 100644 --- a/init/resources/hasura/endpoints/vcs_pull_request.gql +++ b/init/resources/hasura/endpoints/vcs_pull_request.gql @@ -5,6 +5,8 @@ mutation insert_vcs_pull_request( $data_merge_commit_sha: String! $data_pull_request_create_time: timestamptz! $data_pull_request_merge_time: timestamptz! + $data_pull_request_lines_added: Int + $data_pull_request_lines_deleted: Int $data_pull_request_repository: String! $data_pull_request_organization: String! $data_pull_request_source: String! @@ -16,6 +18,10 @@ mutation insert_vcs_pull_request( state: $data_pull_request_state createdAt: $data_pull_request_create_time mergedAt: $data_pull_request_merge_time + diffStats: { + linesAdded: $data_pull_request_lines_added + linesDeleted: $data_pull_request_lines_deleted + } vcs_User: { data: { uid: $data_pull_request_author diff --git a/init/resources/hasura/endpoints/vcs_user_tool.gql b/init/resources/hasura/endpoints/vcs_user_tool.gql new file mode 100644 index 00000000..85619295 --- /dev/null +++ b/init/resources/hasura/endpoints/vcs_user_tool.gql @@ -0,0 +1,47 @@ +mutation insert_vcs_user_tool( + $data_user_uid: String! + $data_user_source: String! + $data_org_uid: String! + $data_org_source: String! + $data_tool: jsonb! + $data_inactive: Boolean! + $data_started_at: timestamptz! + $data_ended_at: timestamptz + $data_origin: String +) { + insert_vcs_UserTool_one( + object: { + vcs_User: { + data: { + uid: $data_user_uid + source: $data_user_source + } + on_conflict: {constraint: vcs_User_pkey, update_columns: refreshedAt} + } + vcs_Organization: { + data: { + uid: $data_org_uid + source: $data_org_source + } + on_conflict: {constraint: vcs_Organization_pkey, update_columns: refreshedAt} + } + tool: $data_tool + inactive: $data_inactive + startedAt: $data_started_at + endedAt: $data_ended_at + origin: $data_origin + } + on_conflict: { + constraint: vcs_UserTool_pkey + update_columns: [ + inactive + startedAt + endedAt + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/hasura/endpoints/vcs_user_tool_usage.gql b/init/resources/hasura/endpoints/vcs_user_tool_usage.gql new file mode 100644 index 00000000..0d762d41 --- /dev/null +++ b/init/resources/hasura/endpoints/vcs_user_tool_usage.gql @@ -0,0 +1,52 @@ +mutation insert_vcs_user_tool_usage( + $data_user_uid: String! + $data_user_source: String! + $data_org_uid: String! + $data_org_source: String! + $data_tool: jsonb! + $data_used_at: timestamptz! + $data_recorded_at: timestamptz + $data_origin: String +) { + insert_vcs_UserToolUsage_one( + object: { + vcs_UserTool: { + data: { + vcs_User: { + data: { + uid: $data_user_uid + source: $data_user_source + } + on_conflict: {constraint: vcs_User_pkey, update_columns: refreshedAt} + } + vcs_Organization: { + data: { + uid: $data_org_uid + source: $data_org_source + } + on_conflict: {constraint: vcs_Organization_pkey, update_columns: refreshedAt} + } + tool: $data_tool + } + on_conflict: {constraint: vcs_UserTool_pkey, update_columns: refreshedAt} + } + usedAt: $data_used_at + recordedAt: $data_recorded_at + origin: $data_origin + } + on_conflict: { + constraint: vcs_UserToolUsage_pkey + update_columns: [ + recordedAt + branch + repository + file + charactersAdded + origin + refreshedAt + ] + } + ) { + id + } +} diff --git a/init/resources/metabase/dashboards/copilot_impact.json b/init/resources/metabase/dashboards/copilot_impact.json new file mode 100644 index 00000000..7483e4f4 --- /dev/null +++ b/init/resources/metabase/dashboards/copilot_impact.json @@ -0,0 +1,1435 @@ +{ + "name": "AI Copilot Evaluation - Impact", + "cards": [ + { + "name": "Pull Request Merge Rate with Tool", + "description": null, + "display": "bar", + "table_id": {{ table "vcs_PullRequest" }}, + "dataset_query": { + "query": { + "source-table": {{ table "vcs_PullRequest" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "vcs_UserTool" }}, + "condition": [ + "=", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.user" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + "alias": "Vcs UserTool - Author" + } + ], + "expressions": { + "Tool": [ + "case", + [ + [ + [ + "and", + [ + ">", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.startedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "or", + [ + "is-null", + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "<", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + [ + "coalesce", + [ + "field", + {{ field "vcs_UserTool.toolDetail" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ], + [ + "field", + {{ field "vcs_UserTool.toolCategory" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + { + "default": "No Tool" + } + ], + "group": [ + "trim", + "" + ] + }, + "breakout": [ + [ + "expression", + "Tool" + ], + [ + "expression", + "group" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.id" }}, + null + ] + ], + { + "name": "PR Count", + "display-name": "PR Count" + } + ], + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ] + ], + { + "name": "Author Count", + "display-name": "Author Count" + } + ], + [ + "aggregation-options", + [ + "/", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.id" }}, + null + ] + ], + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ] + ] + ], + { + "name": "PRs Merged per User", + "display-name": "PRs Merged per User" + } + ] + ], + "filter": [ + "not-null", + [ + "field", + {{ field "vcs_PullRequest.mergedAt" }}, + null + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "group", + "Tool" + ], + "graph.series_order_dimension": "Tool", + "graph.series_order": [ + { + "key": "No Tool", + "color": "#88BF4D", + "enabled": true, + "name": "No Tool" + }, + { + "key": "GitHubCopilot", + "color": "#7172AD", + "enabled": true, + "name": "GitHubCopilot" + } + ], + "graph.x_axis.labels_enabled": false, + "graph.metrics": [ + "PRs Merged per User" + ] + } + }, + { + "name": "Pull Request Merge Time with Tool over Time", + "description": null, + "display": "line", + "table_id": {{ table "vcs_PullRequest" }}, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ table "vcs_PullRequest" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "vcs_UserTool" }}, + "condition": [ + "=", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.user" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + "alias": "Vcs UserTool - Author" + } + ], + "expressions": { + "Tool": [ + "case", + [ + [ + [ + "and", + [ + ">", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.startedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "or", + [ + "is-null", + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "<", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + [ + "coalesce", + [ + "field", + {{ field "vcs_UserTool.toolDetail" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ], + [ + "field", + {{ field "vcs_UserTool.toolCategory" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + { + "default": "No Tool" + } + ], + "Merge Time Hours": [ + "datetime-diff", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_PullRequest.mergedAt" }}, + null + ], + "hour" + ] + }, + "breakout": [ + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + { + "temporal-unit": "week" + } + ], + [ + "expression", + "Tool" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.id" }}, + null + ] + ], + { + "name": "PR Count", + "display-name": "PR Count" + } + ], + [ + "aggregation-options", + [ + "avg", + [ + "expression", + "Merge Time Hours" + ] + ], + { + "name": "Average Merge Time", + "display-name": "Average Merge Time" + } + ] + ], + "filter": [ + "not-null", + [ + "field", + {{ field "vcs_PullRequest.mergedAt" }}, + null + ] + ] + } + }, + "visualization_settings": { + "graph.dimensions": [ + "createdAt", + "Tool" + ], + "graph.series_order_dimension": null, + "graph.series_order": null, + "column_settings": { + "[\"name\",\"Average Merge Time\"]": { + "suffix": " h", + "decimals": 1 + } + }, + "graph.metrics": [ + "Average Merge Time" + ] + } + }, + { + "name": "Pull Request Merge Rate with Tool over Time", + "description": null, + "display": "line", + "table_id": {{ table "vcs_PullRequest" }}, + "dataset_query": { + "query": { + "source-table": {{ table "vcs_PullRequest" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "vcs_UserTool" }}, + "condition": [ + "=", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.user" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + "alias": "Vcs UserTool - Author" + } + ], + "expressions": { + "Tool": [ + "case", + [ + [ + [ + "and", + [ + ">", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.startedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "or", + [ + "is-null", + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "<", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + [ + "coalesce", + [ + "field", + {{ field "vcs_UserTool.toolDetail" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ], + [ + "field", + {{ field "vcs_UserTool.toolCategory" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + { + "default": "No Tool" + } + ] + }, + "breakout": [ + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + { + "temporal-unit": "week" + } + ], + [ + "expression", + "Tool" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.id" }}, + null + ] + ], + { + "name": "PR Count", + "display-name": "PR Count" + } + ], + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ] + ], + { + "name": "Author Count", + "display-name": "Author Count" + } + ], + [ + "aggregation-options", + [ + "/", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.id" }}, + null + ] + ], + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ] + ] + ], + { + "name": "PRs Merged per User", + "display-name": "PRs Merged per User" + } + ] + ], + "filter": [ + "not-null", + [ + "field", + {{ field "vcs_PullRequest.mergedAt" }}, + null + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "createdAt", + "Tool" + ], + "graph.series_order_dimension": null, + "graph.series_order": null, + "graph.metrics": [ + "PRs Merged per User" + ] + } + }, + { + "name": "Pull Request Merge Time with Tool", + "description": null, + "display": "bar", + "table_id": {{ table "vcs_PullRequest" }}, + "dataset_query": { + "query": { + "source-table": {{ table "vcs_PullRequest" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "vcs_UserTool" }}, + "condition": [ + "=", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.user" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + "alias": "Vcs UserTool - Author" + } + ], + "expressions": { + "Tool": [ + "case", + [ + [ + [ + "and", + [ + ">", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.startedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "or", + [ + "is-null", + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "<", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + [ + "coalesce", + [ + "field", + {{ field "vcs_UserTool.toolDetail" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ], + [ + "field", + {{ field "vcs_UserTool.toolCategory" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + { + "default": "No Tool" + } + ], + "Merge Time Hours": [ + "datetime-diff", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_PullRequest.mergedAt" }}, + null + ], + "hour" + ], + "group": [ + "trim", + "" + ] + }, + "breakout": [ + [ + "expression", + "Tool" + ], + [ + "expression", + "group" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.id" }}, + null + ] + ], + { + "name": "PR Count", + "display-name": "PR Count" + } + ], + [ + "aggregation-options", + [ + "avg", + [ + "expression", + "Merge Time Hours" + ] + ], + { + "name": "Average Merge Time", + "display-name": "Average Merge Time" + } + ] + ], + "filter": [ + "not-null", + [ + "field", + {{ field "vcs_PullRequest.mergedAt" }}, + null + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "group", + "Tool" + ], + "graph.series_order_dimension": "Tool", + "graph.series_order": [ + { + "key": "No Tool", + "color": "#88BF4D", + "enabled": true, + "name": "No Tool" + }, + { + "key": "GitHubCopilot", + "color": "#7172AD", + "enabled": true, + "name": "GitHubCopilot" + } + ], + "graph.x_axis.labels_enabled": false, + "column_settings": { + "[\"name\",\"Average Merge Time\"]": { + "suffix": " h", + "decimals": 1 + } + }, + "graph.metrics": [ + "Average Merge Time" + ] + } + }, + { + "name": "Pull Request Size with Tool over Time", + "description": null, + "display": "line", + "table_id": {{ table "vcs_PullRequest" }}, + "dataset_query": { + "query": { + "source-table": {{ table "vcs_PullRequest" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "vcs_UserTool" }}, + "condition": [ + "=", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.user" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + "alias": "Vcs UserTool - Author" + } + ], + "expressions": { + "Tool": [ + "case", + [ + [ + [ + "and", + [ + ">", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.startedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "or", + [ + "is-null", + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "<", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + [ + "coalesce", + [ + "field", + {{ field "vcs_UserTool.toolDetail" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ], + [ + "field", + {{ field "vcs_UserTool.toolCategory" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + { + "default": "No Tool" + } + ] + }, + "breakout": [ + [ + "expression", + "Tool" + ], + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + { + "temporal-unit": "week" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.id" }}, + null + ] + ], + { + "name": "PR Count", + "display-name": "PR Count" + } + ], + [ + "aggregation-options", + [ + "median", + [ + "field", + {{ field "vcs_PullRequest.linesAdded" }}, + null + ] + ], + { + "name": "Median Lines Added", + "display-name": "Median Lines Added" + } + ], + [ + "aggregation-options", + [ + "median", + [ + "field", + {{ field "vcs_PullRequest.linesDeleted" }}, + null + ] + ], + { + "name": "Median Lines Deleted", + "display-name": "Median Lines Deleted" + } + ], + [ + "aggregation-options", + [ + "-", + [ + "median", + [ + "field", + {{ field "vcs_PullRequest.linesAdded" }}, + null + ] + ], + [ + "median", + [ + "field", + {{ field "vcs_PullRequest.linesDeleted" }}, + null + ] + ] + ], + { + "name": "Net Lines Added", + "display-name": "Net Lines Added" + } + ] + ], + "filter": [ + "not-null", + [ + "field", + {{ field "vcs_PullRequest.mergedAt" }}, + null + ] + ], + "order-by": [ + [ + "desc", + [ + "expression", + "Tool" + ] + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.x_axis.labels_enabled": false, + "graph.series_order": null, + "graph.series_order_dimension": null, + "graph.dimensions": [ + "createdAt", + "Tool" + ], + "series_settings": { + "Median Lines Deleted": { + "color": "#EF8C8C" + } + }, + "graph.metrics": [ + "Net Lines Added" + ] + } + }, + { + "name": "Pull Request Size with Tool", + "description": null, + "display": "bar", + "table_id": {{ table "vcs_PullRequest" }}, + "dataset_query": { + "query": { + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_PullRequest.id" }}, + null + ] + ], + { + "display-name": "PR Count", + "name": "PR Count" + } + ], + [ + "aggregation-options", + [ + "median", + [ + "field", + {{ field "vcs_PullRequest.linesAdded" }}, + null + ] + ], + { + "display-name": "Median Lines Added", + "name": "Median Lines Added" + } + ], + [ + "aggregation-options", + [ + "median", + [ + "field", + {{ field "vcs_PullRequest.linesDeleted" }}, + null + ] + ], + { + "display-name": "Median Lines Deleted", + "name": "Median Lines Deleted" + } + ], + [ + "aggregation-options", + [ + "-", + [ + "median", + [ + "field", + {{ field "vcs_PullRequest.linesAdded" }}, + null + ] + ], + [ + "median", + [ + "field", + {{ field "vcs_PullRequest.linesDeleted" }}, + null + ] + ] + ], + { + "display-name": "Net Lines Added", + "name": "Net Lines Added" + } + ] + ], + "breakout": [ + [ + "expression", + "Tool" + ], + [ + "expression", + "group" + ] + ], + "expressions": { + "Tool": [ + "case", + [ + [ + [ + "and", + [ + ">", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.startedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "or", + [ + "is-null", + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + [ + "<", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.endedAt" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + [ + "coalesce", + [ + "field", + {{ field "vcs_UserTool.toolDetail" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ], + [ + "field", + {{ field "vcs_UserTool.toolCategory" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ] + ] + ], + { + "default": "No Tool" + } + ], + "group": [ + "trim", + "" + ] + }, + "filter": [ + "not-null", + [ + "field", + {{ field "vcs_PullRequest.mergedAt" }}, + null + ] + ], + "joins": [ + { + "alias": "Vcs UserTool - Author", + "condition": [ + "=", + [ + "field", + {{ field "vcs_PullRequest.author" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.user" }}, + { + "join-alias": "Vcs UserTool - Author" + } + ] + ], + "fields": "all", + "source-table": {{ table "vcs_UserTool" }} + } + ], + "order-by": [ + [ + "desc", + [ + "expression", + "Tool" + ] + ] + ], + "source-table": {{ table "vcs_PullRequest" }} + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "group", + "Tool" + ], + "graph.series_order": null, + "graph.series_order_dimension": null, + "graph.x_axis.labels_enabled": false, + "series_settings": { + "Median Lines Added": { + "axis": "left" + }, + "Median Lines Deleted": { + "axis": "left", + "color": "#EF8C8C" + }, + "Net Lines Added": { + "axis": "left" + } + }, + "graph.metrics": [ + "Net Lines Added" + ] + } + } + ], + "parameters": [ + { + "name": "Date", + "slug": "date", + "id": "f8b47360", + "type": "date/all-options", + "sectionId": "date", + "default": "past3months~" + } + ], + "layout": [ + { + "row": 0, + "col": 0, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Pull Request Merge Rate with Tool" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "f8b47360", + "card_id": {{ card "Pull Request Merge Rate with Tool" }}, + "target": [ + "dimension", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 4, + "col": 5, + "sizeX": 10, + "sizeY": 4, + "card_id": {{ card "Pull Request Merge Time with Tool over Time" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "f8b47360", + "card_id": {{ card "Pull Request Merge Time with Tool over Time" }}, + "target": [ + "dimension", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 0, + "col": 5, + "sizeX": 10, + "sizeY": 4, + "card_id": {{ card "Pull Request Merge Rate with Tool over Time" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "f8b47360", + "card_id": {{ card "Pull Request Merge Rate with Tool over Time" }}, + "target": [ + "dimension", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 4, + "col": 0, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Pull Request Merge Time with Tool" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "f8b47360", + "card_id": {{ card "Pull Request Merge Time with Tool" }}, + "target": [ + "dimension", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 8, + "col": 5, + "sizeX": 10, + "sizeY": 4, + "card_id": {{ card "Pull Request Size with Tool over Time" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "f8b47360", + "card_id": {{ card "Pull Request Size with Tool over Time" }}, + "target": [ + "dimension", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 8, + "col": 0, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Pull Request Size with Tool" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "f8b47360", + "card_id": {{ card "Pull Request Size with Tool" }}, + "target": [ + "dimension", + [ + "field", + {{ field "vcs_PullRequest.createdAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + } + ], + "path": "/Faros CE/AI Copilot Evaluation" +} + diff --git a/init/resources/metabase/dashboards/copilot_surveys.json b/init/resources/metabase/dashboards/copilot_surveys.json new file mode 100644 index 00000000..9c17a911 --- /dev/null +++ b/init/resources/metabase/dashboards/copilot_surveys.json @@ -0,0 +1,2265 @@ +{ + "name": "AI Copilot Evaluation - Surveys", + "cards": [ + { + "name": "AI Transformation Surveys", + "description": null, + "display": "table", + "table_id": {{ table "survey_Survey" }}, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ table "survey_Survey" }}, + "filter": [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + null + ], + "AI Transformation" + ], + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_Survey.id" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation" + }, + { + "fields": "all", + "source-table": {{ table "survey_Question" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ], + [ + "field", + {{ field "survey_Question.id" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "alias": "Survey Question - Question" + }, + { + "fields": "all", + "source-table": {{ table "survey_QuestionResponse" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.id" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ], + [ + "field", + {{ field "survey_QuestionResponse.surveyQuestion" }}, + { + "join-alias": "Survey QuestionResponse" + } + ] + ], + "alias": "Survey QuestionResponse" + } + ], + "breakout": [ + [ + "field", + {{ field "survey_Survey.id" }}, + null + ], + [ + "field", + {{ field "survey_Survey.name" }}, + null + ], + [ + "field", + {{ field "survey_Survey.startedAt" }}, + { + "temporal-unit": "minute" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ] + ], + { + "name": "Question Count", + "display-name": "Question Count" + } + ], + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "survey_QuestionResponse.id" }}, + { + "join-alias": "Survey QuestionResponse" + } + ] + ], + { + "name": "Response Count", + "display-name": "Response Count" + } + ] + ] + } + }, + "visualization_settings": { + "table.pivot_column": "startedAt", + "table.cell_column": "Question Count" + } + }, + { + "name": "Survey Responses over Time", + "description": null, + "display": "line", + "table_id": {{ table "survey_QuestionResponse" }}, + "dataset_query": { + "query": { + "source-table": {{ table "survey_QuestionResponse" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.surveyQuestion" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.id" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + }, + { + "fields": "all", + "source-table": {{ table "survey_Survey" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Survey.id" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ], + "alias": "Survey Survey - Survey" + }, + { + "fields": "all", + "source-table": {{ table "survey_Question" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Question.id" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "alias": "Survey Question - Question" + } + ], + "filter": [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + { + "join-alias": "Survey Survey - Survey" + } + ], + "AI Transformation" + ], + "breakout": [ + [ + "field", + {{ field "survey_QuestionResponse.submittedAt" }}, + { + "temporal-unit": "week" + } + ] + ], + "aggregation": [ + [ + "count" + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "table.pivot_column": "origin", + "table.cell_column": "order", + "graph.dimensions": [ + "submittedAt" + ], + "graph.metrics": [ + "count" + ] + } + }, + { + "name": "Copilot helps me to:", + "description": null, + "display": "row", + "table_id": {{ table "survey_QuestionResponse" }}, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ table "survey_QuestionResponse" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.surveyQuestion" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.id" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + }, + { + "fields": "all", + "source-table": {{ table "survey_Question" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Question.id" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "alias": "Survey Question - Question" + }, + { + "fields": "all", + "source-table": {{ table "survey_Survey" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Survey.id" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ], + "alias": "Survey Survey - Survey" + } + ], + "expressions": { + "Activity": [ + "regex-match-first", + [ + "field", + {{ field "survey_Question.question" }}, + { + "join-alias": "Survey Question - Question" + } + ], + "\\(optional\\) Copilot helps me to: \\[(.+)\\]" + ] + }, + "breakout": [ + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + [ + "field", + {{ field "survey_Question.question" }}, + { + "join-alias": "Survey Question - Question" + } + ], + [ + "expression", + "Activity" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "count" + ], + { + "name": "Response Count", + "display-name": "Response Count" + } + ] + ], + "filter": [ + "and", + [ + "not-empty", + [ + "expression", + "Activity" + ] + ], + [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + { + "join-alias": "Survey Survey - Survey" + } + ], + "AI Transformation" + ] + ], + "order-by": [ + [ + "asc", + [ + "expression", + "Activity" + ] + ] + ] + } + }, + "visualization_settings": { + "graph.y_axis.title_text": "Response Count", + "table.cell_column": "question", + "graph.series_order_dimension": "response", + "graph.x_axis.title_text": "Activity", + "graph.metrics": [ + "Response Count" + ], + "graph.series_order": [ + { + "key": "Strongly Disagree", + "color": "#E75454", + "enabled": true, + "name": "Strongly Disagree" + }, + { + "key": "Disagree", + "color": "#EF8C8C", + "enabled": true, + "name": "Disagree" + }, + { + "key": "Neutral", + "color": "#F9D45C", + "enabled": true, + "name": "Neutral" + }, + { + "key": "Agree", + "color": "#A7D07C", + "enabled": true, + "name": "Agree" + }, + { + "key": "Strongly Agree", + "color": "#689636", + "enabled": true, + "name": "Strongly Agree" + } + ], + "table.pivot_column": "Task Type", + "series_settings": { + "Strongly Agree": { + "color": "#689636" + }, + "Agree": { + "color": "#A7D07C" + }, + "Strongly Disagree": { + "color": "#E75454" + }, + "Disagree": { + "color": "#EF8C8C" + }, + "Neutral": { + "color": "#F9D45C" + } + }, + "graph.dimensions": [ + "Activity", + "response" + ], + "stackable.stack_type": "stacked" + } + }, + { + "name": "Cumulative Time Savings", + "description": null, + "display": "line", + "table_id": null, + "dataset_query": { + "type": "native", + "native": { + "query": "SELECT\n (\n CAST(\n date_trunc(\n 'week',\n (\n \"public\".\"survey_QuestionResponse\".\"submittedAt\" + (INTERVAL '1 day')\n )\n ) AS timestamp\n ) + (INTERVAL '-1 day')\n ) AS \"Submitted At\",\n sum(\n CASE\n WHEN \"Survey Question - Question\".\"question\" = 'Based on your experience, estimate how much total coding time you saved using copilot for this PR? (in minutes)' THEN (\n \"public\".\"survey_QuestionResponse\".\"response\" :: float\n ) / 60\n WHEN \"Survey Question - Question\".\"question\" = 'On average how many hours per day did you save in the past week?' THEN (\n \"public\".\"survey_QuestionResponse\".\"response\" :: float\n ) * 5\n END\n ) AS \"Time Saved hours\",\n sum(\n sum(\n CASE\n WHEN \"Survey Question - Question\".\"question\" = 'Based on your experience, estimate how much total coding time you saved using copilot for this PR? (in minutes)' THEN (\n \"public\".\"survey_QuestionResponse\".\"response\" :: float\n ) / 60\n WHEN \"Survey Question - Question\".\"question\" = 'On average how many hours per day did you save in the past week?' THEN (\n \"public\".\"survey_QuestionResponse\".\"response\" :: float\n ) * 5\n END\n )\n ) OVER (\n ORDER BY\n (\n CAST(\n date_trunc(\n 'week',\n (\n \"public\".\"survey_QuestionResponse\".\"submittedAt\" + (INTERVAL '1 day')\n )\n ) AS timestamp\n ) + (INTERVAL '-1 day')\n )\n ) AS \"Cumulative Time Saved hours\"\nFROM\n \"public\".\"survey_QuestionResponse\"\n LEFT JOIN \"public\".\"survey_SurveyQuestionAssociation\" \"Survey SurveyQuestionAssociation - SurveyQuestion\" ON \"public\".\"survey_QuestionResponse\".\"surveyQuestion\" = \"Survey SurveyQuestionAssociation - SurveyQuestion\".\"id\"\n LEFT JOIN \"public\".\"survey_Question\" \"Survey Question - Question\" ON \"Survey SurveyQuestionAssociation - SurveyQuestion\".\"question\" = \"Survey Question - Question\".\"id\"\n LEFT JOIN \"public\".\"survey_Survey\" \"Survey Survey - Survey\" ON \"Survey SurveyQuestionAssociation - SurveyQuestion\".\"survey\" = \"Survey Survey - Survey\".\"id\"\nWHERE\n (\n \"Survey Question - Question\".\"responseTypeCategory\" = 'CodingAssistants'\n AND (\n \"Survey Question - Question\".\"question\" = 'Based on your experience, estimate how much total coding time you saved using copilot for this PR? (in minutes)'\n OR \"Survey Question - Question\".\"question\" = 'On average how many hours per day did you save in the past week?'\n ) [[AND \"Survey Survey - Survey\".\"name\" = <>]]\n )\nGROUP BY\n (\n CAST(\n date_trunc(\n 'week',\n (\n \"public\".\"survey_QuestionResponse\".\"submittedAt\" + (INTERVAL '1 day')\n )\n ) AS timestamp\n ) + (INTERVAL '-1 day')\n )\nORDER BY\n (\n CAST(\n date_trunc(\n 'week',\n (\n \"public\".\"survey_QuestionResponse\".\"submittedAt\" + (INTERVAL '1 day')\n )\n ) AS timestamp\n ) + (INTERVAL '-1 day')\n ) ASC", + "template-tags": { + "survey_name": { + "id": "3f790505-ef25-cfdc-1f83-096409adca5d", + "name": "survey_name", + "display-name": "Survey name", + "type": "text" + } + } + } + }, + "visualization_settings": { + "graph.show_trendline": true, + "graph.y_axis.title_text": "Total Time Saved", + "graph.show_values": true, + "table.cell_column": "question", + "graph.series_order_dimension": "response", + "graph.x_axis.title_text": "Response Submitted At", + "graph.metrics": [ + "Cumulative Time Saved hours" + ], + "graph.series_order": [ + { + "key": "Strongly Disagree", + "color": "#E75454", + "enabled": true, + "name": "Strongly Disagree" + }, + { + "key": "Disagree", + "color": "#EF8C8C", + "enabled": true, + "name": "Disagree" + }, + { + "key": "Neutral", + "color": "#F9D45C", + "enabled": true, + "name": "Neutral" + }, + { + "key": "Agree", + "color": "#A7D07C", + "enabled": true, + "name": "Agree" + }, + { + "key": "Strongly Agree", + "color": "#689636", + "enabled": true, + "name": "Strongly Agree" + } + ], + "table.pivot_column": "Task Type", + "column_settings": { + "[\"name\",\"Cumulative Time Saved hours\"]": { + "prefix": "", + "suffix": " h", + "decimals": 0 + }, + "[\"name\",\"Time Saved hours\"]": { + "suffix": " h", + "decimals": 0 + } + }, + "series_settings": { + "Strongly Agree": { + "color": "#689636" + }, + "Agree": { + "color": "#A7D07C" + }, + "Strongly Disagree": { + "color": "#E75454" + }, + "Disagree": { + "color": "#EF8C8C" + }, + "Neutral": { + "color": "#F9D45C" + } + }, + "graph.dimensions": [ + "Submitted At" + ], + "stackable.stack_type": "stacked" + } + }, + { + "name": "Copilot helped me with the following tasks", + "description": null, + "display": "row", + "table_id": {{ table "survey_QuestionResponse" }}, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ table "survey_QuestionResponse" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.surveyQuestion" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.id" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + }, + { + "fields": "all", + "source-table": {{ table "survey_Question" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Question.id" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "alias": "Survey Question - Question" + }, + { + "fields": "all", + "source-table": {{ table "survey_Survey" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Survey.id" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ], + "alias": "Survey Survey - Survey" + } + ], + "expressions": { + "Task Type": [ + "regex-match-first", + [ + "field", + {{ field "survey_Question.question" }}, + { + "join-alias": "Survey Question - Question" + } + ], + "In the past week, Copilot helped me with the following tasks: \\[(.+)\\]" + ] + }, + "breakout": [ + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + [ + "field", + {{ field "survey_Question.question" }}, + { + "join-alias": "Survey Question - Question" + } + ], + [ + "expression", + "Task Type" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "count" + ], + { + "name": "Response Count", + "display-name": "Response Count" + } + ] + ], + "filter": [ + "and", + [ + "not-empty", + [ + "expression", + "Task Type" + ] + ], + [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + { + "join-alias": "Survey Survey - Survey" + } + ], + "AI Transformation" + ] + ], + "order-by": [ + [ + "asc", + [ + "expression", + "Task Type" + ] + ] + ] + } + }, + "visualization_settings": { + "graph.y_axis.title_text": "Response Count", + "table.cell_column": "question", + "graph.series_order_dimension": "response", + "graph.x_axis.title_text": "Tasks", + "graph.metrics": [ + "Response Count" + ], + "graph.series_order": [ + { + "key": "Strongly Disagree", + "color": "#E75454", + "enabled": true, + "name": "Strongly Disagree" + }, + { + "key": "Disagree", + "color": "#EF8C8C", + "enabled": true, + "name": "Disagree" + }, + { + "key": "Neutral", + "color": "#F9D45C", + "enabled": true, + "name": "Neutral" + }, + { + "key": "Agree", + "color": "#A7D07C", + "enabled": true, + "name": "Agree" + }, + { + "key": "Strongly Agree", + "color": "#689636", + "enabled": true, + "name": "Strongly Agree" + } + ], + "table.pivot_column": "Task Type", + "series_settings": { + "Strongly Agree": { + "color": "#689636" + }, + "Agree": { + "color": "#A7D07C" + }, + "Strongly Disagree": { + "color": "#E75454" + }, + "Disagree": { + "color": "#EF8C8C" + }, + "Neutral": { + "color": "#F9D45C" + } + }, + "graph.dimensions": [ + "Task Type", + "response" + ], + "stackable.stack_type": "stacked" + } + }, + { + "name": "Number of Surveys", + "description": null, + "display": "scalar", + "table_id": {{ table "survey_Survey" }}, + "dataset_query": { + "query": { + "source-table": {{ table "survey_Survey" }}, + "filter": [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + null + ], + "AI Transformation" + ], + "aggregation": [ + [ + "count" + ] + ] + }, + "type": "query" + }, + "visualization_settings": {} + }, + { + "name": "Number of Questions Asked", + "description": null, + "display": "scalar", + "table_id": {{ table "survey_Question" }}, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ table "survey_Question" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_Question.id" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation" + }, + { + "fields": "all", + "source-table": {{ table "survey_Survey" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ], + [ + "field", + {{ field "survey_Survey.id" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ], + "alias": "Survey Survey - Survey" + } + ], + "filter": [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + { + "join-alias": "Survey Survey - Survey" + } + ], + "AI Transformation" + ], + "aggregation": [ + [ + "count" + ] + ] + } + }, + "visualization_settings": {} + }, + { + "name": "Survey Response Count", + "description": null, + "display": "scalar", + "table_id": {{ table "survey_QuestionResponse" }}, + "dataset_query": { + "query": { + "source-table": {{ table "survey_QuestionResponse" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.surveyQuestion" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.id" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + }, + { + "fields": "all", + "source-table": {{ table "survey_Survey" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Survey.id" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ], + "alias": "Survey Survey - Survey" + }, + { + "fields": "all", + "source-table": {{ table "survey_Question" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Question.id" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "alias": "Survey Question - Question" + } + ], + "filter": [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + { + "join-alias": "Survey Survey - Survey" + } + ], + "AI Transformation" + ], + "aggregation": [ + [ + "count" + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "table.pivot_column": "origin", + "table.cell_column": "order", + "graph.dimensions": [ + "submittedAt" + ], + "graph.metrics": [ + "count" + ] + } + }, + { + "name": "Survey Questions", + "description": null, + "display": "table", + "table_id": {{ table "survey_Survey" }}, + "dataset_query": { + "query": { + "source-table": {{ table "survey_Survey" }}, + "filter": [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + null + ], + "AI Transformation" + ], + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_Survey.id" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation" + }, + { + "fields": "all", + "source-table": {{ table "survey_Question" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ], + [ + "field", + {{ field "survey_Question.id" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "alias": "Survey Question - Question" + }, + { + "fields": "all", + "source-table": {{ table "survey_QuestionResponse" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.id" }}, + { + "join-alias": "Survey SurveyQuestionAssociation" + } + ], + [ + "field", + {{ field "survey_QuestionResponse.surveyQuestion" }}, + { + "join-alias": "Survey QuestionResponse" + } + ] + ], + "alias": "Survey QuestionResponse" + } + ], + "breakout": [ + [ + "field", + {{ field "survey_Survey.name" }}, + null + ], + [ + "field", + {{ field "survey_Question.question" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "survey_QuestionResponse.id" }}, + { + "join-alias": "Survey QuestionResponse" + } + ] + ], + { + "name": "Response Count", + "display-name": "Response Count" + } + ], + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + { + "join-alias": "Survey QuestionResponse" + } + ] + ], + { + "name": "Unique Responses", + "display-name": "Unique Responses" + } + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "table.pivot_column": "startedAt", + "table.cell_column": "Question Count", + "pivot_table.column_split": { + "rows": [ + [ + "field", + {{ field "survey_Survey.name" }}, + null + ], + [ + "field", + {{ field "survey_Question.question" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "columns": [], + "values": [ + [ + "aggregation", + 0 + ], + [ + "aggregation", + 1 + ] + ] + }, + "column_settings": { + "[\"ref\",[\"field\",{{ field "survey_Survey.name" }},null]]": { + "pivot_table.column_show_totals": false, + "column_title": "Survey Name" + }, + "[\"ref\",[\"field\",{{ field "survey_Question.question" }},null]]": { + "column_title": "Question" + } + } + } + }, + { + "name": "Net Promoter Score - Tasks", + "description": "Net Promoter Score is the difference between \"Agree\" responses and \"Disagree\" responses as a percentage of total responses.", + "display": "table", + "table_id": {{ table "survey_QuestionResponse" }}, + "dataset_query": { + "query": { + "source-table": {{ table "survey_QuestionResponse" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.surveyQuestion" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.id" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + }, + { + "fields": "all", + "source-table": {{ table "survey_Question" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Question.id" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "alias": "Survey Question - Question" + }, + { + "fields": "all", + "source-table": {{ table "survey_Survey" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Survey.id" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ], + "alias": "Survey Survey - Survey" + } + ], + "expressions": { + "Task Type": [ + "regex-match-first", + [ + "field", + {{ field "survey_Question.question" }}, + { + "join-alias": "Survey Question - Question" + } + ], + "In the past week, Copilot helped me with the following tasks: \\[(.+)\\]" + ] + }, + "breakout": [ + [ + "expression", + "Task Type" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "/", + [ + "-", + [ + "count-where", + [ + "or", + [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + "Strongly Agree" + ], + [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + "Agree" + ] + ] + ], + [ + "count-where", + [ + "or", + [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + "Strongly Disagree" + ], + [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + "Disagree" + ] + ] + ] + ], + [ + "count" + ] + ], + { + "name": "Net Promtoer Score", + "display-name": "Net Promtoer Score" + } + ] + ], + "filter": [ + "and", + [ + "not-empty", + [ + "expression", + "Task Type" + ] + ], + [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + { + "join-alias": "Survey Survey - Survey" + } + ], + "AI Transformation" + ] + ], + "order-by": [ + [ + "asc", + [ + "expression", + "Task Type" + ] + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.y_axis.title_text": "Net Promoter Score", + "table.cell_column": "question", + "graph.series_order_dimension": "response", + "graph.x_axis.title_text": "Tasks", + "graph.metrics": [ + "Net Promtoer Score" + ], + "graph.series_order": [ + { + "key": "Strongly Disagree", + "color": "#E75454", + "enabled": true, + "name": "Strongly Disagree" + }, + { + "key": "Disagree", + "color": "#EF8C8C", + "enabled": true, + "name": "Disagree" + }, + { + "key": "Neutral", + "color": "#F9D45C", + "enabled": true, + "name": "Neutral" + }, + { + "key": "Agree", + "color": "#A7D07C", + "enabled": true, + "name": "Agree" + }, + { + "key": "Strongly Agree", + "color": "#689636", + "enabled": true, + "name": "Strongly Agree" + } + ], + "table.pivot_column": "Task Type", + "column_settings": { + "[\"name\",\"Net Promtoer Score\"]": { + "number_style": "percent", + "decimals": 1, + "show_mini_bar": true + } + }, + "series_settings": { + "Strongly Agree": { + "color": "#689636" + }, + "Agree": { + "color": "#A7D07C" + }, + "Strongly Disagree": { + "color": "#E75454" + }, + "Disagree": { + "color": "#EF8C8C" + }, + "Neutral": { + "color": "#F9D45C" + } + }, + "graph.dimensions": [ + "Task Type" + ], + "stackable.stack_type": "stacked" + } + }, + { + "name": "Net Promoter Score - Activity", + "description": "Net Promoter Score is the difference between \"Agree\" responses and \"Disagree\" responses as a percentage of total responses.", + "display": "table", + "table_id": {{ table "survey_QuestionResponse" }}, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ table "survey_QuestionResponse" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "survey_SurveyQuestionAssociation" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.surveyQuestion" }}, + null + ], + [ + "field", + {{ field "survey_SurveyQuestionAssociation.id" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ] + ], + "alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + }, + { + "fields": "all", + "source-table": {{ table "survey_Question" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.question" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Question.id" }}, + { + "join-alias": "Survey Question - Question" + } + ] + ], + "alias": "Survey Question - Question" + }, + { + "fields": "all", + "source-table": {{ table "survey_Survey" }}, + "condition": [ + "=", + [ + "field", + {{ field "survey_SurveyQuestionAssociation.survey" }}, + { + "join-alias": "Survey SurveyQuestionAssociation - SurveyQuestion" + } + ], + [ + "field", + {{ field "survey_Survey.id" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ], + "alias": "Survey Survey - Survey" + } + ], + "expressions": { + "Activity": [ + "regex-match-first", + [ + "field", + {{ field "survey_Question.question" }}, + { + "join-alias": "Survey Question - Question" + } + ], + "\\(optional\\) Copilot helps me to: \\[(.+)\\]" + ] + }, + "breakout": [ + [ + "expression", + "Activity" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "/", + [ + "-", + [ + "count-where", + [ + "or", + [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + "Strongly Agree" + ], + [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + "Agree" + ] + ] + ], + [ + "count-where", + [ + "or", + [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + "Strongly Disagree" + ], + [ + "=", + [ + "field", + {{ field "survey_QuestionResponse.response" }}, + null + ], + "Disagree" + ] + ] + ] + ], + [ + "count" + ] + ], + { + "name": "Net Promoter Score", + "display-name": "Net Promoter Score" + } + ] + ], + "filter": [ + "and", + [ + "not-empty", + [ + "expression", + "Activity" + ] + ], + [ + "=", + [ + "field", + {{ field "survey_Survey.typeDetail" }}, + { + "join-alias": "Survey Survey - Survey" + } + ], + "AI Transformation" + ] + ], + "order-by": [ + [ + "asc", + [ + "expression", + "Activity" + ] + ] + ] + } + }, + "visualization_settings": { + "graph.y_axis.title_text": "Response Count", + "table.cell_column": "question", + "graph.series_order_dimension": "response", + "graph.x_axis.title_text": "Activity", + "graph.metrics": [ + "Response Count", + "Net Promoter Score" + ], + "table.column_formatting": [], + "graph.series_order": [ + { + "key": "Strongly Disagree", + "color": "#E75454", + "enabled": true, + "name": "Strongly Disagree" + }, + { + "key": "Disagree", + "color": "#EF8C8C", + "enabled": true, + "name": "Disagree" + }, + { + "key": "Neutral", + "color": "#F9D45C", + "enabled": true, + "name": "Neutral" + }, + { + "key": "Agree", + "color": "#A7D07C", + "enabled": true, + "name": "Agree" + }, + { + "key": "Strongly Agree", + "color": "#689636", + "enabled": true, + "name": "Strongly Agree" + } + ], + "table.pivot_column": "Task Type", + "column_settings": { + "[\"name\",\"Net Promoter Score\"]": { + "show_mini_bar": true, + "number_style": "percent", + "decimals": 1 + } + }, + "series_settings": { + "Strongly Agree": { + "color": "#689636" + }, + "Agree": { + "color": "#A7D07C" + }, + "Strongly Disagree": { + "color": "#E75454" + }, + "Disagree": { + "color": "#EF8C8C" + }, + "Neutral": { + "color": "#F9D45C" + } + }, + "graph.dimensions": [ + "Activity", + "response" + ], + "stackable.stack_type": "stacked" + } + }, + { + "name": "Total Time Saved (hours)", + "description": null, + "display": "scalar", + "table_id": null, + "dataset_query": { + "type": "native", + "native": { + "query": "SELECT\n sum(\n CASE\n WHEN \"Survey Question - Question\".\"question\" = 'Based on your experience, estimate how much total coding time you saved using copilot for this PR? (in minutes)' THEN (\n \"public\".\"survey_QuestionResponse\".\"response\" :: float\n ) / 60\n WHEN \"Survey Question - Question\".\"question\" = 'On average how many hours per day did you save in the past week?' THEN (\n \"public\".\"survey_QuestionResponse\".\"response\" :: float\n ) * 5\n END\n ) AS \"Total Time Saved\"\nFROM\n \"public\".\"survey_QuestionResponse\"\n LEFT JOIN \"public\".\"survey_SurveyQuestionAssociation\" \"Survey SurveyQuestionAssociation - SurveyQuestion\" ON \"public\".\"survey_QuestionResponse\".\"surveyQuestion\" = \"Survey SurveyQuestionAssociation - SurveyQuestion\".\"id\"\n LEFT JOIN \"public\".\"survey_Survey\" \"Survey Survey - Survey\" ON \"Survey SurveyQuestionAssociation - SurveyQuestion\".\"survey\" = \"Survey Survey - Survey\".\"id\"\n LEFT JOIN \"public\".\"survey_Question\" \"Survey Question - Question\" ON \"Survey SurveyQuestionAssociation - SurveyQuestion\".\"question\" = \"Survey Question - Question\".\"id\"\nWHERE\n (\n \"Survey Survey - Survey\".\"typeDetail\" = 'AI Transformation'\n AND (\n \"Survey Question - Question\".\"question\" = 'Based on your experience, estimate how much total coding time you saved using copilot for this PR? (in minutes)'\n OR \"Survey Question - Question\".\"question\" = 'On average how many hours per day did you save in the past week?'\n )\n [[AND \"Survey Survey - Survey\".\"name\" = <>]]\n )", + "template-tags": { + "survey_name": { + "id": "fc334638-6a77-7ed6-fc8d-f2c943fe5452", + "name": "survey_name", + "display-name": "Survey name", + "type": "text" + } + } + } + }, + "visualization_settings": { + "table.pivot_column": "origin", + "table.cell_column": "order", + "graph.dimensions": [ + "submittedAt" + ], + "column_settings": { + "[\"name\",\"Total Time Saved\"]": { + "decimals": 0 + } + }, + "graph.metrics": [ + "count" + ] + } + } + ], + "parameters": [ + { + "name": "Date", + "slug": "date", + "id": "15e648d4", + "type": "date/all-options", + "sectionId": "date", + "default": "past3months~" + }, + { + "name": "Survey Name", + "slug": "survey_name", + "id": "a0143bc7", + "type": "string/=", + "sectionId": "string" + } + ], + "layout": [ + { + "row": 1, + "col": 4, + "sizeX": 14, + "sizeY": 4, + "card_id": {{ card "AI Transformation Surveys" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "AI Transformation Surveys" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + null + ] + ] + } + ], + "visualization_settings": { + "column_settings": { + "[\"ref\",[\"field\",{{ field "survey_Survey.name" }},null]]": { + "click_behavior": { + "type": "crossfilter", + "parameterMapping": { + "a0143bc7": { + "source": { + "type": "column", + "id": "name", + "name": "Name" + }, + "target": { + "type": "parameter", + "id": "a0143bc7" + }, + "id": "a0143bc7" + } + } + } + } + } + } + }, + { + "row": 10, + "col": 5, + "sizeX": 13, + "sizeY": 5, + "card_id": {{ card "Survey Responses over Time" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "15e648d4", + "card_id": {{ card "Survey Responses over Time" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_QuestionResponse.submittedAt" }}, + null + ] + ] + }, + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Survey Responses over Time" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 30, + "col": 5, + "sizeX": 13, + "sizeY": 7, + "card_id": {{ card "Copilot helps me to:" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "15e648d4", + "card_id": {{ card "Copilot helps me to:" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_QuestionResponse.submittedAt" }}, + null + ] + ] + }, + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Copilot helps me to:" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 16, + "col": 5, + "sizeX": 13, + "sizeY": 5, + "card_id": {{ card "Cumulative Time Savings" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Cumulative Time Savings" }}, + "target": [ + "variable", + [ + "template-tag", + "survey_name" + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 22, + "col": 5, + "sizeX": 13, + "sizeY": 7, + "card_id": {{ card "Copilot helped me with the following tasks" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "15e648d4", + "card_id": {{ card "Copilot helped me with the following tasks" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_QuestionResponse.submittedAt" }}, + null + ] + ] + }, + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Copilot helped me with the following tasks" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 1, + "col": 0, + "sizeX": 4, + "sizeY": 4, + "card_id": {{ card "Number of Surveys" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Number of Surveys" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 5, + "col": 0, + "sizeX": 4, + "sizeY": 4, + "card_id": {{ card "Number of Questions Asked" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Number of Questions Asked" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 10, + "col": 0, + "sizeX": 5, + "sizeY": 5, + "card_id": {{ card "Survey Response Count" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Survey Response Count" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ] + }, + { + "parameter_id": "15e648d4", + "card_id": {{ card "Survey Response Count" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_QuestionResponse.submittedAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 5, + "col": 4, + "sizeX": 14, + "sizeY": 4, + "card_id": {{ card "Survey Questions" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Survey Questions" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + null + ] + ] + } + ], + "visualization_settings": { + "column_settings": { + "[\"ref\",[\"field\",{{ field "survey_Survey.name" }},null]]": { + "click_behavior": { + "type": "crossfilter", + "parameterMapping": { + "a0143bc7": { + "source": { + "type": "column", + "id": "name", + "name": "Name" + }, + "target": { + "type": "parameter", + "id": "a0143bc7" + }, + "id": "a0143bc7" + } + } + } + } + } + } + }, + { + "row": 29, + "col": 0, + "sizeX": 18, + "sizeY": 1, + "card_id": null, + "series": [], + "parameter_mappings": [], + "visualization_settings": { + "virtual_card": { + "name": null, + "display": "text", + "visualization_settings": {}, + "dataset_query": {}, + "archived": false + }, + "text": "## Satisfaction", + "text.align_vertical": "middle", + "dashcard.background": false + } + }, + { + "row": 21, + "col": 0, + "sizeX": 18, + "sizeY": 1, + "card_id": null, + "series": [], + "parameter_mappings": [], + "visualization_settings": { + "virtual_card": { + "name": null, + "display": "text", + "visualization_settings": {}, + "dataset_query": {}, + "archived": false + }, + "text": "## Benefits", + "text.align_vertical": "middle", + "dashcard.background": false + } + }, + { + "row": 9, + "col": 0, + "sizeX": 18, + "sizeY": 1, + "card_id": null, + "series": [], + "parameter_mappings": [], + "visualization_settings": { + "virtual_card": { + "name": null, + "display": "text", + "visualization_settings": {}, + "dataset_query": {}, + "archived": false + }, + "text": "## Engagement", + "text.align_vertical": "middle", + "dashcard.background": false + } + }, + { + "row": 15, + "col": 0, + "sizeX": 18, + "sizeY": 1, + "card_id": null, + "series": [], + "parameter_mappings": [], + "visualization_settings": { + "virtual_card": { + "name": null, + "display": "text", + "visualization_settings": {}, + "dataset_query": {}, + "archived": false + }, + "text": "## Time Savings", + "text.align_vertical": "middle", + "dashcard.background": false + } + }, + { + "row": 22, + "col": 0, + "sizeX": 5, + "sizeY": 7, + "card_id": {{ card "Net Promoter Score - Tasks" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Net Promoter Score - Tasks" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ] + }, + { + "parameter_id": "15e648d4", + "card_id": {{ card "Net Promoter Score - Tasks" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_QuestionResponse.submittedAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 30, + "col": 0, + "sizeX": 5, + "sizeY": 7, + "card_id": {{ card "Net Promoter Score - Activity" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Net Promoter Score - Activity" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_Survey.name" }}, + { + "join-alias": "Survey Survey - Survey" + } + ] + ] + }, + { + "parameter_id": "15e648d4", + "card_id": {{ card "Net Promoter Score - Activity" }}, + "target": [ + "dimension", + [ + "field", + {{ field "survey_QuestionResponse.submittedAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 16, + "col": 0, + "sizeX": 5, + "sizeY": 5, + "card_id": {{ card "Total Time Saved (hours)" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "a0143bc7", + "card_id": {{ card "Total Time Saved (hours)" }}, + "target": [ + "variable", + [ + "template-tag", + "survey_name" + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 0, + "col": 0, + "sizeX": 18, + "sizeY": 1, + "card_id": null, + "series": [], + "parameter_mappings": [], + "visualization_settings": { + "virtual_card": { + "name": null, + "display": "text", + "visualization_settings": {}, + "dataset_query": {}, + "archived": false + }, + "text": "## Surveys", + "text.align_vertical": "middle", + "dashcard.background": false + } + } + ], + "path": "/Faros CE/AI Copilot Evaluation" +} + diff --git a/init/resources/metabase/dashboards/copilot_usage.json b/init/resources/metabase/dashboards/copilot_usage.json new file mode 100644 index 00000000..423ca7fa --- /dev/null +++ b/init/resources/metabase/dashboards/copilot_usage.json @@ -0,0 +1,2456 @@ +{ + "name": "AI Copilot Evaluation - Adoption & Usage", + "cards": [ + { + "name": "Copilot Metrics", + "description": null, + "display": "table", + "table_id": null, + "dataset_query": { + "type": "native", + "native": { + "query": "SELECT \"public\".\"faros_MetricValue\".\"id\" AS \"id\", \"public\".\"faros_MetricValue\".\"definition\" AS \"definition\", \"public\".\"faros_MetricValue\".\"computedAt\" AS \"computedAt\", \"public\".\"faros_MetricValue\".\"value\" :: integer AS \"value\", max(CASE WHEN \"Faros Tag - Tag\".\"key\" = 'copilotEditor' THEN coalesce(\"Faros Tag - Tag\".\"value\", 'all_editors') END) AS \"copilotEditor\", max(CASE WHEN \"Faros Tag - Tag\".\"key\" = 'copilotLanguage' THEN coalesce(\"Faros Tag - Tag\".\"value\", 'all_languages') END) AS \"copilotLanguage\", max(CASE WHEN \"Faros Tag - Tag\".\"key\" = 'copilotOrg' THEN coalesce(\"Faros Tag - Tag\".\"value\", 'all_orgs') END) AS \"copilotOrg\", max(CASE WHEN \"Faros Tag - Tag\".\"key\" = 'copilotTeam' THEN coalesce(\"Faros Tag - Tag\".\"value\", 'all_teams') END) AS \"copilotTeam\"\nFROM \"public\".\"faros_MetricValue\"\nLEFT JOIN \"public\".\"faros_MetricValueTag\" \"Faros MetricValueTag\" ON \"public\".\"faros_MetricValue\".\"id\" = \"Faros MetricValueTag\".\"value\" LEFT JOIN \"public\".\"faros_Tag\" \"Faros Tag - Tag\" ON \"Faros MetricValueTag\".\"tag\" = \"Faros Tag - Tag\".\"id\"\nGROUP BY \"public\".\"faros_MetricValue\".\"id\", \"public\".\"faros_MetricValue\".\"definition\", \"public\".\"faros_MetricValue\".\"computedAt\", \"public\".\"faros_MetricValue\".\"value\"\nORDER BY \"public\".\"faros_MetricValue\".\"id\" ASC, \"public\".\"faros_MetricValue\".\"definition\" ASC, \"public\".\"faros_MetricValue\".\"computedAt\" ASC, \"public\".\"faros_MetricValue\".\"value\" ASC", + "template-tags": {} + } + }, + "visualization_settings": { + "table.pivot_column": "origin", + "table.cell_column": "value_3" + } + }, + { + "name": "Number of Devs with Licenses", + "description": null, + "display": "line", + "table_id": {{ table "vcs_UserTool" }}, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ table "vcs_UserTool" }}, + "breakout": [ + [ + "field", + {{ field "vcs_UserTool.startedAt" }}, + { + "temporal-unit": "week" + } + ] + ], + "aggregation": [ + [ + "cum-count" + ] + ] + } + }, + "visualization_settings": { + "graph.dimensions": [ + "startedAt" + ], + "graph.metrics": [ + "count" + ] + } + }, + { + "name": "Daily Active User Count", + "description": null, + "display": "bar", + "table_id": {{ table "vcs_UserToolUsage" }}, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ table "vcs_UserToolUsage" }}, + "joins": [ + { + "fields": "all", + "source-table": {{ table "vcs_UserTool" }}, + "condition": [ + "=", + [ + "field", + {{ field "vcs_UserToolUsage.userTool" }}, + null + ], + [ + "field", + {{ field "vcs_UserTool.id" }}, + { + "join-alias": "Vcs UserTool - UserTool" + } + ] + ], + "alias": "Vcs UserTool - UserTool" + } + ], + "breakout": [ + [ + "field", + {{ field "vcs_UserToolUsage.usedAt" }}, + { + "temporal-unit": "day" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "distinct", + [ + "field", + {{ field "vcs_UserTool.user" }}, + { + "join-alias": "Vcs UserTool - UserTool" + } + ] + ], + { + "name": "Daily Active Users", + "display-name": "Daily Active Users" + } + ] + ] + } + }, + "visualization_settings": { + "graph.dimensions": [ + "usedAt" + ], + "series_settings": { + "Daily Active Users": { + "line.missing": "zero" + } + }, + "column_settings": { + "[\"name\",\"Daily Active Users\"]": {} + }, + "graph.metrics": [ + "Daily Active Users" + ] + } + }, + { + "name": "Lines of Code Accepted by GitHub Team", + "description": null, + "display": "line", + "table_id": null, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "breakout": [ + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ], + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ], + "filter": [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + "aggregation": [ + [ + "aggregation-options", + [ + "sum", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ] + ], + { + "name": "Lines Accepted", + "display-name": "Lines Accepted" + } + ] + ] + } + }, + "visualization_settings": { + "graph.dimensions": [ + "computedAt", + "copilotTeam" + ], + "graph.metrics": [ + "Lines Accepted" + ] + } + }, + { + "name": "Lines Generated", + "description": null, + "display": "bar", + "table_id": null, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "breakout": [ + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ] + ], + { + "name": "Accepted Lines", + "display-name": "Accepted Lines" + } + ], + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ], + { + "name": "Discarded Lines", + "display-name": "Discarded Lines" + } + ], + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ], + { + "name": "Total Lines", + "display-name": "Total Lines" + } + ], + [ + "aggregation-options", + [ + "/", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ] + ], + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ] + ], + { + "name": "Acceptance Rate", + "display-name": "Acceptance Rate" + } + ] + ] + } + }, + "visualization_settings": { + "stackable.stack_type": "stacked", + "graph.dimensions": [ + "computedAt" + ], + "series_settings": { + "Discarded Lines": { + "color": "#EF8C8C" + } + }, + "column_settings": { + "[\"name\",\"Acceptance Rate\"]": { + "number_style": "percent" + } + }, + "graph.metrics": [ + "Accepted Lines", + "Discarded Lines" + ] + } + }, + { + "name": "Acceptance Rate", + "description": null, + "display": "bar", + "table_id": null, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "breakout": [ + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ] + ], + { + "name": "Accepted Lines", + "display-name": "Accepted Lines" + } + ], + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ], + { + "name": "Discarded Lines", + "display-name": "Discarded Lines" + } + ], + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ], + { + "name": "Total Lines", + "display-name": "Total Lines" + } + ], + [ + "aggregation-options", + [ + "/", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ] + ], + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ] + ], + { + "name": "Acceptance Rate", + "display-name": "Acceptance Rate" + } + ] + ] + } + }, + "visualization_settings": { + "stackable.stack_type": "stacked", + "graph.dimensions": [ + "computedAt" + ], + "series_settings": { + "Discarded Lines": { + "color": "#EF8C8C" + } + }, + "column_settings": { + "[\"name\",\"Acceptance Rate\"]": { + "number_style": "percent" + } + }, + "graph.metrics": [ + "Acceptance Rate" + ] + } + }, + { + "name": "Lines Generated by Language", + "description": null, + "display": "pie", + "table_id": null, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "breakout": [ + [ + "field", + "copilotLanguage", + { + "base-type": "type/Text" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ], + { + "name": "Total Lines", + "display-name": "Total Lines" + } + ] + ] + } + }, + "visualization_settings": { + "stackable.stack_type": "stacked", + "graph.dimensions": [ + "computedAt" + ], + "series_settings": { + "Discarded Lines": { + "color": "#EF8C8C" + } + }, + "column_settings": { + "[\"name\",\"Acceptance Rate\"]": { + "number_style": "percent" + } + }, + "graph.metrics": [ + "Accepted Lines", + "Discarded Lines" + ] + } + }, + { + "name": "Acceptance Rate by Editor", + "description": null, + "display": "line", + "table_id": null, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "breakout": [ + [ + "field", + "copilotEditor", + { + "base-type": "type/Text" + } + ], + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ] + ], + { + "name": "Accepted Lines", + "display-name": "Accepted Lines" + } + ], + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ], + { + "name": "Discarded Lines", + "display-name": "Discarded Lines" + } + ], + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ], + { + "name": "Total Lines", + "display-name": "Total Lines" + } + ], + [ + "aggregation-options", + [ + "/", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ] + ], + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ] + ], + { + "name": "Acceptance Rate", + "display-name": "Acceptance Rate" + } + ] + ] + } + }, + "visualization_settings": { + "stackable.stack_type": null, + "graph.dimensions": [ + "computedAt", + "copilotEditor" + ], + "series_settings": { + "Discarded Lines": { + "color": "#EF8C8C" + } + }, + "graph.series_order_dimension": null, + "graph.series_order": null, + "column_settings": { + "[\"name\",\"Acceptance Rate\"]": { + "number_style": "percent" + } + }, + "graph.metrics": [ + "Acceptance Rate" + ] + } + }, + { + "name": "Acceptance Rate by Language", + "description": null, + "display": "row", + "table_id": null, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "breakout": [ + [ + "field", + "copilotLanguage", + { + "base-type": "type/Text" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ] + ], + { + "name": "Accepted Lines", + "display-name": "Accepted Lines" + } + ], + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ], + { + "name": "Discarded Lines", + "display-name": "Discarded Lines" + } + ], + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ], + { + "name": "Total Lines", + "display-name": "Total Lines" + } + ], + [ + "aggregation-options", + [ + "/", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ] + ], + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ] + ], + { + "name": "Acceptance Rate", + "display-name": "Acceptance Rate" + } + ] + ], + "order-by": [ + [ + "desc", + [ + "aggregation", + 3, + null + ] + ] + ] + } + }, + "visualization_settings": { + "stackable.stack_type": null, + "graph.dimensions": [ + "copilotLanguage" + ], + "series_settings": { + "Discarded Lines": { + "color": "#EF8C8C" + } + }, + "column_settings": { + "[\"name\",\"Acceptance Rate\"]": { + "number_style": "percent" + } + }, + "graph.metrics": [ + "Acceptance Rate" + ] + } + }, + { + "name": "Lines Generated by Editor", + "description": null, + "display": "line", + "table_id": null, + "dataset_query": { + "type": "query", + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "breakout": [ + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ], + [ + "field", + "copilotEditor", + { + "base-type": "type/Text" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "sum-where", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ], + [ + "or", + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Accept" + ], + [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyGeneratedLineCount_Discard" + ] + ] + ], + { + "name": "Total Lines", + "display-name": "Total Lines" + } + ] + ] + } + }, + "visualization_settings": { + "stackable.stack_type": "stacked", + "graph.dimensions": [ + "computedAt", + "copilotEditor" + ], + "series_settings": { + "Discarded Lines": { + "color": "#EF8C8C" + } + }, + "column_settings": { + "[\"name\",\"Acceptance Rate\"]": { + "number_style": "percent" + } + }, + "graph.metrics": [ + "Total Lines" + ] + } + }, + { + "name": "Avg Daily Active Users", + "description": null, + "display": "bar", + "table_id": null, + "dataset_query": { + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "filter": [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyActiveUserTrend" + ], + "breakout": [ + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "avg", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ] + ], + { + "name": "Avg Daily Active Users", + "display-name": "Avg Daily Active Users" + } + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "computedAt" + ], + "graph.metrics": [ + "Avg Daily Active Users" + ] + } + }, + { + "name": "Daily Active Users by Language", + "description": null, + "display": "row", + "table_id": null, + "dataset_query": { + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "filter": [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyActiveUserTrend" + ], + "breakout": [ + [ + "field", + "copilotLanguage", + { + "base-type": "type/Text" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "avg", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ] + ], + { + "name": "Avg Daily Active Users", + "display-name": "Avg Daily Active Users" + } + ] + ], + "order-by": [ + [ + "desc", + [ + "aggregation", + 0, + null + ] + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "copilotLanguage" + ], + "graph.metrics": [ + "Avg Daily Active Users" + ] + } + }, + { + "name": "Daily Active Users by Editor", + "description": null, + "display": "line", + "table_id": null, + "dataset_query": { + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "filter": [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyActiveUserTrend" + ], + "breakout": [ + [ + "field", + "copilotEditor", + { + "base-type": "type/Text" + } + ], + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "avg", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ] + ], + { + "name": "Avg Daily Active Users", + "display-name": "Avg Daily Active Users" + } + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "computedAt", + "copilotEditor" + ], + "graph.series_order_dimension": null, + "graph.series_order": null, + "graph.metrics": [ + "Avg Daily Active Users" + ] + } + }, + { + "name": "Avg Daily Chat Turns", + "description": null, + "display": "bar", + "table_id": null, + "dataset_query": { + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "filter": [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyChatTurnCount" + ], + "breakout": [ + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "avg", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ] + ], + { + "name": "Avg Daily Chat Turns", + "display-name": "Avg Daily Chat Turns" + } + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "computedAt" + ], + "series_settings": { + "Avg Daily Chat Turns": { + "color": "#A989C5" + } + }, + "graph.metrics": [ + "Avg Daily Chat Turns" + ] + } + }, + { + "name": "Avg Daily Chat Users", + "description": null, + "display": "bar", + "table_id": null, + "dataset_query": { + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "filter": [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyActiveChatUserTrend" + ], + "breakout": [ + [ + "field", + "computedAt", + { + "temporal-unit": "week", + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "avg", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ] + ], + { + "name": "Avg Daily Active Users", + "display-name": "Avg Daily Active Users" + } + ] + ] + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "computedAt" + ], + "series_settings": { + "Avg Daily Active Users": { + "color": "#F9D45C" + } + }, + "graph.metrics": [ + "Avg Daily Active Users" + ] + } + }, + { + "name": "Chat Acceptances by GitHub Team", + "description": null, + "display": "bar", + "table_id": null, + "dataset_query": { + "query": { + "source-table": {{ card "Copilot Metrics" }}, + "filter": [ + "=", + [ + "field", + "definition", + { + "base-type": "type/Text" + } + ], + "DailyChatAcceptanceCount" + ], + "breakout": [ + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ], + [ + "expression", + "group" + ] + ], + "aggregation": [ + [ + "aggregation-options", + [ + "avg", + [ + "field", + "value", + { + "base-type": "type/Integer" + } + ] + ], + { + "name": "Avg Daily Chat Acceptances", + "display-name": "Avg Daily Chat Acceptances" + } + ] + ], + "expressions": { + "group": [ + "trim", + "" + ] + } + }, + "type": "query" + }, + "visualization_settings": { + "graph.dimensions": [ + "group", + "copilotTeam" + ], + "graph.series_order_dimension": null, + "graph.series_order": null, + "graph.x_axis.labels_enabled": false, + "graph.metrics": [ + "Avg Daily Chat Turns" + ] + } + } + ], + "parameters": [ + { + "name": "Date", + "slug": "date", + "id": "b8769942", + "type": "date/all-options", + "sectionId": "date", + "default": "past3months~" + }, + { + "name": "Org", + "slug": "org", + "id": "66a8f2ae", + "type": "string/=", + "sectionId": "string" + }, + { + "name": "Team", + "slug": "team", + "id": "a6b0f41", + "type": "string/=", + "sectionId": "string" + } + ], + "layout": [ + { + "row": 1, + "col": 0, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Number of Devs with Licenses" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Number of Devs with Licenses" }}, + "target": [ + "dimension", + [ + "field", + {{ field "vcs_UserTool.startedAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 1, + "col": 5, + "sizeX": 13, + "sizeY": 4, + "card_id": {{ card "Daily Active User Count" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Daily Active User Count" }}, + "target": [ + "dimension", + [ + "field", + {{ field "vcs_UserToolUsage.usedAt" }}, + null + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 6, + "col": 0, + "sizeX": 18, + "sizeY": 5, + "card_id": {{ card "Lines of Code Accepted by GitHub Team" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Lines of Code Accepted by GitHub Team" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Lines of Code Accepted by GitHub Team" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Lines of Code Accepted by GitHub Team" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 11, + "col": 0, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Lines Generated" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Lines Generated" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Lines Generated" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Lines Generated" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 15, + "col": 0, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Acceptance Rate" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Acceptance Rate" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Acceptance Rate" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Acceptance Rate" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 11, + "col": 5, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Lines Generated by Language" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Lines Generated by Language" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Lines Generated by Language" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Lines Generated by Language" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 15, + "col": 10, + "sizeX": 8, + "sizeY": 4, + "card_id": {{ card "Acceptance Rate by Editor" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Acceptance Rate by Editor" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Acceptance Rate by Editor" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Acceptance Rate by Editor" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 15, + "col": 5, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Acceptance Rate by Language" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Acceptance Rate by Language" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Acceptance Rate by Language" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Acceptance Rate by Language" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 11, + "col": 10, + "sizeX": 8, + "sizeY": 4, + "card_id": {{ card "Lines Generated by Editor" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Lines Generated by Editor" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Lines Generated by Editor" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Lines Generated by Editor" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 23, + "col": 0, + "sizeX": 18, + "sizeY": 1, + "card_id": null, + "series": [], + "parameter_mappings": [], + "visualization_settings": { + "virtual_card": { + "name": null, + "display": "text", + "visualization_settings": {}, + "dataset_query": {}, + "archived": false + }, + "text": "## Copilot Chat", + "text.align_vertical": "middle", + "dashcard.background": false + } + }, + { + "row": 19, + "col": 0, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Avg Daily Active Users" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Avg Daily Active Users" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Avg Daily Active Users" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Avg Daily Active Users" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 19, + "col": 5, + "sizeX": 5, + "sizeY": 4, + "card_id": {{ card "Daily Active Users by Language" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Daily Active Users by Language" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Daily Active Users by Language" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Daily Active Users by Language" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 19, + "col": 10, + "sizeX": 8, + "sizeY": 4, + "card_id": {{ card "Daily Active Users by Editor" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Daily Active Users by Editor" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Daily Active Users by Editor" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Daily Active Users by Editor" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 24, + "col": 6, + "sizeX": 6, + "sizeY": 4, + "card_id": {{ card "Avg Daily Chat Turns" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Avg Daily Chat Turns" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Avg Daily Chat Turns" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Avg Daily Chat Turns" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 24, + "col": 0, + "sizeX": 6, + "sizeY": 4, + "card_id": {{ card "Avg Daily Chat Users" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Avg Daily Chat Users" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Avg Daily Chat Users" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Avg Daily Chat Users" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 24, + "col": 12, + "sizeX": 6, + "sizeY": 4, + "card_id": {{ card "Chat Acceptances by GitHub Team" }}, + "series": [], + "parameter_mappings": [ + { + "parameter_id": "b8769942", + "card_id": {{ card "Chat Acceptances by GitHub Team" }}, + "target": [ + "dimension", + [ + "field", + "computedAt", + { + "base-type": "type/DateTimeWithLocalTZ" + } + ] + ] + }, + { + "parameter_id": "66a8f2ae", + "card_id": {{ card "Chat Acceptances by GitHub Team" }}, + "target": [ + "dimension", + [ + "field", + "copilotOrg", + { + "base-type": "type/Text" + } + ] + ] + }, + { + "parameter_id": "a6b0f41", + "card_id": {{ card "Chat Acceptances by GitHub Team" }}, + "target": [ + "dimension", + [ + "field", + "copilotTeam", + { + "base-type": "type/Text" + } + ] + ] + } + ], + "visualization_settings": {} + }, + { + "row": 5, + "col": 0, + "sizeX": 18, + "sizeY": 1, + "card_id": null, + "series": [], + "parameter_mappings": [], + "visualization_settings": { + "virtual_card": { + "name": null, + "display": "text", + "visualization_settings": {}, + "dataset_query": {}, + "archived": false + }, + "text": "## Usage", + "text.align_vertical": "middle", + "dashcard.background": false + } + }, + { + "row": 0, + "col": 0, + "sizeX": 18, + "sizeY": 1, + "card_id": null, + "series": [], + "parameter_mappings": [], + "visualization_settings": { + "virtual_card": { + "name": null, + "display": "text", + "visualization_settings": {}, + "dataset_query": {}, + "archived": false + }, + "text": "## Adoption", + "text.align_vertical": "middle", + "dashcard.background": false + } + } + ], + "path": "/Faros CE/AI Copilot Evaluation" +} + diff --git a/mock-data/src/hasura.ts b/mock-data/src/hasura.ts index 89c80288..f69fee9f 100644 --- a/mock-data/src/hasura.ts +++ b/mock-data/src/hasura.ts @@ -5,11 +5,11 @@ export class Hasura { private readonly api: AxiosInstance; constructor(private readonly baseURL: string, adminSecret?: string) { this.api = axios.create( - { + { baseURL: `${baseURL}/api/rest/`, headers: { - "Content-Type": "application/json", - ...(adminSecret && {"X-Hasura-Admin-Secret": adminSecret}), + 'Content-Type': 'application/json', + ...(adminSecret && {'X-Hasura-Admin-Secret': adminSecret}), } } ); @@ -111,6 +111,49 @@ export class Hasura { }); } + async postMetricDefinition( + uid: string, + name: string, + valueType: any, + origin: string + ): Promise { + await this.api.post('faros_metric_definition', { + data_uid: uid, + data_name: name, + data_value_type: valueType, + data_origin: origin, + }); + } + + async postMetricValue( + uid: string, + computedAt: DateTime, + value: string, + definition: string, + origin: string + ): Promise { + await this.api.post('faros_metric_value', { + data_uid: uid, + data_computedAt: computedAt, + data_value: value, + data_definition: definition, + data_origin: origin, + }); + } + + async postMetricValueTag( + value: any, + tag: string, + origin: string + ): Promise { + await this.api.post('faros_metric_value_tag', { + data_value_uid: value.uid, + data_value_definition_uid: value.definition, + data_tag_id: tag, + data_origin: origin, + }); + } + async postPullRequest( id: string, author: string, @@ -118,6 +161,8 @@ export class Hasura { commitSha: string, createTime: DateTime, mergeTime: DateTime, + linesAdded: number, + linesDeleted: number, repository: string, organization: string, source: string, @@ -130,6 +175,8 @@ export class Hasura { data_merge_commit_sha: commitSha, data_pull_request_create_time: createTime, data_pull_request_merge_time: mergeTime, + data_pull_request_lines_added: linesAdded, + data_pull_request_lines_deleted: linesDeleted, data_pull_request_repository: repository, data_pull_request_organization: organization, data_pull_request_source: source, @@ -159,6 +206,91 @@ export class Hasura { }); } + async postSurveyQuestion( + uid: string, + question: string, + responseType: any, + questionType: any, + source: string, + origin: string + ): Promise { + await this.api.post('survey_question', { + data_uid: uid, + data_question: question, + data_response_category: responseType.category, + data_response_detail: responseType.detail, + data_question_category: questionType.category, + data_question_detail: questionType.detail, + data_source: source, + data_origin: origin, + }); + } + + async postSurveyQuestionResponse( + uid: string, + origin: string, + submittedAt: DateTime, + response: string, + survey: any, + question: any + ): Promise { + await this.api.post('survey_question_response', { + data_uid: uid, + data_origin: origin, + data_submitted_at: submittedAt, + data_response: response, + data_survey_uid: survey.uid, + data_survey_source: survey.source, + data_question_uid: question.uid, + data_question_source: question.source, + }); + } + + async postSurveySurvey( + uid: string, + name: string, + type: any, + source: string, + origin: string + ): Promise { + await this.api.post('survey_survey', { + data_uid: uid, + data_name: name, + data_type_category: type.category, + data_type_detail: type.detail, + data_source: source, + data_origin: origin, + }); + } + + async postSurveyQuestionAssociation( + survey: any, + question: any, + origin: string + ): Promise { + await this.api.post('survey_survey_question_association', { + data_survey_uid: survey.uid, + data_survey_source: survey.source, + data_question_uid: question.uid, + data_question_source: question.source, + data_origin: origin + }); + } + + async postTag( + uid: string, + key: string, + value: string, + origin: string + ): Promise { + await this.api.post('faros_tag', { + data_uid: uid, + data_key: key, + data_value: value, + data_origin: origin, + }); + } + async postTask( taskId: string, createdAt: DateTime, @@ -188,6 +320,47 @@ export class Hasura { }); } + async postUserTool( + user: any, + organization: any, + tool: any, + inactive: boolean, + startedAt: DateTime, + endedAt: DateTime | null | undefined, + origin: string, + ): Promise { + await this.api.post('vcs_user_tool', { + data_user_uid: user.uid, + data_user_source: user.source, + data_org_uid: organization.uid, + data_org_source: organization.source, + data_tool: tool, + data_inactive: inactive, + data_started_at: startedAt, + data_ended_at: endedAt, + data_origin: origin + }); + } + + // currently excludes branch, repo, file, and charactersAdded + async postUserToolUsage( + tool: any, + usedAt: DateTime, + recordedAt: DateTime, + origin: string, + ): Promise { + await this.api.post('vcs_user_tool_usage', { + data_user_uid: tool.user.uid, + data_user_source: tool.user.source, + data_org_uid: tool.organization.uid, + data_org_source: tool.organization.source, + data_tool: tool.tool, + data_used_at: usedAt, + data_recorded_at: recordedAt, + data_origin: origin, + }); + } + async deleteArtifactCommitAssociation(origin: string): Promise { await this.api.post('delete_cicd_artifact_commit_association', { data_origin: origin, @@ -280,4 +453,64 @@ export class Hasura { data_origin: origin, }); } + + async deleteMetricDefinition(origin: string): Promise { + await this.api.post('delete_faros_metric_definition', { + data_origin: origin, + }); + } + + async deleteMetricValue(origin: string): Promise { + await this.api.post('delete_faros_metric_value', { + data_origin: origin, + }); + } + + async deleteMetricValueTag(origin: string): Promise { + await this.api.post('delete_faros_metric_value_tag', { + data_origin: origin, + }); + } + + async deleteTag(origin: string): Promise { + await this.api.post('delete_faros_tag', { + data_origin: origin, + }); + } + + async deleteUserTool(origin: string): Promise { + await this.api.post('delete_vcs_user_tool', { + data_origin: origin, + }); + } + + async deleteUserToolUsage(origin: string): Promise { + await this.api.post('delete_vcs_user_tool_usage', { + data_origin: origin, + }); + } + + async deleteSurveyQuestion(origin: string): Promise { + await this.api.post('delete_survey_question', { + data_origin: origin, + }); + } + + async deleteSurveyQuestionResponse(origin: string): Promise { + await this.api.post('delete_survey_question_response', { + data_origin: origin, + }); + } + + async deleteSurveySurvey(origin: string): Promise { + await this.api.post('delete_survey_survey', { + data_origin: origin, + }); + } + + async deleteSurveyQuestionAssociation(origin: string): Promise { + await this.api.post('delete_survey_survey_question_association', { + data_origin: origin, + }); + } } diff --git a/mock-data/src/mockdata.ts b/mock-data/src/mockdata.ts index 97344210..a16b62ec 100644 --- a/mock-data/src/mockdata.ts +++ b/mock-data/src/mockdata.ts @@ -85,6 +85,8 @@ export class MockData { num++; } await this.writeTasks(week, weekStart); + await this.writeCopilot(week, weekStart); + await this.writeSurveys(numWeeks); } } @@ -112,17 +114,27 @@ export class MockData { await Promise.all([ this.hasura.deleteComputeApplication(ORIGIN), this.hasura.deleteCommit(ORIGIN), + this.hasura.deleteMetricValueTag(ORIGIN), + this.hasura.deleteUserToolUsage(ORIGIN), + this.hasura.deleteSurveyQuestionResponse(ORIGIN), ]); await Promise.all([ this.hasura.deleteCICDRepository(ORIGIN), this.hasura.deleteVCSRepository(ORIGIN), + this.hasura.deleteMetricValue(ORIGIN), + this.hasura.deleteTag(ORIGIN), + this.hasura.deleteUserTool(ORIGIN), + this.hasura.deleteSurveyQuestionAssociation(ORIGIN), ]); await Promise.all([ this.hasura.deleteCICDOrganization(ORIGIN), this.hasura.deleteVCSUser(ORIGIN), this.hasura.deleteVCSOrganization(ORIGIN), + this.hasura.deleteMetricDefinition(ORIGIN), + this.hasura.deleteSurveySurvey(ORIGIN), + this.hasura.deleteSurveyQuestion(ORIGIN) ]); } @@ -140,6 +152,8 @@ export class MockData { commitSha, prCreateTime, mergedAt, + MockData.randomInt(200, 2000), + MockData.randomInt(0, 1000), REPO, ORG, SOURCE, @@ -311,4 +325,304 @@ export class MockData { ); } } + + private async writeCopilot(weekNum: number, week: DateTime): Promise { + const languageTags = [ + 'go', + 'python', + 'typescript', + ].map((lang) => { + return { + faros_Tag: { + uid: 'copilotLanguage__' + lang, + key: 'copilotLanguage', + value: lang, + }, + }; + }); + + const ideTags = ['jetbrains', 'vscode'].map((i) => { + return { + faros_Tag: { + uid: 'copilotEditor__' + i, + key: 'copilotEditor', + value: i, + }, + }; + }); + + for (const tag of [...languageTags, ...ideTags]) { + await this.hasura.postTag( + tag.faros_Tag.uid, + tag.faros_Tag.key, + tag.faros_Tag.value, + ORIGIN + ); + } + + const metricDefs = [ + 'DailyActiveUserTrend', + 'DailyGeneratedLineCount_Accept', + 'DailyGeneratedLineCount_Discard', + 'DailySuggestionReferenceCount_Accept', + 'DailySuggestionReferenceCount_Discard', + 'DailyActiveChatUserTrend', + 'DailyChatAcceptanceCount', + 'DailyChatTurnCount', + ].map((d) => { + return { + faros_MetricDefinition: { + uid: d, + name: d, + valueType: {category: 'Numeric'}, + }, + }; + }); + + for (const def of metricDefs) { + await this.hasura.postMetricDefinition( + def.faros_MetricDefinition.uid, + def.faros_MetricDefinition.name, + def.faros_MetricDefinition.valueType, + ORIGIN + ); + } + + const metricDefToFun: Record number> = { + DailyActiveUserTrend: (): number => MockData.randomInt(3, 1), + DailyGeneratedLineCount_Accept: (): number => MockData.randomInt(10, 2), + DailyGeneratedLineCount_Discard: (): number => + MockData.randomInt(100, 10), + DailySuggestionReferenceCount_Accept: (): number => + MockData.randomInt(10, 2), + DailySuggestionReferenceCount_Discard: (): number => + MockData.randomInt(100, 10), + DailyActiveChatUserTrend: (): number => MockData.randomInt(3, 1), + DailyChatAcceptanceCount: (): number => MockData.randomInt(10, 1), + DailyChatTurnCount: (): number => MockData.randomInt(20, 3), + }; + + const tools = [1, 2].map((u) => { + return { + user: {uid: `author-${u}`, source: SOURCE}, + organization: {uid: ORG, source: SOURCE}, + tool: {category: 'GitHubCopilot'}, + inactive: false, + startedAt: DateTime.now().minus({weeks: MockData.randomInt(4, 2)}), + endedAt: DateTime.now(), + origin: ORIGIN, + }; + }); + + for (const t of tools) { + await this.hasura.postUserTool( + t.user, + t.organization, + t.tool, + t.inactive, + t.startedAt, + t.endedAt, + t.origin + ); + } + + + for (let i = 1; i <= 10; i++) { + const computedAt = week.plus({days: MockData.randomInt(6)}); + + const usedAt = computedAt; + await this.hasura.postUserToolUsage( + tools[MockData.randomInt(tools.length, 1)], + usedAt, + usedAt.plus({hours: 2}), + ORIGIN + ); + for (const def of metricDefs) { + + const metricValue = { + uid: `mv-week${weekNum}-${i}`, + computedAt, + value: metricDefToFun[def.faros_MetricDefinition.name]().toString(), + definition: def.faros_MetricDefinition.uid, + origin: ORIGIN + }; + + await this.hasura.postMetricValue( + metricValue.uid, + metricValue.computedAt, + metricValue.value, + metricValue.definition, + metricValue.origin, + ); + + await this.hasura.postMetricValueTag( + metricValue, + languageTags[MockData.randomInt(languageTags.length)].faros_Tag.uid, + ORIGIN + ); + + await this.hasura.postMetricValueTag( + metricValue, + ideTags[MockData.randomInt(ideTags.length)].faros_Tag.uid, + ORIGIN + ); + } + } + } + + + + private async writeSurveys(numWeeks: number): Promise { + const nResponses = 10; + const likerts = [ + 'Strongly Disagree', + 'Disagree', + 'Neutral', + 'Agree', + 'Strongly Agree', + ]; + function randArr(arr: any[]): any { + return arr[MockData.randomInt(0, arr.length)]; + } + + + // Cadence Surveys + const cSurvey = { + uid: 'survey-1', + name: 'Copilot Weekly Survey', + type: {category: 'Custom', detail: 'AI Transformation'}, + source: SOURCE, + origin: ORIGIN + }; + + await this.hasura.postSurveySurvey( + cSurvey.uid, + cSurvey.name, + cSurvey.type, + cSurvey.source, + cSurvey.origin + ); + + interface questionInfo { + question: string; + responseType?: {category: string; detail: string}; + generateResponse: () => string; + } + + let qid = 0; + async function writeQuestions( + questions: questionInfo[], + survey: any, + hasura: Hasura + ): Promise { + for (const qi of questions) { + const q = { + uid: `question-${qid}`, + source: SOURCE + }; + await hasura.postSurveyQuestion( + q.uid, + qi.question, + {category: 'CodingAssistants', detail: 'CodingAssistants'}, + qi.responseType, + SOURCE, + ORIGIN + ); + qid++; + await hasura.postSurveyQuestionAssociation(survey, q, ORIGIN); + for (let i = 0; i <= nResponses; i++) { + await hasura.postSurveyQuestionResponse( + `response-${i}`, + ORIGIN, + DateTime.now().minus({days: MockData.randomInt(0, numWeeks * 7)}), + qi.generateResponse(), + survey, + q + ); + } + } + } + + const cQuestions: questionInfo[] = [ + { + question: 'How often are you using your coding assistant?', + responseType: {category: 'MultipleChoice', detail: 'MultipleChoice'}, + generateResponse: (): string => randArr([ + 'I have not started to use it yet', + 'I used it for some time, but not anymore', + 'Rarely', + 'Frequently', + 'Very Frequently', + ]) + }, + { + question: 'On average how many hours per day did you save ' + + 'in the past week?', + responseType: {category: 'NumericEntry', detail: 'NumericEntry'}, + generateResponse: () => MockData.randomInt(0, 10).toString() + }, ...[ + 'Understanding code', + 'Preparing to code', + 'Writing new code', + 'Debugging code', + 'Refactoring code', + 'Reviewing code', + 'Documenting code', + 'Writing tests', + ].map((task) => { + return { + question: 'In the past week, Copilot helped me with the following ' + + `tasks: [${task}]`, + responseType: {category: 'LikertScale', detail: 'LikertScale'}, + generateResponse: () => randArr(likerts), + }; + }) + ]; + await writeQuestions(cQuestions, cSurvey, this.hasura); + + + + // PR Surveys + const prSurvey = { + uid: 'survey-2', + name: 'GitHub Copilot Survey', + type: {category: 'Custom', detail: 'AI Transformation'}, + source: SOURCE, + origin: ORIGIN + }; + await this.hasura.postSurveySurvey( + prSurvey.uid, + prSurvey.name, + prSurvey.type, + prSurvey.source, + prSurvey.origin + ); + + const prQuestions: questionInfo[] = [ + { + question: + 'Based on your experience, estimate how much total coding time ' + + 'you saved using copilot for this PR? (in minutes)', + responseType: {category: 'NumericEntry', detail: 'NumericEntry'}, + generateResponse: () => MockData.randomInt(5, 60).toString(), + }, ...[ + 'Be happier in my job', + 'Be more productive', + 'Deal with repetitive tasks', + 'Improve Productivity', + 'Learn new skills', + 'Refactor or debug code', + 'Stay in flow', + 'Write better code', + ].map((task) => { + return { + question: `(optional) Copilot helps me to: [${task}]`, + responseType: {category: 'LikertScale', detail: 'LikertScale'}, + generateResponse: () => randArr(likerts), + }; + }) + ]; + await writeQuestions(prQuestions, prSurvey, this.hasura); + + } }