Skip to content

Commit 60ee1e3

Browse files
committed
Fix README & add Go 1.7 to Travis
1 parent 8eeafa7 commit 60ee1e3

File tree

2 files changed

+40
-68
lines changed

2 files changed

+40
-68
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ language: go
77

88
go:
99
- 1.6
10+
- 1.7
1011

1112
os:
1213
- linux

README.md

+39-68
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,66 @@
11
# Phpfpmbeat
22

3-
Welcome to Phpfpmbeat.
3+
[![Build Status](https://travis-ci.org/kozlice/phpfpmbeat.svg?branch=master)](https://travis-ci.org/kozlice/phpfpmbeat)
44

5-
Ensure that this folder is at the following location:
6-
`${GOPATH}/github.com/kozlice`
5+
The [Beat](https://www.elastic.co/products/beats) for PHP-FPM monitoring.
76

8-
## Getting Started with Phpfpmbeat
7+
As Go currently doesn't provide possibility to connect directly to FPM via FastCGI as a client, PHP-FPM must be configured to show its status via some webserver. Example for Nginx can be found [here](https://easyengine.io/tutorials/php/fpm-status-page/).
8+
9+
Feel free to fork, create merge requests and open issues. I had no experience with Go language previously, so there should be a lot of things to improve.
910

1011
### Requirements
1112

1213
* [Golang](https://golang.org/dl/) 1.7
1314

14-
### Init Project
15-
To get running with Phpfpmbeat and also install the
16-
dependencies, run the following command:
1715

18-
```
19-
make setup
20-
```
16+
### Exported fields
2117

22-
It will create a clean git history for each major step. Note that you can always rewrite the history if you wish before pushing your changes.
18+
Phpfpmbeat exports all pool information fields provided by PHP-FPM, except FPM start time. To make `slow_requests` counter work, [enable `request_slow_log` feature](https://easyengine.io/tutorials/php/fpm-slow-log/) in you FPM config.
2319

24-
To push Phpfpmbeat in the git repository, run the following commands:
20+
Document sample:
2521

26-
```
27-
git remote set-url origin https://github.com/kozlice/phpfpmbeat
28-
git push origin master
29-
```
22+
{
23+
"@timestamp": "2015-11-28T22:12:04.367Z",
24+
"beat": {
25+
"hostname": "Valentins-iMac.local",
26+
"name": "Valentins-iMac.local"
27+
},
28+
"count": 1,
29+
"phpfpm": {
30+
"accepted_conn": 218,
31+
"active_processes": 1,
32+
"idle_processes": 1,
33+
"listen_queue": 0,
34+
"listen_queue_len": 128,
35+
"max_active_processes": 1,
36+
"max_children_reached": 0,
37+
"max_listen_queue": 0,
38+
"pool": "www",
39+
"process_manager": "dynamic",
40+
"slow_requests": 0,
41+
"start_since": 1176,
42+
"total_processes": 2
43+
},
44+
"type": "phpfpm"
45+
}
3046

31-
For further development, check out the [beat developer guide](https://www.elastic.co/guide/en/beats/libbeat/current/new-beat.html).
47+
There is no support for per-process info for now.
3248

33-
### Build
3449

35-
To build the binary for Phpfpmbeat run the command below. This will generate a binary
36-
in the same directory with the name phpfpmbeat.
50+
### Usage
51+
52+
To build the binary for Phpfpmbeat run the command below. This will generate a binary in the same directory with the name phpfpmbeat.
3753

3854
```
3955
make
4056
```
4157

42-
43-
### Run
44-
4558
To run Phpfpmbeat with debugging output enabled, run:
4659

4760
```
4861
./phpfpmbeat -c phpfpmbeat.yml -e -d "*"
4962
```
5063

51-
52-
### Test
53-
5464
To test Phpfpmbeat, run the following command:
5565

5666
```
@@ -67,53 +77,14 @@ make coverage-report
6777

6878
The test coverage is reported in the folder `./build/coverage/`
6979

70-
### Update
71-
72-
Each beat has a template for the mapping in elasticsearch and a documentation for the fields
73-
which is automatically generated based on `etc/fields.yml`.
74-
To generate etc/phpfpmbeat.template.json and etc/phpfpmbeat.asciidoc
75-
76-
```
77-
make update
78-
```
79-
80-
81-
### Cleanup
82-
83-
To clean Phpfpmbeat source code, run the following commands:
84-
85-
```
86-
make fmt
87-
make simplify
88-
```
89-
9080
To clean up the build directory and generated artifacts, run:
9181

9282
```
9383
make clean
9484
```
9585

9686

97-
### Clone
98-
99-
To clone Phpfpmbeat from the git repository, run the following commands:
100-
101-
```
102-
mkdir -p ${GOPATH}/github.com/kozlice
103-
cd ${GOPATH}/github.com/kozlice
104-
git clone https://github.com/kozlice/phpfpmbeat
105-
```
106-
107-
108-
For further development, check out the [beat developer guide](https://www.elastic.co/guide/en/beats/libbeat/current/new-beat.html).
109-
110-
111-
## Packaging
112-
113-
The beat frameworks provides tools to crosscompile and package your beat for different platforms. This requires [docker](https://www.docker.com/) and vendoring as described above. To build packages of your beat, run the following command:
114-
115-
```
116-
make package
117-
```
87+
### Thanks to
11888

119-
This will fetch and create all images required for the build process. The hole process to finish can take several minutes.
89+
- Elastic for their Beat creation tutorial
90+
- [mrkschan](https://github.com/mrkschan) for his [nginxbeat](https://github.com/mrkschan/nginxbeat), which I used as a prototype

0 commit comments

Comments
 (0)