Skip to content

Commit

Permalink
Create handler correctly in send_local_metrics
Browse files Browse the repository at this point in the history
[Finishes #50766169]
  • Loading branch information
Chris Brown and Mark Rushakoff committed May 29, 2013
1 parent 5867791 commit 3b7e86c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion collector/lib/collector.rb
Expand Up @@ -122,7 +122,9 @@ def prune_components

# Generates metrics that don't require any interactions with varz or healthz
def send_local_metrics
handler = Handler.handler(@historian, "collector", Config.index, Time.now.to_i)
# TODO: we're using an empty hash for the handler's varz, so this may cause problems if the varz
# provides information required for any tags (e.g. in the DEA handler).
handler = Handler.handler(@historian, "collector", Config.index, Time.now.to_i, {})
handler.send_latency_metric("nats.latency.1m", @nats_latency.value)
end

Expand Down
2 changes: 1 addition & 1 deletion collector/spec/unit/collector_spec.rb
Expand Up @@ -193,7 +193,7 @@ def send_local_metrics
yield handler

Collector::Handler.should_receive(:handler).
with(kind_of(Collector::Historian), "collector", 0, 1000).
with(kind_of(Collector::Historian), "collector", 0, 1000, {}).
and_return(handler)

collector.send_local_metrics
Expand Down

0 comments on commit 3b7e86c

Please sign in to comment.