Permalink
Browse files

Cleanup

  • Loading branch information...
1 parent 8455d0e commit 53fb71a8e6bceb1330089e1671427699b2e8d158 @eric committed Feb 1, 2012
Showing with 17 additions and 14 deletions.
  1. +1 −1 LICENSE
  2. +13 −10 lib/metriks/registry.rb
  3. +3 −3 metriks.gemspec
View
@@ -1,6 +1,6 @@
The MIT License
-Copyright (c) Tom Preston-Werner
+Copyright (c) 2012 Eric Lindvall
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -1,4 +1,7 @@
require 'metriks/counter'
+require 'metriks/timer'
+require 'metriks/utilization_timer'
+require 'metriks/meter'
class Metriks::Registry
def initialize
@@ -22,7 +25,17 @@ def meter(name)
add_or_get(name, Metriks::Meter)
end
+ def add(name, metric)
+ @mutex.synchronize do
+ if @metrics[name]
+ raise "Metric '#{name}' already defined"
+ else
+ @metrics[name] = metric
+ end
+ end
+ end
+ protected
def add_or_get(name, klass)
@mutex.synchronize do
if metric = @metrics[name] && !metric.is_a?(klass)
@@ -34,14 +47,4 @@ def add_or_get(name, klass)
end
end
end
-
- def add(name, metric)
- @mutex.synchronize do
- if @metrics[name]
- raise "Metric '#{name}' already defined"
- else
- @metrics[name] = metric
- end
- end
- end
end
View
@@ -18,8 +18,8 @@ Gem::Specification.new do |s|
## Make sure your summary is short. The description may be as long
## as you like.
- s.summary = "Short description used in Gem listings."
- s.description = "Long description. Maybe copied from the README."
+ s.summary = "An experimental metrics client"
+ s.description = "An experimental metrics client."
## List the primary authors. If there are a bunch of authors, it's probably
## better to set the email to an email list or something. If you don't have
@@ -57,5 +57,5 @@ Gem::Specification.new do |s|
## Test files will be grabbed from the file list. Make sure the path glob
## matches what you actually use.
- s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
+ s.test_files = s.files.select { |path| path =~ /^test\/.*_test\.rb/ }
end

0 comments on commit 53fb71a

Please sign in to comment.