Skip to content

Commit

Permalink
Merge branch 'rmstat'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robey Pointer committed Sep 20, 2011
2 parents 45344f3 + fd867cb commit 1f891e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -134,6 +134,10 @@ class StatsCollection extends StatsProvider with JsonSerializable {
counter
}

def removeCounter(name: String) {
counterMap.remove(name)
}

protected def newCounter(name: String) = {
new Counter()
}
Expand Down
Expand Up @@ -74,6 +74,14 @@ object StatsCollectionSpec extends Specification {
collection.incr("widgets", -1)
collection.getCounters() mustEqual Map("widgets" -> 2)
}

"clearCounter" in {
collection.getCounter("smellyfeet")
collection.incr("smellyfeet", 1)
collection.getCounters() mustEqual Map("smellyfeet" -> 1)
collection.removeCounter("smellyfeet")
collection.getCounters() mustEqual Map()
}
}

"metrics" in {
Expand Down

0 comments on commit 1f891e0

Please sign in to comment.