Skip to content

Commit

Permalink
Use correct statsd
Browse files Browse the repository at this point in the history
  • Loading branch information
dturn committed Oct 24, 2019
1 parent aa8617f commit ea2a014
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/krane/global_deploy_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,27 @@ def run!(verify_result: true, prune: true)
logger.phase_heading("Deploying all resources")
deploy!(resources, verify_result, prune)

StatsD.event("Deployment succeeded",
KubernetesDeploy::StatsD.event("Deployment succeeded",
"Successfully deployed all resources to #{context}",
alert_type: "success", tags: statsd_tags << "status:success")
StatsD.distribution('all_resources.duration', KubernetesDeploy::StatsD.duration(start),
KubernetesDeploy::StatsD.distribution('all_resources.duration', KubernetesDeploy::StatsD.duration(start),
tags: statsd_tags << "status:success")
logger.print_summary(:success)
rescue KubernetesDeploy::DeploymentTimeoutError
logger.print_summary(:timed_out)
StatsD.event("Deployment timed out",
KubernetesDeploy::StatsD.event("Deployment timed out",
"One or more resources failed to deploy to #{context} in time",
alert_type: "error", tags: statsd_tags << "status:timeout")
StatsD.distribution('all_resources.duration', KubernetesDeploy::StatsD.duration(start),
KubernetesDeploy::StatsD.distribution('all_resources.duration', KubernetesDeploy::StatsD.duration(start),
tags: statsd_tags << "status:timeout")
raise
rescue KubernetesDeploy::FatalDeploymentError => error
logger.summary.add_action(error.message) if error.message != error.class.to_s
logger.print_summary(:failure)
StatsD.event("Deployment failed",
KubernetesDeploy::StatsD.event("Deployment failed",
"One or more resources failed to deploy to #{context}",
alert_type: "error", tags: statsd_tags << "status:failed")
StatsD.distribution('all_resources.duration', KubernetesDeploy::StatsD.duration(start),
KubernetesDeploy::StatsD.distribution('all_resources.duration', KubernetesDeploy::StatsD.duration(start),
tags: statsd_tags << "status:failed")
raise
end
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/test_provisioner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class << self
def prepare_cluster
WebMock.allow_net_connect!
$stderr.print("Preparing test cluster... ")
[ENV['PARALLELISM'].to_i, 2].max.times { |i| prepare_pv("pv000#{i}") }
[ENV['PARALLELISM'].to_i, 4].max.times { |i| prepare_pv("pv000#{i}") }
$stderr.puts "Done."
WebMock.disable_net_connect!
end
Expand Down

0 comments on commit ea2a014

Please sign in to comment.