Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: tools/lua/ngrams.lua

Issue 1214843002: Add script for triggering Cluster Telemetry jobs using local scripts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/lua/trigger_ct_lua » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 -- Generate n-grams of Skia API calls from SKPs. 1 -- Generate n-grams of Skia API calls from SKPs.
2 2
3 -- To test this locally, run: 3 -- To test this locally, run:
4 -- $ GYP_DEFINES="skia_shared_lib=1" make lua_pictures 4 -- $ GYP_DEFINES="skia_shared_lib=1" make lua_pictures
5 -- $ out/Debug/lua_pictures -q -r $SKP_DIR -l tools/lua/ngrams.lua > /tmp/lua-ou tput && lua tools/lua/ngrams_aggregate.lua 5 -- $ out/Debug/lua_pictures -q -r $SKP_DIR -l tools/lua/ngrams.lua > /tmp/lua-ou tput
6 -- $ lua tools/lua/ngrams_aggregate.lua
6 7
7 -- To run on Cluster Telemetry, copy and paste the contents of this file into 8 -- To run on Cluster Telemetry, copy and paste the contents of this file into
8 -- the box at https://skia-tree-status.appspot.com/skia-telemetry/lua_script, 9 -- the box at https://skia-tree-status.appspot.com/skia-telemetry/lua_script,
9 -- and paste the contents of ngrams_aggregate.lua into the "aggregator script" 10 -- and paste the contents of ngrams_aggregate.lua into the "aggregator script"
10 -- box on the same page. 11 -- box on the same page.
11 12
12 -- Change n as desired. 13 -- Change n as desired.
13 local n = 3 14 local n = 3
14 15
15 -- This algorithm uses a list-of-lists for each SKP. For API call, append a 16 -- This algorithm uses a list-of-lists for each SKP. For API call, append a
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 counts[ngram] = counts[ngram] + 1 54 counts[ngram] = counts[ngram] + 1
54 end 55 end
55 end 56 end
56 end 57 end
57 58
58 -- Write out code for aggregating. 59 -- Write out code for aggregating.
59 for ngram, count in pairs(counts) do 60 for ngram, count in pairs(counts) do
60 io.write("if counts['", ngram, "'] == nil then counts['", ngram, "'] = ", co unt, " else counts['", ngram, "'] = counts['", ngram, "'] + ", count, " end\n") 61 io.write("if counts['", ngram, "'] == nil then counts['", ngram, "'] = ", co unt, " else counts['", ngram, "'] = counts['", ngram, "'] + ", count, " end\n")
61 end 62 end
62 end 63 end
OLDNEW
« no previous file with comments | « no previous file | tools/lua/trigger_ct_lua » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698