All Projects → peek → Peek

peek / Peek

Licence: mit
Take a peek into your Rails applications.

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Peek

Exceptionless
Exceptionless server and jobs
Stars: ✭ 2,107 (-33.17%)
Mutual labels:  redis, elasticsearch
Firecamp
Serverless Platform for the stateful services
Stars: ✭ 194 (-93.85%)
Mutual labels:  redis, elasticsearch
Operators
Collection of Kubernetes Operators built with KUDO.
Stars: ✭ 175 (-94.45%)
Mutual labels:  redis, elasticsearch
Spring Boot Leaning
Spring Boot 2.X 最全课程代码
Stars: ✭ 2,008 (-36.31%)
Mutual labels:  redis, elasticsearch
Poseidon
poseidon项目是基于Java的商城项目,包括前台商城(),后台管理系统。系统采用SpringCloud+SpringBoot+Mybatis+React等框架进行开发。包括首页展示,商品搜索,商品推荐,购物车,订单等模块。
Stars: ✭ 261 (-91.72%)
Mutual labels:  redis, elasticsearch
Albert
这个是我个人网站的项目,欢迎贡献代码,力求能够应用到实际工作中java相关的大多数技术栈。有兴趣请Star一下,非常感谢。qq交流群:587577705 这个项目将不断地更新!生产环境:
Stars: ✭ 168 (-94.67%)
Mutual labels:  redis, elasticsearch
Workarea
Workarea is an enterprise-grade Ruby on Rails commerce platform
Stars: ✭ 290 (-90.8%)
Mutual labels:  redis, elasticsearch
Vagrant Elastic Stack
Giving the Elastic Stack a try in Vagrant
Stars: ✭ 131 (-95.85%)
Mutual labels:  redis, elasticsearch
Advanced Java
😮 Core Interview Questions & Answers For Experienced Java(Backend) Developers | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识
Stars: ✭ 59,142 (+1775.74%)
Mutual labels:  redis, elasticsearch
Syncclient
syncClient,数据实时同步中间件(同步mysql到kafka、redis、elasticsearch、httpmq)!
Stars: ✭ 227 (-92.8%)
Mutual labels:  redis, elasticsearch
Pifpaf
Python fixtures and daemon managing tools for functional testing
Stars: ✭ 161 (-94.89%)
Mutual labels:  redis, elasticsearch
Korio
Korio: Kotlin cORoutines I/O : Virtual File System + Async/Sync Streams + Async TCP Client/Server + WebSockets for Multiplatform Kotlin 1.3
Stars: ✭ 282 (-91.06%)
Mutual labels:  redis, elasticsearch
Sns Forum Website
牛客网高级项目(SNS+社区问答类网站)
Stars: ✭ 143 (-95.46%)
Mutual labels:  redis, elasticsearch
Lyonblog
基于Java8的SSM+Elasticsearch全文检索的个人博客系统
Stars: ✭ 169 (-94.64%)
Mutual labels:  redis, elasticsearch
Echo
🦄 开源社区系统:基于 SpringBoot + MyBatis + MySQL + Redis + Kafka + Elasticsearch + Spring Security + ... 并提供详细的开发文档和配套教程。包含帖子、评论、私信、系统通知、点赞、关注、搜索、用户设置、数据统计等模块。
Stars: ✭ 129 (-95.91%)
Mutual labels:  redis, elasticsearch
Mage2vuestorefront
Magento to Vue-storefront datapump - synchronizes Products, Categories and Product-to-category links between your Magento2 API and NoSQL database of vue-storefront
Stars: ✭ 183 (-94.2%)
Mutual labels:  redis, elasticsearch
Spring Boot Examples
🥗​ Spring/SpringBoot/SpringCloud 实践学习案例,从入门到精通,持续更新中,欢迎交流学习🍺 !
Stars: ✭ 110 (-96.51%)
Mutual labels:  redis, elasticsearch
Spring Boot Quick
🌿 基于springboot的快速学习示例,整合自己遇到的开源框架,如:rabbitmq(延迟队列)、Kafka、jpa、redies、oauth2、swagger、jsp、docker、spring-batch、异常处理、日志输出、多模块开发、多环境打包、缓存cache、爬虫、jwt、GraphQL、dubbo、zookeeper和Async等等📌
Stars: ✭ 1,819 (-42.31%)
Mutual labels:  redis, elasticsearch
Springboot Learning Example
spring boot 实践学习案例,是 spring boot 初学者及核心技术巩固的最佳实践。
Stars: ✭ 14,640 (+364.32%)
Mutual labels:  redis, elasticsearch
Springboot Learn
🌹springboot常用框架整合示例,涉及多种网站监控,数据缓存,网络通信,持久层,权限管理,常用工具等
Stars: ✭ 270 (-91.44%)
Mutual labels:  redis, elasticsearch

Peek

Build Status Gem Version Inline docs

Take a peek into your Rails application.

Preview

This is a profiling tool originally built at GitHub to help us get an insight into our application. Now, we have extracted this into Peek, so that other Rails applications can experience the same benefit.

Peek puts a little bar on top of your application to show you all sorts of helpful information about your application. From the screenshot above, you can see that Peek provides information about database queries, cache, Resque workers and more. However, this is only part of Peek's beauty.

The true beauty of Peek lies in the fact that it is an extensible platform. If there are some performance metrics that you need but are not available on Peek, you can find them in the list of available Peek Views and integrate them into Peek. Even if you do not find what you want on Peek Views, you can always create your own.

Installation

Add this line to your application's Gemfile:

gem 'peek'

And then execute:

$ bundle

Or install it yourself as:

$ gem install peek

Usage

Now that Peek is installed, you'll need to mount the engine within your config/routes.rb file:

Some::Application.routes.draw do
  mount Peek::Railtie => '/peek'
  root to: 'home#show'
end

To pick which views you want to see in your Peek bar, just create a file at config/initializers/peek.rb that has a list of the views you'd like to include:

Peek.into Peek::Views::Git, nwo: 'github/janky'
Peek.into Peek::Views::Mysql2
Peek.into Peek::Views::Redis
Peek.into Peek::Views::Dalli

Feel free to pick and install from the list or create your own. The order they are added to Peek is the order they will appear in your bar.

Next, to render the Peek bar in your application, add the following snippet just after the opening <body> tag in your application layout.

<%= render 'peek/bar' %>

It will look like:

<html>
  <head>
    <title>Application</title>
  </head>
  <body>
    <%= render 'peek/bar' %>
    <%= yield %>
  </body>
</html>

Peek fetches the data collected throughout your requests by using the unique request id that was assigned to the request by Rails. It will call out to its own controller at Peek::ResultsController which will render the data and be inserted into the bar.

Now that you have the partials in your application, you will need to include the CSS and JS that help make Peek

In app/assets/stylesheets/application.scss:

//= require peek

In app/assets/javascripts/application.coffee:

#= require jquery
#= require jquery_ujs
#= require peek

Note: Each additional view may have their own CSS and JS that you may need to require which should be stated in their usage documentation.

Configuring the default adapter

For Peek to work, it keeps track of all requests made in your application so it can report back and display that information in the Peek bar. By default it stores this information in memory, which is not recommended for production environments.

In production environments you may have application servers on multiple hosts. Peek will not be able to access the request data if it was saved in memory on another host. Peek provides additional adapters for multi server environments.

You can configure which adapter Peek uses by updating your application config or an individual environment config file. We'll use production as an example.

Note: Peek does not provide the dependencies for each of these adapters. If you use these adapters be sure to include their dependencies in your application.

Peeked::Application.configure do
  # ...

  # Redis with no options
  config.peek.adapter = :redis

  # Redis with options
  config.peek.adapter = :redis, {
    client: Redis.new,
    expires_in: 60 * 30 # => 30 minutes in seconds
  }

  # Memcache with no options
  config.peek.adapter = :memcache

  # Memcache with options
  config.peek.adapter = :memcache, {
    client: Dalli::Client.new,
    expires_in: 60 * 30 # => 30 minutes in seconds
  }

  # Elasticsearch with no options
  config.peek.adapter = :elasticsearch

  # Elasticsearch with options
  config.peek.adapter = :elasticsearch, {
    client: Elasticsearch::Client.new,
    expires_in: 60 * 30, # => 30 minutes in seconds
    index: 'peek_requests_index',
    type: 'peek_request'
  }

  # ...
end

Peek doesn't persist the request data forever. It uses a safe 30 minute cache length so that data will be available if you'd like to aggregate it or use it for other Peek views. You can update this to be 30 seconds if you don't want the data to be available for these or other uses.

Customizing the bar

You can customize the appearance of the bar by customizing it in your own application's CSS.

One common example is fixing the peek bar to the bottom, rather than top, of a page, for use with Bootstrap:

#peek {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

Using Peek with PJAX

It just works.

Using Peek with Turbolinks

It just works.

Access Control

Peek will only render in development and staging environments. If you'd like to whitelist a select number of users to view Peek in production you can override the peek_enabled? guard in ApplicationController:

class ApplicationController < ActionController::Base
  def peek_enabled?
    current_user.staff?
  end
end

Available Peek views

Feel free to submit a Pull Request adding your own Peek item to this list.

Creating your own Peek item

Each Peek item is a self contained Rails engine which gives you the power to use all features of Ruby on Rails to dig in deep within your application and report it back to the Peek bar. A Peek item is just a custom class that is responsible for fetching and building the data that should be reported back to the user.

There are still some docs to be written, but if you'd like to check out a simple example of how to create your own, just checkout peek-git. To just look at an example view, there is Peek::Views::Git.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].