Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How to view the Linux QPS     - C ++ Supplements --new delete overload (Programming)

- Django url () function Detailed (Programming)

- Puppet 3.5 Source package Installation and Configuration (Server)

- Shared directory settings between Linux and Linux (Linux)

- Python 3 for instructions encoded string conversion (Programming)

- JavaScript cross-browser event object library (Programming)

- Zabbix monitors Nginx status (Server)

- PostgreSQL using the system cache to improve operational efficiency (Database)

- Apache Web Security Linux systems (Linux)

- Oracle capability i / o (stress test database server i / o performance) (Database)

- Python2.7.7 source code analysis (Programming)

- Java filter (Programming)

- Linux system font color change (Linux)

- Linux operating system log system (Linux)

- Wi-Fi hackers use to attack your seven methods (Linux)

- CentOS 7 How to install MySQL Server (Database)

- Android SDK Manager can not update the domestic solutions (Linux)

- Give your photos Instagram style filters plus program in ubuntu (Linux)

- Share Java-based multithreading file case (Programming)

- CentOS 5.3 under broadcom NIC dual activation issues (Linux)

  How to view the Linux QPS
  Add Date : 2016-06-15      
  Background: There is a referral service online, larger than the log, under qps want to make sure is not too high

Question: qps how to view the log based on a service

tail -f XXX.log, the log can be found in the following format:
[8708-10 14:51:44 638 INFO] [async task worker [61]] recommend.components.KeywordService [87] - cateid = 252 pageNum = 1
[8708-10 14:51:44 666 INFO] [async task worker [62]] recommend.components.KeywordService [87] - cateid = 42205
[8708-10 14:51:44 673 INFO] [async task worker [0]] recommend.components.KeywordService [87] - cateid = 29 pageNum = 2
[8708-10 14:51:44 677 INFO] [async task worker [1]] recommend.components.KeywordService [87] - cateid = 252 pageNum = 3

Log specification, there is a "request time", through the "request time" estimated qps services, follow these steps:
(1) make a request to have a go first and only line of logs, commonly used tools are grep, this case needs to grep recommend.components.KeywordService, the results obtained, a request corresponding to the line of the log
(2) Remove the time this column, commonly used tool is cut or awk, here is what you cut (linux everyone to look up man)
    -d parameter, separated by a certain character
    -f parameter, the first of several columns separated after removal
    In this example, after following the "space" to separate the time in the second column
1,2-step operation performed, the results obtained for the
(3) the results go heavy, take count, commonly used tools are uniq, parameter -c

Therefore, the entire shell command is:
Command: tail -f XXX.log | grep recommend.components.KeywordService | cut -d '' -f2 | cut -d ':' -f3 | uniq -c
Description: Take an incremental | request fetches a row | time to intercept it | out to intercept the seconds | to re-take the count
The result is
You can see 14: 51: 43, a total of 136 log
    44, there are 126 log
    45, there are 115 log
qps conclusion of this module, the single is about 120-130
- Java method to read and write files summary (Programming)
- Java objects are taking up much space (Programming)
- Ubuntu 14.04 installed VirtualBox 4.3 appears vboxdrv: Unknown symbol mcount (Linux)
- floating IP in OpenStack neutron (Server)
- Oracle 11R2 Grid Infrastructure execute root.sh script rootcrs.pl execution failed treatment (Database)
- How to add any of a Linux distribution beautiful fonts (Linux)
- MySQL related statements (CRUD) (SQLyog software) (Database)
- Linux uses the SMTP proxy to send mail (Linux)
- How to Check notebook CPU temperature in Ubuntu (Linux)
- Linux (RHEL5) general optimization system security (Linux)
- Let OpenCV face detection score output codes (Programming)
- Android gets the global process information and the memory used by the process (Programming)
- User and user group management Linux Command (Linux)
- Network traffic monitoring ntopng (Linux)
- CentOS6.3 build a Python 3.3 environment to access Oracle 11gR2 (Database)
- Dynamic programming Android (Programming)
- Linux Network Analysis Tcpdump Command Guide (Linux)
- MariaDB phpMyAdmin installation and configuration issues to resolve under CentOS7 (Database)
- Learning OpenCV: (VS2010-openCV2.4.3-win7 configuration instructions) (Linux)
- Install MATE desktop environment adjustment tools Mate Tweak 3.3.6 (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.