Skip to content

Commit

Permalink
Fix missing test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
grobie committed Sep 9, 2016
1 parent 8aba7e1 commit 5e16541
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ histogram = Prometheus::Client::Histogram.new(:service_latency_seconds, '...')
# record a value
histogram.observe({ service: 'users' }, Benchmark.realtime { service.call(arg) })

# retrieve the current quantile values
# retrieve the current bucket values
histogram.get({ service: 'users' })
# => { 0.005 => 3, 0.01 => 15, 0.025 => 18, ..., 2.5 => 42, 5 => 42, 10 = >42 }
```
Expand All @@ -162,10 +162,6 @@ summary.get({ service: 'database' })
# => { 0.5 => 0.1233122, 0.9 => 3.4323, 0.99 => 5.3428231 }
```

## Todo

* add protobuf support

## Tests

Install necessary development gems with `bundle install` and run tests with
Expand Down
5 changes: 0 additions & 5 deletions lib/prometheus/client/metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ def initialize(name, docstring, base_labels = {})
@base_labels = base_labels
end

# Returns the metric type
def type
raise NotImplementedError
end

# Returns the value for the given label set
def get(labels = {})
@validator.valid?(labels)
Expand Down
10 changes: 6 additions & 4 deletions spec/prometheus/client/push_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
expect(push.gateway).to eql('http://pu.sh:1234')
end

it 'raises an ArgumentError if a given gateway URL can not be parsed' do
expect do
Prometheus::Client::Push.new('test-job', nil, 'inva.lid:1233')
end.to raise_error ArgumentError
it 'raises an ArgumentError if the given gateway URL is invalid' do
['inva.lid:1233', 'http://[invalid]'].each do |url|
expect do
Prometheus::Client::Push.new('test-job', nil, url)
end.to raise_error ArgumentError
end
end
end

Expand Down

0 comments on commit 5e16541

Please sign in to comment.