Permalink
Browse files

Merge pull request #5 from espindola/lateWritesWithJason

Change the telemetry_chrome_hangs pig to also collect late writes.
  • Loading branch information...
2 parents dfda903 + d54387c commit 49f2afd91dcb43ec85db64b8969d77b73b8532a8 @xstevens xstevens committed Feb 20, 2013
Showing with 15 additions and 5 deletions.
  1. +15 −5 src/main/pig/telemetry_chrome_hangs.pig
@@ -9,11 +9,21 @@ SET pig.logfile telemetry-chrome-hangs.log;
SET mapred.compress.map.output true;
SET mapred.map.output.compression.codec org.apache.hadoop.io.compress.SnappyCodec;
+define IsMap com.mozilla.pig.filter.map.IsMap();
+define Size com.mozilla.pig.eval.Size();
+
raw = LOAD 'hbase://telemetry' USING com.mozilla.pig.load.HBaseMultiScanLoader('$start_date', '$end_date', 'yyyyMMdd', 'data:json') AS (k:chararray, json:chararray);
+
genmap = FOREACH raw GENERATE k,json,com.mozilla.pig.eval.json.JsonMap(json) AS json_map:map[];
-filtered_genmap = FILTER genmap BY json_map#'chromeHangs' IS NOT NULL AND
- com.mozilla.pig.eval.Size(json_map#'chromeHangs') > 0 AND
- json_map#'info'#'appUpdateChannel' == 'nightly' AND
- json_map#'info'#'OS' == 'WINNT';
+
+filtered_genmap = FILTER genmap BY (json_map#'chromeHangs' IS NOT NULL
+ AND IsMap(json_map#'chromeHangs')
+ AND json_map#'chromeHangs'#'memoryMap' IS NOT NULL
+ AND Size(json_map#'chromeHangs'#'memoryMap') > 0)
+ OR (json_map#'lateWrites' IS NOT NULL
+ AND IsMap(json_map#'lateWrites')
+ AND json_map#'lateWrites'#'memoryMap' IS NOT NULL
+ AND Size(json_map#'lateWrites'#'memoryMap') > 0);
+
orig_data = FOREACH filtered_genmap GENERATE k,json;
-STORE orig_data INTO 'chrome-hangs-$start_date-$end_date';
+STORE orig_data INTO 'chrome-hangs-$start_date-$end_date';

0 comments on commit 49f2afd

Please sign in to comment.