Skip to content

Commit

Permalink
Merge pull request #160 from zyjiaobj/dev_health
Browse files Browse the repository at this point in the history
add health and cutoff config
  • Loading branch information
paltanmoy authored Dec 10, 2018
2 parents c4ec6d2 + 8dd9137 commit a91faf7
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 27 deletions.
4 changes: 3 additions & 1 deletion jobs/eventgenerator/spec
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,6 @@ properties:
description: "Number of consecutive failure to trip the circuit down"
default: 3


autoscaler.eventgenerator.health.port:
description: "the listening port of health endpoint"
default: 6204
2 changes: 2 additions & 0 deletions jobs/eventgenerator/templates/eventgenerator.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ server:
logging:
level: <%= p("autoscaler.eventgenerator.logging.level") %>
http_client_timeout: <%= p("autoscaler.eventgenerator.http_client_timeout") %>
health:
port: <%= p("autoscaler.eventgenerator.health.port") %>

db:
policy_db:
Expand Down
3 changes: 3 additions & 0 deletions jobs/metricscollector/spec
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ properties:
description: "the method to collect metrics from loggregator"
default: "streaming"

autoscaler.metricscollector.health.port:
description: "the listening port of health endpoint"
default: 6203
2 changes: 2 additions & 0 deletions jobs/metricscollector/templates/metricscollector.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ server:
logging:
level: <%= p("autoscaler.metricscollector.logging.level") %>
http_client_timeout: <%= p("autoscaler.metricscollector.http_client_timeout") %>
health:
port: <%= p("autoscaler.metricscollector.health.port") %>

db:
policy_db:
Expand Down
18 changes: 10 additions & 8 deletions jobs/operator/spec
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,23 @@ properties:
autoscaler.operator.instance_metrics_db.refresh_interval:
description: "the time interval to prune the instancemetrics database"
default: 24h
autoscaler.operator.instance_metrics_db.cutoff_days:
autoscaler.operator.instance_metrics_db.cutoff_duration:
description: "the cutoff days when pruning instancemetrics database"
default: 30
default: 24h

autoscaler.operator.app_metrics_db.refresh_interval:
description: "the time interval to prune the appmetrics database"
default: 24h
autoscaler.operator.app_metrics_db.cutoff_days:
autoscaler.operator.app_metrics_db.cutoff_duration:
description: "the cutoff days when pruning appmetrics database"
default: 30
default: 48h

autoscaler.operator.scaling_engine_db.refresh_interval:
description: "the time interval to prune the scalingengine database"
default: 24h
autoscaler.operator.scaling_engine_db.cutoff_days:
autoscaler.operator.scaling_engine_db.cutoff_duration:
description: "the cutoff days when pruning scalingengine database"
default: 30
default: 240h

autoscaler.operator.scaling_engine.host:
description: "Host where the scaling engine is running"
Expand Down Expand Up @@ -222,5 +222,7 @@ properties:
autoscaler.operator.enable_db_lock:
description: "Enable database lock flag"
default: false



autoscaler.operator.health.port:
description: "the listening port of health endpoint"
default: 6208
8 changes: 5 additions & 3 deletions jobs/operator/templates/operator.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ cf:

logging:
level: <%= p("autoscaler.operator.logging.level") %>
health:
port: <%= p("autoscaler.operator.health.port") %>
http_client_timeout: <%= p("autoscaler.operator.http_client_timeout") %>
instance_metrics_db:
db:
Expand All @@ -57,7 +59,7 @@ instance_metrics_db:
max_idle_connections: <%= p("autoscaler.instancemetrics_db_connection_config.max_idle_connections") %>
connection_max_lifetime: <%= p("autoscaler.instancemetrics_db_connection_config.connection_max_lifetime") %>
refresh_interval: <%= p("autoscaler.operator.instance_metrics_db.refresh_interval") %>
cutoff_days: <%= p("autoscaler.operator.instance_metrics_db.cutoff_days") %>
cutoff_duration: <%= p("autoscaler.operator.instance_metrics_db.cutoff_duration") %>

app_metrics_db:
db:
Expand All @@ -66,7 +68,7 @@ app_metrics_db:
max_idle_connections: <%= p("autoscaler.appmetrics_db_connection_config.max_idle_connections") %>
connection_max_lifetime: <%= p("autoscaler.appmetrics_db_connection_config.connection_max_lifetime") %>
refresh_interval: <%= p("autoscaler.operator.app_metrics_db.refresh_interval") %>
cutoff_days: <%= p("autoscaler.operator.app_metrics_db.cutoff_days") %>
cutoff_duration: <%= p("autoscaler.operator.app_metrics_db.cutoff_duration") %>

scaling_engine_db:
db:
Expand All @@ -75,7 +77,7 @@ scaling_engine_db:
max_idle_connections: <%= p("autoscaler.scalingengine_db_connection_config.max_idle_connections") %>
connection_max_lifetime: <%= p("autoscaler.scalingengine_db_connection_config.connection_max_lifetime") %>
refresh_interval: <%= p("autoscaler.operator.scaling_engine_db.refresh_interval") %>
cutoff_days: <%= p("autoscaler.operator.scaling_engine_db.cutoff_days") %>
cutoff_duration: <%= p("autoscaler.operator.scaling_engine_db.cutoff_duration") %>

scaling_engine:
scaling_engine_url: https://<%= p("autoscaler.operator.scaling_engine.host") %>:<%= p("autoscaler.operator.scaling_engine.port") %>
Expand Down
5 changes: 1 addition & 4 deletions jobs/scalingengine/spec
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ properties:

autoscaler.scalingengine.health.port:
description: "the listening port of health endpoint"
default: 8081
autoscaler.scalingengine.health.emit_interval:
description: "the time interval to emit health metrics"
default: 15s
default: 6204

autoscaler.scalingengine.consul.cluster:
description: "Consul Cluster configuration. If not specified, scaling engine will not register itself with consul."
Expand Down
1 change: 0 additions & 1 deletion jobs/scalingengine/templates/scalingengine.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ logging:
http_client_timeout: <%= p("autoscaler.scalingengine.http_client_timeout") %>
health:
port: <%= p("autoscaler.scalingengine.health.port") %>
emit_interval: <%= p("autoscaler.scalingengine.health.emit_interval") %>

db:
policy_db:
Expand Down
3 changes: 3 additions & 0 deletions jobs/scheduler/spec
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,8 @@ properties:
autoscaler.policy_db.roles:
description: "The list of database roles used in policydb database including name/password"

autoscaler.scheduler.health.port:
description: "the listening port of health endpoint"
default: 6204


1 change: 1 addition & 0 deletions jobs/scheduler/templates/application.properties.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ org.quartz.scheduler.instanceId=<%= spec.id %>

# scheduler port
server.port=<%=p('autoscaler.scheduler.port') %>
scheduler.healthserver.port=<%=p('autoscaler.scheduler.health.port') %>

spring.application.name=scheduler
spring.mvc.servlet.load-on-startup=1
Expand Down
1 change: 0 additions & 1 deletion packages/eventgenerator/spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ files:
- app-autoscaler/src/autoscaler/db/sqldb/*.go # gosub
- app-autoscaler/src/autoscaler/eventgenerator/*.go # gosub
- app-autoscaler/src/autoscaler/eventgenerator/aggregator/*.go # gosub
- app-autoscaler/src/autoscaler/eventgenerator/aggregator/fakes/*.go # gosub
- app-autoscaler/src/autoscaler/eventgenerator/cmd/eventgenerator/*.go # gosub
- app-autoscaler/src/autoscaler/eventgenerator/config/*.go # gosub
- app-autoscaler/src/autoscaler/eventgenerator/generator/*.go # gosub
Expand Down
1 change: 0 additions & 1 deletion packages/metricscollector/spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ files:
- app-autoscaler/src/autoscaler/metricscollector/cmd/metricscollector/*.go # gosub
- app-autoscaler/src/autoscaler/metricscollector/collector/*.go # gosub
- app-autoscaler/src/autoscaler/metricscollector/config/*.go # gosub
- app-autoscaler/src/autoscaler/metricscollector/fakes/*.go # gosub
- app-autoscaler/src/autoscaler/metricscollector/noaa/*.go # gosub
- app-autoscaler/src/autoscaler/metricscollector/server/*.go # gosub
- app-autoscaler/src/autoscaler/metricscollector/testhelpers/*.go # gosub
Expand Down
1 change: 0 additions & 1 deletion packages/operator/spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ files:
- app-autoscaler/src/autoscaler/operator/*.go # gosub
- app-autoscaler/src/autoscaler/operator/cmd/operator/*.go # gosub
- app-autoscaler/src/autoscaler/operator/config/*.go # gosub
- app-autoscaler/src/autoscaler/operator/fakes/*.go # gosub
- app-autoscaler/src/autoscaler/routes/*.go # gosub
- app-autoscaler/src/autoscaler/sync/*.go # gosub
- app-autoscaler/src/code.cloudfoundry.org/cfhttp/*.go # gosub
Expand Down
1 change: 0 additions & 1 deletion packages/scalingengine/spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ files:
- app-autoscaler/src/autoscaler/scalingengine/*.go # gosub
- app-autoscaler/src/autoscaler/scalingengine/cmd/scalingengine/*.go # gosub
- app-autoscaler/src/autoscaler/scalingengine/config/*.go # gosub
- app-autoscaler/src/autoscaler/scalingengine/fakes/*.go # gosub
- app-autoscaler/src/autoscaler/scalingengine/schedule/*.go # gosub
- app-autoscaler/src/autoscaler/scalingengine/server/*.go # gosub
- app-autoscaler/src/code.cloudfoundry.org/cfhttp/*.go # gosub
Expand Down
2 changes: 1 addition & 1 deletion src/app-autoscaler
13 changes: 10 additions & 3 deletions templates/app-autoscaler-deployment-fewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ instance_groups:
port: &scalingEnginePort 6104
health:
port: &scalingEngineHealthPort 6204
emit_interval: 15s
defaultCoolDownSecs: 300
lockSize: 32
ca_cert: ((scalingengine_ca.ca))
Expand All @@ -149,6 +148,8 @@ instance_groups:
autoscaler:
scheduler:
port: &schedulerPort 6102
health:
port: &schedulerHealthPort 6202
http_client_timeout: 60
job_reschedule_interval_millisecond: 10000
job_reschedule_maxcount: 6
Expand Down Expand Up @@ -196,6 +197,8 @@ instance_groups:
logging:
level: debug
http_client_timeout: 60s
health:
port: &operatorHealthPort 6208
require_consul: false

# asapi Instance Group : apiserver&servicebroker
Expand Down Expand Up @@ -368,6 +371,8 @@ instance_groups:
http_client_timeout: 60s
server:
port: &metricsCollectorPort 6103
health:
port: &metricsCollectorHealthPort 6203
collector:
refresh_interval: 60s
collect_interval: 30s
Expand All @@ -390,6 +395,8 @@ instance_groups:
http_client_timeout: 60s
server:
port: &eventGeneratorPort 6105
health:
port: &eventGeneratorHealthPort 6205
ca_cert: ((eventgenerator_ca.ca))
server_cert: ((eventgenerator_server.certificate))
server_key: ((eventgenerator_server.private_key))
Expand All @@ -404,8 +411,8 @@ instance_groups:
evaluation_manager_execute_interval: 40s
evaluator_count: 20
trigger_array_channel_size: 200
defaultStatWindowSecs: 300
defaultBreachDurationSecs: 300
defaultStatWindowSecs: 120
defaultBreachDurationSecs: 120
circuitBreaker:
back_off_initial_interval: 5m
back_off_max_interval: 120m
Expand Down
11 changes: 9 additions & 2 deletions templates/app-autoscaler-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ instance_groups:
autoscaler:
scheduler:
port: &schedulerPort 6102
health:
port: &schedulerHealthPort 6202
http_client_timeout: 60
job_reschedule_interval_millisecond: 10000
job_reschedule_maxcount: 6
Expand Down Expand Up @@ -222,7 +224,7 @@ instance_groups:
consul:
agent:
services:
scalingengine:
scalingengine:
check:
tcp: 127.0.0.1:6104
interval: 30s
Expand All @@ -246,7 +248,6 @@ instance_groups:
port: &scalingEnginePort 6104
health:
port: &scalingEngineHealthPort 6204
emit_interval: 15s
defaultCoolDownSecs: 300
lockSize: 32
ca_cert: ((scalingengine_ca.ca))
Expand Down Expand Up @@ -363,6 +364,8 @@ instance_groups:
http_client_timeout: 60s
server:
port: &metricsCollectorPort 6103
health:
port: &metricsCollectorHealthPort 6203
collector:
refresh_interval: 60s
collect_interval: 30s
Expand Down Expand Up @@ -410,6 +413,8 @@ instance_groups:
http_client_timeout: 60s
server:
port: &eventGeneratorPort 6105
health:
port: &eventGeneratorHealthPort 6205
ca_cert: ((eventgenerator_ca.ca))
server_cert: ((eventgenerator_server.certificate))
server_key: ((eventgenerator_server.private_key))
Expand Down Expand Up @@ -498,6 +503,8 @@ instance_groups:
enable_db_lock: false
logging:
level: debug
health:
port: &operatorHealthPort 6208



Expand Down

0 comments on commit a91faf7

Please sign in to comment.