Upgrade to Pro — share decks privately, control downloads, hide ads and more …

あんしん大規模リプレースサポート

 あんしん大規模リプレースサポート

takanamito

June 15, 2016
Tweet

More Decks by takanamito

Other Decks in Programming

Transcript

  1. concernsͱservicesʹӅṭ class AreasController < ApplicationController include Redirectable # چURL def

    area_list redirect(:area) if redirectable?(:area) end # ৽URL def show ~~ ϖʔδੜ੒ॲཧ ~~ end end
  2. concernsͱservicesʹӅṭ concern :Redirectable do def redirectable?(controller_name) path = request.path case

    controller_name when :area results = REDIRECT_PATHS.map { |target| path.include? (target) } results.include?(true) end def redirect(controller_name, request_params = nil) redirector = Redirector::Factory.create(controller_name) redirect_path = redirector.redirect_path(request_params) redirect_to(redirect_path, status: :moved_permanently) end end ϦμΠϨΫτՄ൱Λ ൑ఆ TFSWJDFΫϥεͰ ઌͷύεΛੜ੒
  3. kage Kage::ProxyServer.start do |server| server.port = 8090 server.host = '0.0.0.0'

    server.add_master_backend(:production, 'localhost', 80) server.add_backend(:sandbox, 'localhost', 80) server.client_timeout = 15 server.backend_timeout = 10 server.on_select_backends do |request, headers| if request[:method] == 'GET' [:production, :sandbox] else [:production] end end ~~ தུ ~~ end def compare(production_res, sandbox_res, url) # ͜ͷลͰresponseݟͯϩάग़ͨ͠Γ͢Δ end
  4. <source> @type tail path /var/log/nginx/access.log format ltsv time_format %d/%b/%Y:%H:%M:%S %z

    pos_file /tmp/fluent.log.pos tag nginx.access </source> <match nginx.access> @type copy # εςʔλεͷΧ΢ϯτ <store> @type datacounter tag status.count count_key status unit minute pattern1 2xx ^2\d\d$ pattern2 3xx ^3\d\d$ pattern3 4xx ^4\d\d$ pattern4 5xx ^5\d\d$ @label @status </store> # ϨεϙϯελΠϜຖͷׂ߹ <store> @type numeric_counter tag response_time.percentage unit minute count_key response_time pattern1 u10ms 0 0.01 pattern2 u50ms 0.01 0.05 pattern3 u100ms 0.05 0.1 pattern4 u500ms 0.1 0.5 pattern5 u1s 0.5 1 pattern6 u3s 1 3 pattern7 long 3 @label @response_time </store> # ϨεϙϯελΠϜͷύʔηϯλΠϧ஋ <store> @type numeric_monitor tag response_time.percentile unit minute monitor_key response_time percentiles 50, 90, 95, 98 @label @percentile </store> </match>