Counts "Lines per second" in access.log file.
whoami@hostname ~ $ get-rps --help
Usage: get-rps [OPTIONS] LOG_FILE
OPTIONS are:
--help, -h - Print information about basic usage.
--debug, -d - Debug mode
--json, -j - Output as JSON
--logfile, -l - Log file
--avg - Outputs only average RPS
whoami@hostname ~ $ get-rps
"timestamp": "19/Jun/2019:17:48"
"rps_max": "32"
"rps_min": "6"
"rps_avg": 16
whoami@hostname ~ $ get-rps --json | jq
{
"timestamp": "19/Jun/2019:17:48",
"rps_max": 32,
"rps_min": 6,
"rps_avg": 16
}
whoami@hostname ~ $ get-rps --logfile /var/log/nginx/access.log --avg
15
whoami@hostname ~ $ time get-rps --debug
LOG_PATH: /var/log/nginx/access.log
DEBUG: true
JSON: false
LOG_NAME: access.log
TS: 19/Jun/2019:17:50
TOTAL_LINES: 597059
FIRST_LINE: 596033
LAST_LINE: 596972
LINES_TO_TAIL: 1026
LINES_TO_HEAD: 939
1 19/Jun/2019:17:50:00 4 4
2 19/Jun/2019:17:50:01 24 24
3 19/Jun/2019:17:50:02 21 21
4 19/Jun/2019:17:50:03 16 16
5 19/Jun/2019:17:50:04 11 11
6 19/Jun/2019:17:50:05 15 15
7 19/Jun/2019:17:50:06 25 25
8 19/Jun/2019:17:50:07 22 22
9 19/Jun/2019:17:50:08 12 12
10 19/Jun/2019:17:50:09 18 18
11 19/Jun/2019:17:50:10 18 18
12 19/Jun/2019:17:50:11 16 16
13 19/Jun/2019:17:50:12 17 17
14 19/Jun/2019:17:50:13 21 21
15 19/Jun/2019:17:50:14 5 5
16 19/Jun/2019:17:50:15 11 11
17 19/Jun/2019:17:50:16 16 16
18 19/Jun/2019:17:50:17 16 16
19 19/Jun/2019:17:50:18 9 9
20 19/Jun/2019:17:50:19 15 15
21 19/Jun/2019:17:50:20 21 21
22 19/Jun/2019:17:50:21 16 16
23 19/Jun/2019:17:50:22 16 16
24 19/Jun/2019:17:50:23 26 26
25 19/Jun/2019:17:50:24 11 11
26 19/Jun/2019:17:50:25 13 13
27 19/Jun/2019:17:50:26 18 18
28 19/Jun/2019:17:50:27 17 17
29 19/Jun/2019:17:50:28 5 5
30 19/Jun/2019:17:50:29 13 13
31 19/Jun/2019:17:50:30 8 8
32 19/Jun/2019:17:50:31 14 14
33 19/Jun/2019:17:50:32 25 25
34 19/Jun/2019:17:50:33 19 19
35 19/Jun/2019:17:50:34 21 21
36 19/Jun/2019:17:50:35 14 14
37 19/Jun/2019:17:50:36 12 12
38 19/Jun/2019:17:50:37 18 18
39 19/Jun/2019:17:50:38 21 21
40 19/Jun/2019:17:50:39 8 8
41 19/Jun/2019:17:50:40 19 19
42 19/Jun/2019:17:50:41 22 22
43 19/Jun/2019:17:50:42 11 11
44 19/Jun/2019:17:50:43 8 8
45 19/Jun/2019:17:50:44 13 13
46 19/Jun/2019:17:50:45 8 8
47 19/Jun/2019:17:50:46 14 14
48 19/Jun/2019:17:50:47 15 15
49 19/Jun/2019:17:50:48 16 16
50 19/Jun/2019:17:50:49 15 15
51 19/Jun/2019:17:50:50 11 11
52 19/Jun/2019:17:50:51 6 6
53 19/Jun/2019:17:50:52 18 18
54 19/Jun/2019:17:50:53 13 13
55 19/Jun/2019:17:50:54 23 23
56 19/Jun/2019:17:50:55 23 23
57 19/Jun/2019:17:50:56 28 28
58 19/Jun/2019:17:50:57 17 17
59 19/Jun/2019:17:50:58 12 12
60 19/Jun/2019:17:50:59 13 13
TIMESTAMP: 19/Jun/2019:17:50
MAXIMUM RPS: 28
MINIMUM RPS: 4
AVERAGE RPS: 15
real 0m0.487s
user 0m0.164s
sys 0m0.120s