Code Monkey home page Code Monkey logo

komachi_heartbeat's Introduction

KomachiHeartbeat

Gem Version Build Status

About

Rails アプリケーションとDBサーバーの死活監視するためのURLを提供するEngine

死活監視

/MOUNT_PATH/heartbeat

アプリケーションの状態に問題がなければ

  • Status: 200 OK
  • body: ok

を返す

チェック可能項目

  • Web
  • DB
  • Redis
  • Memcached

バージョン確認

/MOUNT_PATH/version

アプリ名・バージョン・REVISION を取得する

WorkerのQueue監視

/MOUNT_PATH/stats/worker

  • enqueued (処理待ちのQueueの数)
  • processed (完了したQueueの数)

を返す

SidekiqResque に対応しています。

Usage

  1. write Gemfile gem "komachi_heartbeat"
  2. bundle install
  3. write config/routes.rb mount KomachiHeartbeat::Engine => "/ops"

Configure

Parameters

  • application_version
  • application_name
  • db_check_enabled
  • DBのチェックを行うかどうか
  • default: true
  • database_class_names
  • DBのチェックに利用するクラス名の配列
  • default: ["ActiveRecord::Base"]
  • redis_check_enabled
  • Redisをチェックするかどうか
  • default: false
  • redis_servers
  • Redisサーバーへの接続情報のハッシュの配列
  • default: [{host: "localhost", port: 6379, db: 0}]
  • memcached_check_enabled
  • Memcachedをチェックするかどうか
  • default: false
  • memcached_server_names
  • Memcachedのサーバー名、接続ポート(省略時はデフォルトポート)をつなげた文字列の配列 e.g. ['one.example.com:11211', 'two.example.com:11211']
  • default: ['localhost']
  • worker_stats_enabled
  • WorkerのQueueの数をチェックするかどうか
  • default: false
  • revision_path
  • REVISION ファイルの位置
  • default: -> { Rails.root.join("REVISION") }

Example

Rails.application.config.heartbeat.application_name = "YOUR APP NAME"
Rails.application.config.heartbeat.application_version = "YOUR APP version"

see https://github.com/mitaku/komachi_heartbeat/blob/master/spec/dummy/config/application.rb

This project rocks and uses MIT-LICENSE.

komachi_heartbeat's People

Contributors

mitaku avatar onk avatar shishi avatar sue445 avatar takanamito avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.