Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevsStats.php |
— | — | @@ -93,52 +93,52 @@ |
94 | 94 | |
95 | 95 | $dataSet = array(); |
96 | 96 | $dataSet[] = array( |
97 | | - 'frs_stat_key' => 'reviewLag-sampleStartTimestamp', |
| 97 | + 'frs_stat_key' => 'reviewLag-sampleStartTimestamp', |
98 | 98 | 'frs_stat_val' => $reviewData['sampleStartTS'], // unix |
99 | 99 | 'frs_timestamp' => $encDataTimestamp ); |
100 | 100 | $dataSet[] = array( |
101 | | - 'frs_stat_key' => 'reviewLag-sampleEndTimestamp', |
| 101 | + 'frs_stat_key' => 'reviewLag-sampleEndTimestamp', |
102 | 102 | 'frs_stat_val' => $reviewData['sampleEndTS'], // unix |
103 | 103 | 'frs_timestamp' => $encDataTimestamp ); |
104 | 104 | // All-namespace percentiles... |
105 | 105 | foreach( $reviewData['percTable'] as $percentile => $seconds ) { |
106 | 106 | $dataSet[] = array( |
107 | | - 'frs_stat_key' => 'reviewLag-percentile:'.(int)$percentile, |
| 107 | + 'frs_stat_key' => 'reviewLag-percentile:'.(int)$percentile, |
108 | 108 | 'frs_stat_val' => $seconds, |
109 | 109 | 'frs_timestamp' => $encDataTimestamp ); |
110 | 110 | } |
111 | 111 | // Sample size... |
112 | 112 | $dataSet[] = array( |
113 | | - 'frs_stat_key' => 'reviewLag-sampleSize', |
| 113 | + 'frs_stat_key' => 'reviewLag-sampleSize', |
114 | 114 | 'frs_stat_val' => $reviewData['sampleSize'], |
115 | 115 | 'frs_timestamp' => $encDataTimestamp ); |
116 | 116 | |
117 | 117 | // All-namespace ave/med review lag & ave pending lag stats... |
118 | 118 | $dataSet[] = array( |
119 | | - 'frs_stat_key' => 'reviewLag-average', |
| 119 | + 'frs_stat_key' => 'reviewLag-average', |
120 | 120 | 'frs_stat_val' => $reviewData['average'], |
121 | 121 | 'frs_timestamp' => $encDataTimestamp ); |
122 | 122 | $dataSet[] = array( |
123 | | - 'frs_stat_key' => 'reviewLag-median', |
| 123 | + 'frs_stat_key' => 'reviewLag-median', |
124 | 124 | 'frs_stat_val' => $reviewData['median'], |
125 | 125 | 'frs_timestamp' => $encDataTimestamp ); |
126 | 126 | $dataSet[] = array( |
127 | | - 'frs_stat_key' => 'pendingLag-average', |
| 127 | + 'frs_stat_key' => 'pendingLag-average', |
128 | 128 | 'frs_stat_val' => $avePET, |
129 | 129 | 'frs_timestamp' => $encDataTimestamp ); |
130 | 130 | |
131 | 131 | // Per-namespace total/reviewed/synced stats... |
132 | 132 | foreach( $rNamespaces as $namespace ) { |
133 | 133 | $dataSet[] = array( |
134 | | - 'frs_stat_key' => 'totalPages-NS:'.(int)$namespace, |
| 134 | + 'frs_stat_key' => 'totalPages-NS:'.(int)$namespace, |
135 | 135 | 'frs_stat_val' => isset($ns_total[$namespace]) ? $ns_total[$namespace] : 0, |
136 | 136 | 'frs_timestamp' => $encDataTimestamp ); |
137 | 137 | $dataSet[] = array( |
138 | | - 'frs_stat_key' => 'reviewedPages-NS:'.(int)$namespace, |
| 138 | + 'frs_stat_key' => 'reviewedPages-NS:'.(int)$namespace, |
139 | 139 | 'frs_stat_val' => isset($ns_reviewed[$namespace]) ? $ns_reviewed[$namespace] : 0, |
140 | 140 | 'frs_timestamp' => $encDataTimestamp ); |
141 | 141 | $dataSet[] = array( |
142 | | - 'frs_stat_key' => 'syncedPages-NS:'.(int)$namespace, |
| 142 | + 'frs_stat_key' => 'syncedPages-NS:'.(int)$namespace, |
143 | 143 | 'frs_stat_val' => isset($ns_synced[$namespace]) ? $ns_synced[$namespace] : 0, |
144 | 144 | 'frs_timestamp' => $encDataTimestamp ); |
145 | 145 | } |
— | — | @@ -335,7 +335,7 @@ |
336 | 336 | 'p.fr_page_id = rev_page', |
337 | 337 | 'p.fr_rev_id < rev_id', // not imported later |
338 | 338 | 'p.fr_timestamp < rev_timestamp' ) ), |
339 | | - 'n' => array( 'INNER JOIN', array( // next review |
| 339 | + 'n' => array( 'INNER JOIN', array( // next review |
340 | 340 | 'n.fr_page_id = rev_page', |
341 | 341 | 'n.fr_rev_id >= rev_id', |
342 | 342 | 'n.fr_timestamp >= rev_timestamp' ) ) |
— | — | @@ -353,7 +353,6 @@ |
354 | 354 | $time = max( $time, 0 ); // sanity |
355 | 355 | $secondsR += $time; |
356 | 356 | $times[] = $time; |
357 | | - #echo( "\nedit:".$row->rt . "\twait:" . $time ); |
358 | 357 | } |
359 | 358 | $sampleSize = count($times); |
360 | 359 | $aveRT = ($secondsR + $secondsP)/$sampleSize; // sample mean |
— | — | @@ -367,7 +366,6 @@ |
368 | 367 | $rank = round( $percentile*count($times)/100 + .5 ) - 1; |
369 | 368 | $rPerTable[$percentile] = $times[$rank]; |
370 | 369 | } |
371 | | - #echo "(sampled ".count($times)." edits)..."; |
372 | 370 | $result['average'] = $aveRT; |
373 | 371 | $result['median'] = $medianRT; |
374 | 372 | $result['percTable'] = $rPerTable; |