CN110166540A - A kind of login TPS calculation method based on XMPP protocol - Google Patents
A kind of login TPS calculation method based on XMPP protocol Download PDFInfo
- Publication number
- CN110166540A CN110166540A CN201910385404.XA CN201910385404A CN110166540A CN 110166540 A CN110166540 A CN 110166540A CN 201910385404 A CN201910385404 A CN 201910385404A CN 110166540 A CN110166540 A CN 110166540A
- Authority
- CN
- China
- Prior art keywords
- login
- user
- time
- tps
- log
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/08—Protocols specially adapted for terminal emulation, e.g. Telnet
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Theoretical Computer Science (AREA)
- Debugging And Monitoring (AREA)
- Computer And Data Communications (AREA)
Abstract
The login TPS calculation method based on XMPP protocol that the invention discloses a kind of, one jar packet is generated by using java programming language, the jar packet can be achieved to use XMPP protocol, fixed number of users login service device and repeat logon certain time per second, and the print log in login process, to realize specific time point and the total login times of counting user of first user login services device time of record and the last one user login services device time, then the difference at two time points is calculated again, finally both the total login times of user and time difference are divided by as the TPS of login service device, it is final to realize login TPS data of the detection based on XMPP protocol server or cluster, and it can directly be calculated by the information recorded in journal file and log in TPS, have the advantages that simple and practical.
Description
Technical field
The present invention relates to log in TPS computing technique field, in particular to a kind of calculating side login TPS based on XMPP protocol
Method.
Background technique
XMPP protocol (expansible communication and presentation protocol) application range on probation is wide, flexibility is high, based on XMPP protocol
Using being frequently used in instant messaging, server or clustering performance of the detection based on XMPP protocol are also example needed for industry
Such as detect openfire server (live collaboration server) performance based on XMPP.Currently, tsung (the multi-protocols of open source
Distributed terminator testing tool) it is frequently used for detecting the terminal server performance based on XMPP protocol, it can not be from but exist
The journal file of tsung checks login, sends single message, TPS (issued transaction amount per second) information of pocket transmission news, and
Openfire server end can only also check the information such as the login time of login user, therefore a kind of technological means detection is needed to be based on
The login TPS data of XMPP protocol server or cluster.
Summary of the invention
It is insufficient the purpose of the present invention is overcoming in above-mentioned background technique, it provides based on a kind of login TPS by XMPP protocol
Calculation method, can be used for detecting the login TPS data based on XMPP protocol server or cluster, and realization directly passes through journal file
The information of interior record, which calculates, logs in TPS.
In order to reach above-mentioned technical effect, the present invention takes following technical scheme:
A kind of login TPS calculation method based on XMPP protocol, comprising the following steps:
A. determine that the number of users of login service device or cluster and user recycle login time according to business demand;
B. a jar packet is generated using java programming language, the jar packet uses XMPP protocol for realizing fixed number of users
Server of login per second or cluster, and recycling log duration is that the user determined in step A recycles login time and stepping on
Print log during record;
C. the jar packet is run, the log generated in jar packet operational process is stored in a glue file;
D. according to journal file, when checking that user's login time of first login, the last one user logged in log in
Between and the total login times of user, and according to calculation formula obtain log in TPS, wherein log in TPS calculation formula it is as follows:
Log in TPS=(the total login times of the user/(user of the last one user's login time-the first login logged in
Login time)) * 100%.
Further, the information recorded in the log includes at least: user's login time, logging state and user name.
Further, it is based on XMPP server or cluster that number of users and user, which recycle login time, in the step A
The login TPS index request that configuration or business side provide determines.
Compared with prior art, the present invention have it is below the utility model has the advantages that
Login TPS calculation method based on XMPP protocol of the invention generates a jar by using java programming language
Packet, which can be achieved to use XMPP protocol, per second to use fixed number of users login service device and repeat logon certain time,
And the print log in login process, to realize that first user login services device time of record and the last one user log in
Specific time point of server time and the total login times of counting user, then calculate the difference at two time points again, will finally use
Both the total login times in family and time difference are divided by as the TPS of login service device, final to realize that detection is based on XMPP protocol service
The login TPS data of device or cluster, and can directly be calculated by the information recorded in journal file and log in TPS, have simple
And practical advantage.
Specific embodiment
Below with reference to the embodiment of the present invention, the invention will be further elaborated.
Embodiment:
A kind of login TPS calculation method based on XMPP protocol, specifically includes the following steps:
Step 1: it is determined and is logged in based on the login TPS index request that XMPP server or cluster configuration or business side provide
The number of users and user of server or cluster recycle login time, if can business side need to obtain its server and meet often
Second logs in the demand of 1000 users and needs to recycle and logs in 1 hour, then can determine the number of users of login service device or cluster
It is 1000, circulation login time is 1 hour;
Step 2: writing java Program Generating jar packet using java programming language and be named as UserLogin.jar, should
Jar packet uses an XMPP protocol server of login per second or cluster for realizing fixed number of users, and logs in some time
(user determined i.e. in step 1 recycles login time) and the print log in login process;
In the present embodiment, the part core code of the jar packet program is as follows:
OptionsOptions=newOptions();
Options.addOption (" host ", true, " XMPP Host ");
Options.addOption (" port ", true, " XMPP Server Port ");
Options.addOption (" domain ", true, " XMPP domain name ");
Options.addOption (" resource ", true, " client resource name ");
Options.addOption (" senderPrefix ", true, " sender's prefix ");
Options.addOption (" password ", true, " sender's password ");
Options.addOption (" start ", true, " starting symbol ");
Options.addOption (" count ", true, " quantity ");
Options.addOption (" bits ", true, " digit ");
Options.addOption (" loginCount ", true, " message number ");
Options.addOption (" interval ", true, " sending interval ");
Step 3: a journal file is written in running log by operation jar packet, and order is as follows in the present embodiment:
Java-jar UserLogin.jar > root log .txt;
Step 4: opening journal file, checks user's login time strTime, the last one login of first login
User's login time endTime and the total login times Num of user, can be obtained after opening log .txt file in the present embodiment
The content of the partial log information arrived is as follows:
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250022
Login success, and the time is 2017-08-19 15:59:27.284
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250026
Login success, and the time is 2017-08-19 15:59:27.286
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250023
Login success, and the time is 2017-08-19 15:59:27.289
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250029
Login success, and the time is 2017-08-19 15:59:27.296
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250028
Login success, and the time is 2017-08-19 15:59:27.296
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250038
Login success, and the time is 2017-08-19 15:59:27.308
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250033
Login success, and the time is 2017-08-19 15:59:27.309
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250037
Login success, and the time is 2017-08-19 15:59:27.309
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250031
Login success, and the time is 2017-08-19 15:59:27.310
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250036
Login success, and the time is 2017-08-1915:59:27.314
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250034
Login success, and the time is 2017-08-19 15:59:27.317
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250047
Login success, and the time is 2017-08-19 15:59:27.363
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250045
Login success, and the time is 2017-08-19 15:59:27.366
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 1312325D044
Login success, and the time is 2017-08-19 15:59:27.369
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250050
Losin success, and the time is 2017-08-19 15:59:27.378
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250052
Login success, and the time is 2017-08-19 15:59:27.420
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250054
Login success, and the time is 2017-08-19 15:59:27.427
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250055
Login success, and the time is 2017-08-19 15:59:27.433
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250058
Login success, and the time is 2017-08-19 15:59:27.460
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250059
Login success, and the time is 2017-08-19 15:59:27.465
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250062
Login success, and the time is 2017-08-19 15:59:27.493
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250063
Login success, and the time is 2017-08-19 15:59:27.495
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250065
Login success, and the time is 2017-08-19 15:59:27.501
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250064
Login success, and the time is 2017-08-19 15:59:27.507
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250068
Login success, and the time is 2017-08-19 15:59:27.514
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250067
Login success, and the time is 2017-08-19 15:59:27.515
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250069
Login success, and the time is 2017-08-19 15:59:27.539
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250071
Login success, and the time is 2017-08-19 15:59:27.551
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250070
Login success, and the time is 2017-08-19 15:59:27.554
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250073
Login success, and the time is 2017-08-19 15:59:27.583
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250072
Login success, and the time is 2017-08-19 15:59:27.583
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250074
Login success, and the time is 2017-08-19 15:59:27.589
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250076
Login success, and the time is 2017-08-19 15:59:27.605
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250075
Login success, and the time is 2017-08-19 15:59:27.607
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250080
Login success, and the time is 2017-08-19 15:59:27.641
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250082
Login success, and the time is 2017-08-19 15:59:27.645
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250084
Login success, and the time is 2017-08-19 15:59:27.650
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-user 13123250088
Losin success, and the time is 2017-08-19 15:59:27.721
2017.08.19 15:59:27 org.isoftstone.JDBCAuthProvider-User 13123250087
Login success, and the time is 2017-08-19 15:59:27.724
Step 5: it is obtained according to calculation formula and logs in TPS, wherein it is as follows to log in TPS calculation formula:
Log in TPS=Num/ (endTime-strTime) * 100%.
From the foregoing, it will be observed that the login TPS calculation method of the invention based on XMPP protocol, raw by using java programming language
At a jar packet, which can be achieved to use XMPP protocol, fixed number of users login service device and repeat logon one per second
Fix time, and the print log in login process, with realize record first user login services device time and the last one
Specific time point of user login services device time and the total login times of counting user, then calculate the difference at two time points again,
Finally both the total login times of user and time difference are divided by as the TPS of login service device, it is final to realize that detection is based on XMPP
The login TPS data of protocol server or cluster, and can directly be calculated by the information recorded in journal file and log in TPS,
Have the advantages that simple and practical.
It is understood that the principle that embodiment of above is intended to be merely illustrative of the present and the exemplary implementation that uses
Mode, however the present invention is not limited thereto.For those skilled in the art, essence of the invention is not being departed from
In the case where mind and essence, various changes and modifications can be made therein, these variations and modifications are also considered as protection scope of the present invention.
Claims (3)
1. a kind of login TPS calculation method based on XMPP protocol, which comprises the following steps:
A. determine that the number of users of login service device or cluster and user recycle login time according to business demand;
B. a jar packet is generated using java programming language, the jar packet is every using XMPP protocol for realizing fixed number of users
Second logs in a server or cluster, and recycles log duration and be the user's circulation login time determined in step A and logging in
Print log in the process;
C. the jar packet is run, the log generated in jar packet operational process is stored in a glue file;
D. according to journal file, check user's login time, the last one user's login time logged in of first login with
And the total login times of user, and obtained according to calculation formula and log in TPS, wherein it is as follows to log in TPS calculation formula:
Log in TPS=(the total login times of user/(user's login of the last one user's login time-the first login logged in
Time)) * 100%.
2. a kind of login TPS calculation method based on XMPP protocol according to claim 1, which is characterized in that the day
The information recorded in will includes at least: user's login time, logging state and user name.
3. a kind of login TPS calculation method based on XMPP protocol according to claim 1, which is characterized in that the step
It is the login provided based on XMPP server or cluster configuration or business side that number of users and user, which recycle login time, in rapid A
TPS index request determines.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910385404.XA CN110166540B (en) | 2019-05-09 | 2019-05-09 | Login TPS (TPS security protocol) calculation method based on XMPP (extensible Messaging and Presence protocol) |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910385404.XA CN110166540B (en) | 2019-05-09 | 2019-05-09 | Login TPS (TPS security protocol) calculation method based on XMPP (extensible Messaging and Presence protocol) |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110166540A true CN110166540A (en) | 2019-08-23 |
CN110166540B CN110166540B (en) | 2021-10-01 |
Family
ID=67633989
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910385404.XA Active CN110166540B (en) | 2019-05-09 | 2019-05-09 | Login TPS (TPS security protocol) calculation method based on XMPP (extensible Messaging and Presence protocol) |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110166540B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050187934A1 (en) * | 2004-02-24 | 2005-08-25 | Covelight Systems, Inc. | Methods, systems and computer program products for geography and time monitoring of a server application user |
US20100174831A9 (en) * | 2002-03-08 | 2010-07-08 | Uri Elzur | System and method for handling transport protocol segments |
CN105469180A (en) * | 2014-09-12 | 2016-04-06 | 东北大学 | TPS based industrial cluster enterprise production coordinated management evaluating system |
CN106470133A (en) * | 2015-08-20 | 2017-03-01 | 阿里巴巴集团控股有限公司 | System pressure method of testing and device |
CN107659466A (en) * | 2017-09-25 | 2018-02-02 | 四川长虹电器股份有限公司 | It is a kind of to quantify and calculate the system and method for the cloud system handling capacity grade of service |
CN108563544A (en) * | 2018-03-26 | 2018-09-21 | 平安普惠企业管理有限公司 | System performance testing method, apparatus, computer equipment and storage medium |
CN109240899A (en) * | 2017-07-10 | 2019-01-18 | 北京京东尚科信息技术有限公司 | Information acquisition method and device |
-
2019
- 2019-05-09 CN CN201910385404.XA patent/CN110166540B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100174831A9 (en) * | 2002-03-08 | 2010-07-08 | Uri Elzur | System and method for handling transport protocol segments |
US20050187934A1 (en) * | 2004-02-24 | 2005-08-25 | Covelight Systems, Inc. | Methods, systems and computer program products for geography and time monitoring of a server application user |
CN105469180A (en) * | 2014-09-12 | 2016-04-06 | 东北大学 | TPS based industrial cluster enterprise production coordinated management evaluating system |
CN106470133A (en) * | 2015-08-20 | 2017-03-01 | 阿里巴巴集团控股有限公司 | System pressure method of testing and device |
CN109240899A (en) * | 2017-07-10 | 2019-01-18 | 北京京东尚科信息技术有限公司 | Information acquisition method and device |
CN107659466A (en) * | 2017-09-25 | 2018-02-02 | 四川长虹电器股份有限公司 | It is a kind of to quantify and calculate the system and method for the cloud system handling capacity grade of service |
CN108563544A (en) * | 2018-03-26 | 2018-09-21 | 平安普惠企业管理有限公司 | System performance testing method, apparatus, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110166540B (en) | 2021-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8707407B2 (en) | Account hijacking counter-measures | |
US9106700B2 (en) | Risk aware domain name service | |
CN105847447B (en) | Message pushing method and device | |
US12120151B2 (en) | Low-latency, outbound message monitoring, control, and authentication | |
CN102904865B (en) | A kind of management method, system and equipment of the multiple digital certificates based on mobile terminal | |
CN109039876B (en) | Mail processing method and device | |
CN101645776A (en) | Method for distinguishing entities introducing on-line third party | |
CN113077270B (en) | Electronic warranty card pickup method and device | |
CN102045335A (en) | Terminal device, signature generation server, simple id management system, simple id management method, and program | |
CN107786425A (en) | Information off-line treating method and apparatus | |
CN109525588B (en) | Verification code processing method, device and system | |
CN111585973A (en) | Method and device for managing access | |
CN113067802B (en) | User identification method, device, equipment and computer readable storage medium | |
CN108600255A (en) | Mock service management method, device, computer equipment and storage medium | |
CN110166540A (en) | A kind of login TPS calculation method based on XMPP protocol | |
CN116015955B (en) | Configurable method for verifying validity security of uploading file in application system | |
CN101980477A (en) | Method and device for detecting number of shadow users, and network equipment | |
CN101552742B (en) | Electronic mail receiving apparatus | |
CN113468509B (en) | User authentication migration method, device, equipment and storage medium | |
CN105119884A (en) | Method for verifying authority of network communication user | |
CN113114557B (en) | Message sending method and device, electronic equipment and storage medium | |
US20070083761A1 (en) | Generating evidence of web services transactions | |
CN110784469B (en) | Method and system for identifying abnormal login by identifying forged MAC address | |
CN101534197A (en) | Method, device and system for treating user relogin in single-point login system | |
CN111970681A (en) | Equipment identification method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |