Commit ff98921335def95aebf4415c69f785dca02cbcc9
Show peek intervals
cel committed on 3/6/2021, 5:17:45 PMParent: e531c0e256161a5923b906a32a4573262242f0a3
Files changed
counts.js | changed |
counts.js | |||
---|---|---|---|
@@ -45,8 +45,11 @@ | |||
45 | 45 … | function toISODateString(d) { | |
46 | 46 … | return d.toISOString().replace(/T.*/, '') | |
47 | 47 … | } | |
48 | 48 … | ||
49 … | +var max = 0 | ||
50 … | +var maxDate | ||
51 … | + | ||
49 | 52 … | pull( | |
50 | 53 … | File(path.join(__dirname, series + '.jsonp')), | |
51 | 54 … | Split(), | |
52 | 55 … | pull.filter(Boolean), | |
@@ -55,9 +58,11 @@ | |||
55 | 58 … | var ms = interval.time * unit | |
56 | 59 … | if (ms > last) return | |
57 | 60 … | var d = new Date(ms) | |
58 | 61 … | var count = interval.ids.length | |
62 … | + if (count > max) max = count, maxDate = d | ||
59 | 63 … | console.log(toISODateString(d), count) | |
60 | 64 … | }, function (err) { | |
61 | 65 … | if (err) throw err | |
66 … | + console.log(toISODateString(maxDate), max, 'max') | ||
62 | 67 … | }) | |
63 | 68 … | ) |
Built with git-ssb-web