Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Change component:dea to component:app
Browse files Browse the repository at this point in the history
  • Loading branch information
David Sabeti and Jeff Schnitzer committed Jun 5, 2013
1 parent 8dceb16 commit 869d574
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions collector/lib/collector/handlers/router.rb
Expand Up @@ -12,11 +12,11 @@ def process(context)
varz["tags"].each do |key, values|
values.each do |value, metrics|
if key == "component" && value.start_with?("dea-")

# Sorry for this gem. We want to grab the DEA's number instead of its guid
# i.e. dea-1-deadbeef should be parsed out to 1. The dea- is there by convention
# dea_id looks like "dea-1", "dea-2", etc
dea_id = value.split("-")[1]
tags = {:component => "dea", :dea_index => dea_id }

# These are app requests, not requests to the dea. So we change the component to "app".
tags = {:component => "app", :dea_index => dea_id }
else
tags = {key => value}
end
Expand Down
2 changes: 1 addition & 1 deletion collector/spec/unit/collector/handlers/router_spec.rb
Expand Up @@ -137,7 +137,7 @@ def has_sent_data?(key, value, tags={})
it "sends metrics tagged with component:dea and dea_index:x" do
varz['tags']['component']['dea-2'] = component

tags = {:component => "dea", :dea_index => "2"}
tags = {:component => "app", :dea_index => "2"}

handler.process(context)
historian.should have_sent_data("router.requests", 2400, tags)
Expand Down

0 comments on commit 869d574

Please sign in to comment.