Skip to content

Commit

Permalink
Added option for forever counters.
Browse files Browse the repository at this point in the history
In addition to c:ts:word counters, we'll have c:word counters.
  • Loading branch information
dustin committed Jun 15, 2012
1 parent 748055a commit a38a616
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions stream.go
Expand Up @@ -37,6 +37,7 @@ var recordTo = flag.String("record", "", "Record the stream to a file")
var multiplier = flag.Int("multiplier", 1, "Tweet multiplier")
var mcServer = flag.String("memcached", "localhost:11211",
"host:port of your memcached server")
var foreverWords = flag.Bool("forever", false, "Keep \"forever\" counters")

func parseNext(d *json.Decoder) (rv Tweet, err error) {
err = d.Decode(&rv)
Expand Down
3 changes: 3 additions & 0 deletions updater.go
Expand Up @@ -144,6 +144,9 @@ func process(client *memcached.Client, prefix string, t *Tweet) {
if err != nil {
log.Fatalf("Error incrementing %v: %v", k, err)
}
if *foreverWords {
_, err = client.Incr(0, cPrefix+w, count, 1, 0)
}
}
updateList(client, prefix, totals)
}

0 comments on commit a38a616

Please sign in to comment.