<p align="center">
<img src="public/pingpong-og.png" alt="Pingpong Logo">
</p>
<img src="https://travis-ci.org/keen/pingpong.png?branch=master&foo=bar" alt="Pingpong Build Status">
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
#### Get deeper HTTP request response analytics every second.
Track real-time performance and availability across multiple API servers to see the what, when, and how behind your system performance. So you can understand why.
![Pingpong Graph](http://keen.github.io/pingpong/img/chart_02_new.png)
#### How does it work?
+ Pingpong sends HTTP requests to URLs you configure as frequently as once per second. It turns data about each request and response into JSON, then logs it to a custom destination.
+ Your default data store is Keen IO’s [analytics API](https://keen.io/docs/) to capture events, run queries, and create visualizations. But it’s simple to set up another backend.
+ Pingpong ships with [Dashboards](http://keen.github.io/dashboards/), an HTML visualization kit that lets you see and arrange your most critical response data. Built on the Keen IO analytics API, Dashboards is super-flexible and ready to be skinned, tweaked, and embedded anywhere.
+ Pingpong captures most of the data you'd want about HTTP requests and responses. To beef up or slim down your data stream, adding custom properties specific to your infrastructure is simple.
#### Choose your own install adventure.
**Deploy straight to Heroku:** Pingpong is easy to install and ready for deployment to one or more Heroku regions. You can even deploy the app with a single click with this handy button:
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
*A note on event limits:* If you're using the Keen IO backend to store events, you can send 50,000 events for free per month. As a reference, one check running every minute will create about 43,000 events in a month. Check out [more plans](https://keen.io/pricing) to get more events. We'd also love to give you a discount if you're using Pingpong, just [email us](mailto:team@keen.io?subject=Pingpong Events) your project ID and we'll get you hooked up.
**Setup and deploy your own Pingpong app:** Don't run Heroku? That's cool. You can run Pingpong on any host with Ruby, even your local machine. Either way, it's up and running in less than five minutes. Just see the next section.
#### Setup & Deployment
Pingpong is open source and easy to install. Pingpong is written in Ruby and streamlined for deployment to one or more Heroku regions. That said, you can run it on any host with Ruby, including your local machine.
**Step 1:** Clone or fork this repository:
```
$ git clone git@github.com:keen/pingpong.git
$ cd pingpong
```
**Step 2:** Install dependencies
```
$ bundle install
```
If you don't have the `bundle` command, first `gem install bundler`.
**Step 3:** Set up database tables
```
$ bundle exec rake db:create
$ bundle exec rake db:migrate
```
The project uses Postgres as the default database, but you can modify that in the `database.yml` file.
**Step 4:** Set up the environment variables
***Keen IO Setup***
You'll need to sign up for a free [Keen IO](https://keen.io?s=pingpong) account. Once your account is set up, create a new project.
You'll need to grab the `project id`, `read key`, and `write key`. Add these to a root level file called `.env`. There's a .env.sample setup with all the variables, so just run:
```sh
$ cp .env.sample .env
```
And edit your Keen IO variables:
```
KEEN_PROJECT_ID=xxxxxxxxxxxxxxx
KEEN_READ_KEY=yyyyyyyyyyyyyyyyy
KEEN_WRITE_KEY=zzzzzzzzzzzzzzzz
```
***SendGrid Setup***
If you want to send emails, you'll have to sign up for a free [SendGrid](https://sendgrid.com/user/signup) account.
Once you've done that, edit the following in your `.env` file:
```
TO_EMAIL_ADDRESS=me@test.com
FROM_EMAIL_ADDRESS=pingpong@test.com
SKIP_EMAIL=false
SENDGRID_USERNAME=asdfasdfasdf
SENDGRID_PASSWORD=12345
```
***Slack Setup***
To get notifications in Slack, you'll have to provide us with your Incoming Webhook URL. You can create an Incoming Webhook [here](https://slack.com/services/new/incoming-webhook).
Once you've got the Webhook URL, update your `.env` file:
```
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXXXXXXXXXXXXXX/YYYYYYYYYYY
```
There are also some optional configurations you can edit for Slack notifications:
```
SLACK_CHANNEL='#alerts' # The channel to send notifications to
SLACK_USERNAME='Robot' # The username the notification will come from - defaults to Pingpong
SLACK_ICON=':rotating_light' # The icon of the user "sending" the notification. Can be a URL or an Emoji
WARN_COLOR='#CCCCCC' # Hex color value used for the warning messages - defaults to #E2E541
BAD_COLOR='#000000' # Hex color value used for the failure messages - defaults to #F25656
```
***Run the Server***
Now you're ready to start the web server locally using `foreman`, which will pick up the variables in the `.env` file. [foreman](https://github.com/ddollar/foreman) comes with the [Heroku toolbelt](https://toolbelt.heroku.com/).
```
$ foreman start
```
The Pingpong web interface should now be running on [localhost:5000](http://localhost:5000). Click on the button to create a new check, and then within a few minutes, you'll see the check data populating the charts.
#### Check Properties
Every check requires the following properties:
+ name: for display in charts and reports
+ url: the fully qualified resource to check
+ frequency: how often to sent the request, in minutes
Additionally, checks have some optional properties:
+ method: GET, POST, or DELETE (defaults to GET)
+ http_username: Username for HTTP authentication
+ http_password: Password for HTTP authentication
Checks can also have any number of custom properties, which is very useful for grouping & drill-down analysis later. Place any custom properties in the `custom` field.
#### HTTP Request & Response as an Event
Each time a check is run, a JSON object describing the check, request, and response is logged via a `CheckLogger` component, defaulting to `KeenCheckLogger`. Here's an example event payload:
``` json
{
"check": {
"name": "Keen IO Web",
"url": "https://keen.io",
"frequency": 5,
"custom": {
"server_role": "https",
"is_https": true
}
},
"environment": {
"rack_env": "production",
"region": "heroku_us_east",
"location": "Virginia, US"
},
"request": {
"sent_at": "2013-10-12T00:00:00.000Z",
"duration": 0.432
},
"response": {
"successful": true,
"timed_out": false,
"status": 200,
"server": "TornadoServer/3.1",
"http_status": 200,
"http_reason": "OK",
"http_version": "1.1",
"content_type": "text/html",
"content_length": 175,
"date": "Wed, 16 Apr 2014 17:39:01 GMT"
}
}
```
Here's a breakdown of the major sections:
+ check: properties describing the check, including any custom properties
+ environment: properties describing where the check was made from (useful when you are running Pingpong instances across multiple datacenters)
+ request: information about the HTTP request that was sent
+ response: information about the HTTP response that was recorded
`response.timed_out` and `response.successful` are helper properties. `response.successful` is true if the request did not timeout and the response
status is between 100 and 399.
It's easy to add more fields to the `environment` section in `config.yml`, or implement a `CheckMarshaller` component that translates HTTP response fields to properties in a different way.
Capturing all of these fields makes it possible to perform powerful grouping and filtering during analysis.
#### Reporting and Alerting
Pingpong uses [Pushpop](https://github.com/pushpop/pingpong.git) to provide basic alerting and reporting functionality. This functionality can easily be extended to create your own custom ale
没有合适的资源?快使用搜索试试~ 我知道了~
HTTP监控和分析应用PingPong.zip
共81个文件
rb:27个
png:13个
haml:7个
需积分: 21 5 下载量 189 浏览量
2019-07-18
04:40:58
上传
评论
收藏 565KB ZIP 举报
温馨提示
PingPong 是一个开源分析应用,为开发者提供 HTTP 监控,可以对任何带有 URL 的东西进行分析。特性:1) 可以用很漂亮的方式展示数据2) 当你的 app 或者网站反应慢时,你能得到及时反馈,例如通过手机短信。3) 获取和运行简单
资源推荐
资源详情
资源评论
收起资源包目录
pingpong-master.zip (81个子文件)
pingpong-master
public
collapsed-icon.png 20KB
jqBootstrapValidation.js 35KB
jq-json-formatter.js 8KB
Collapsed.gif 215B
checks.js 4KB
good-icon@2x.png 5KB
hamburger-icon.png 204B
fonts
GothamBook.woff 21KB
GothamBook.svg 178KB
GothamBook.ttf 46KB
GothamBook.woff2 14KB
GothamBook.eot 46KB
error-icon@2x.png 5KB
error-icon.png 4KB
warning-icon@2x.png 5KB
pingpong.svg 5KB
style.scss 6KB
pencil-icon.png 3KB
expanded-icon.png 20KB
Expanded.gif 206B
logo.png 24KB
style.css.map 4KB
good-icon.png 4KB
sass
_mixins.sass 60KB
pingpong-og.png 226KB
holder.js 20KB
warning-icon.png 4KB
style.css 7KB
pencil-icon@2x.png 3KB
config.ru 41B
views
layout.haml 6KB
_check_form_fields.haml 4KB
new.haml 304B
index.haml 4KB
edit.haml 328B
aside.haml 182B
check.haml 10KB
db
seeds.rb 0B
schema.rb 2KB
migrate
20150427160230_create_checks_and_incidents.rb 797B
pingpong.thor 2KB
cacert.pem 211KB
lib
check_scheduler.rb 2KB
environment_aware_check_marshaller.rb 1KB
incident.rb 2KB
keen_check_logger.rb 1KB
console_check_logger.rb 158B
check.rb 8KB
enumerable_std_deviation.rb 446B
eventmachine_check_runner.rb 3KB
Gemfile 501B
spec
invalid_checks.json 12B
keen_check_logger_spec.rb 1KB
environment_aware_check_marshaller_spec.rb 1KB
check_spec.rb 10KB
incident_spec.rb 2KB
app_spec.rb 601B
config_spec.rb 391B
spec_helper.rb 876B
test_checks.json 281B
check_scheduler_spec.rb 587B
factories.rb 652B
eventmachine_check_runner_spec.rb 7KB
run_checks_job_spec.rb 5KB
support
factory_girl.rb 78B
Rakefile 1KB
config.yml 2KB
.travis.yml 238B
LICENSE 1KB
Procfile 214B
README.md 12KB
jobs
run_checks_job.rb 4KB
keep_alive_job.rb 388B
.rspec 26B
Gemfile.lock 3KB
app.json 1KB
.env.sample 819B
.gitignore 35B
app.rb 3KB
pingpong_config.rb 2KB
database.yml 270B
共 81 条
- 1
资源评论
weixin_39840387
- 粉丝: 790
- 资源: 3万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于Java的DVD租赁管理系统.zip
- (源码)基于Arduino的模型铁路控制系统.zip
- (源码)基于C语言STM32F10x框架的温湿度监控系统.zip
- (源码)基于Spring Boot的极简易课堂对话系统.zip
- (源码)基于JSP+Servlet+MySQL的学生管理系统.zip
- (源码)基于ESP8266的蜂箱监测系统.zip
- (源码)基于Spring MVC和Hibernate框架的学校管理系统.zip
- (源码)基于TensorFlow 2.3的高光谱水果糖度分析系统.zip
- (源码)基于Python框架库的知识库管理系统.zip
- (源码)基于C++的日志管理系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功