Milimetric has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/397626 )
Change subject: Update for new Edit schema version 17541122
......................................................................
Update for new Edit schema version 17541122
New action state (loaded, after ready and before saveIntent), which
means some changes to the queries, and editor type (wikitext), which
doesn't.
Bug: T182620
Change-Id: I9bf52dcbaa175ef52dcc9a4b615e14785be753ee
---
M edit/failure_rates_by_type.sql
M edit/failure_types_by_user_type.sql
M edit/rates.sql
M edit/sessions.sql
M edit/success_by_user_type.sql
5 files changed, 133 insertions(+), 32 deletions(-)
Approvals:
Milimetric: Verified; Looks good to me, approved
diff --git a/edit/failure_rates_by_type.sql b/edit/failure_rates_by_type.sql
index 05e2500..aa1525f 100644
--- a/edit/failure_rates_by_type.sql
+++ b/edit/failure_rates_by_type.sql
@@ -63,20 +63,38 @@
timestamp < '{to_timestamp}'
) raw_events
+ union all
+
+ select
+ timestamp,
+ event_action,
+ `event_action.saveFailure.type`,
+ clientIp,
+ event_editingSessionId
+ from Edit_17541122
+ where
+ event_editor = '{editor}' and
+ ('{wiki}' = 'all' or wiki = '{wiki}') and
+ timestamp >= '{from_timestamp}' and
+ timestamp < '{to_timestamp}'
+ ) raw_events
+
inner join
(select 'init' as action, 0 as ord
union all
select 'ready' as action, 1 as ord
union all
- select 'saveIntent' as action, 2 as ord
+ select 'loaded' as action, 2 as ord
union all
- select 'saveAttempt' as action, 3 as ord
+ select 'saveIntent' as action, 3 as ord
union all
- select 'saveFailure' as action, 4 as ord
+ select 'saveAttempt' as action, 4 as ord
union all
- select 'saveSuccess' as action, 5 as ord
+ select 'saveFailure' as action, 5 as ord
union all
- select 'abort' as action, 6 as ord
+ select 'saveSuccess' as action, 6 as ord
+ union all
+ select 'abort' as action, 7 as ord
) action_order
on action = event_action
diff --git a/edit/failure_types_by_user_type.sql
b/edit/failure_types_by_user_type.sql
index 6fbfcfc..8b0b029 100644
--- a/edit/failure_types_by_user_type.sql
+++ b/edit/failure_types_by_user_type.sql
@@ -42,6 +42,19 @@
timestamp < '{to_timestamp}' and
`event_action` = 'saveFailure' and
`event_action.saveFailure.type` is not null )
+
+ union all
+
+ ( select timestamp, `event_user.class`,
+ `event_user.editCount`, `event_action.saveFailure.type`
+ from Edit_17541122
+ where
+ event_editor = '{editor}' and
+ ('{wiki}' = 'all' or wiki = '{wiki}') and
+ timestamp >= '{from_timestamp}' and
+ timestamp < '{to_timestamp}' and
+ `event_action` = 'saveFailure' and
+ `event_action.saveFailure.type` is not null )
) saveFailures
group by 1, 2
diff --git a/edit/rates.sql b/edit/rates.sql
index eef80db..dc1bfa0 100644
--- a/edit/rates.sql
+++ b/edit/rates.sql
@@ -1,4 +1,5 @@
select day,
+ sum(ready and not loaded) / sum(ready) as `load-failure`,
sum(ready and not saving) / sum(ready) as `bounce-rate`,
sum(ready and not attempt) / sum(ready) as `not-attempted-rate`,
sum(attempt and success) / sum(attempt) as `success-rate`,
@@ -6,6 +7,7 @@
from (select day,
actions like '%ready%' as ready,
+ actions like '%loaded%' as loaded,
actions like '%save%' as saving,
actions like '%Failure%' as failure,
actions like '%Attempt%' as attempt,
@@ -44,20 +46,37 @@
timestamp < '{to_timestamp}'
) raw_events
+ union all
+
+ select
+ timestamp,
+ event_action,
+ clientIp,
+ event_editingSessionId
+ from Edit_17541122
+ where
+ event_editor = '{editor}' and
+ ('{wiki}' = 'all' or wiki = '{wiki}') and
+ timestamp >= '{from_timestamp}' and
+ timestamp < '{to_timestamp}'
+ ) raw_events
+
inner join
(select 'init' as action, 0 as ord
union all
select 'ready' as action, 1 as ord
union all
- select 'saveIntent' as action, 2 as ord
+ select 'loaded' as action, 2 as ord
union all
- select 'saveAttempt' as action, 3 as ord
+ select 'saveIntent' as action, 3 as ord
union all
- select 'saveFailure' as action, 4 as ord
+ select 'saveAttempt' as action, 4 as ord
union all
- select 'saveSuccess' as action, 5 as ord
+ select 'saveFailure' as action, 5 as ord
union all
- select 'abort' as action, 6 as ord
+ select 'saveSuccess' as action, 6 as ord
+ union all
+ select 'abort' as action, 7 as ord
) action_order
on action = event_action
diff --git a/edit/sessions.sql b/edit/sessions.sql
index 130f090..cfe4231 100644
--- a/edit/sessions.sql
+++ b/edit/sessions.sql
@@ -2,36 +2,68 @@
actions,
count(*) as repeated
from (select group_concat(event_action order by timestamp, action_order.ord
separator '-') as actions
- from (select timestamp,
- event_action,
- clientIp,
- event_editingSessionId
+ from (
+ select
+ timestamp,
+ event_action,
+ clientIp,
+ event_editingSessionId
+ from Edit_11448630
+ where
+ event_editor = '{editor}' and
+ ('{wiki}' = 'all' or wiki = '{wiki}') and
+ timestamp >= '{from_timestamp}' and
+ timestamp < '{to_timestamp}'
- from Edit_13457736
- # NOTE: used to union all with Edit_11448630
- # That schema is still used apparently, but very little
+ # Add in events using the new schema. To be removed once
everything
+ # is switched over.
+ union all
- where event_editor = '{editor}'
- and ('{wiki}' = 'all' or wiki = '{wiki}')
- and timestamp >= '{from_timestamp}'
- and timestamp < '{to_timestamp}'
+ select
+ timestamp,
+ event_action,
+ clientIp,
+ event_editingSessionId
+ from Edit_13457736
+ where
+ event_editor = '{editor}' and
+ ('{wiki}' = 'all' or wiki = '{wiki}') and
+ timestamp >= '{from_timestamp}' and
+ timestamp < '{to_timestamp}'
) raw_events
- inner join
+ union all
+
+ select
+ timestamp,
+ event_action,
+ clientIp,
+ event_editingSessionId
+ from Edit_17541122
+ where
+ event_editor = '{editor}' and
+ ('{wiki}' = 'all' or wiki = '{wiki}') and
+ timestamp >= '{from_timestamp}' and
+ timestamp < '{to_timestamp}'
+ ) raw_events
+
+ inner join
(select 'init' as action, 0 as ord
union all
select 'ready' as action, 1 as ord
union all
- select 'saveIntent' as action, 2 as ord
+ select 'loaded' as action, 2 as ord
union all
- select 'saveAttempt' as action, 3 as ord
+ select 'saveIntent' as action, 3 as ord
union all
- select 'saveFailure' as action, 4 as ord
+ select 'saveAttempt' as action, 4 as ord
union all
- select 'saveSuccess' as action, 5 as ord
+ select 'saveFailure' as action, 5 as ord
union all
- select 'abort' as action, 6 as ord
+ select 'saveSuccess' as action, 6 as ord
+ union all
+ select 'abort' as action, 7 as ord
) action_order on action = event_action
diff --git a/edit/success_by_user_type.sql b/edit/success_by_user_type.sql
index 587944c..0fb8612 100644
--- a/edit/success_by_user_type.sql
+++ b/edit/success_by_user_type.sql
@@ -60,20 +60,39 @@
timestamp < '{to_timestamp}'
) raw_events
+ union all
+
+ select
+ timestamp,
+ event_action,
+ clientIp,
+ event_editingSessionId,
+ `event_user.class`,
+ `event_user.editCount` as edit_count
+ from Edit_17541122
+ where
+ event_editor = '{editor}' and
+ ('{wiki}' = 'all' or wiki = '{wiki}') and
+ timestamp >= '{from_timestamp}' and
+ timestamp < '{to_timestamp}'
+ ) raw_events
+
inner join
(select 'init' as action, 0 as ord
union all
select 'ready' as action, 1 as ord
union all
- select 'saveIntent' as action, 2 as ord
+ select 'loaded' as action, 2 as ord
union all
- select 'saveAttempt' as action, 3 as ord
+ select 'saveIntent' as action, 3 as ord
union all
- select 'saveFailure' as action, 4 as ord
+ select 'saveAttempt' as action, 4 as ord
union all
- select 'saveSuccess' as action, 5 as ord
+ select 'saveFailure' as action, 5 as ord
union all
- select 'abort' as action, 6 as ord
+ select 'saveSuccess' as action, 6 as ord
+ union all
+ select 'abort' as action, 7 as ord
) action_order
on action = event_action
--
To view, visit https://gerrit.wikimedia.org/r/397626
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9bf52dcbaa175ef52dcc9a4b615e14785be753ee
Gerrit-PatchSet: 3
Gerrit-Project: analytics/limn-edit-data
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Deskana <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Milimetric <[email protected]>
Gerrit-Reviewer: Neil P. Quinn-WMF <[email protected]>
Gerrit-Reviewer: Nuria <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits