lib/tabs/tabs.rb in tabs-0.5.0 vs lib/tabs/tabs.rb in tabs-0.5.2
- old
+ new
@@ -42,16 +42,26 @@
metrics = get("metrics")
type = metrics[key]
metric_klass(type).new(key)
end
+ def get_stats(key, period, resolution)
+ metric = get_metric(key)
+ metric.stats(period, resolution)
+ end
+
def metric_type(key)
hget "metrics", key
end
def drop_metric(key)
hdel "metrics", key
- # TODO: Need to finish this
+ Tabs::RESOLUTIONS.each do |resolution|
+ stat_key = "stat:keys:#{key}:#{resolution}"
+ keys = smembers(stat_key)
+ del(keys)
+ del stat_key
+ end
end
def list_metrics
hkeys "metrics"
end