CN105740376A - API (Application Program Interface) calling statistics and monitoring method in micro-service - Google Patents

API (Application Program Interface) calling statistics and monitoring method in micro-service Download PDF

Info

Publication number
CN105740376A
CN105740376A CN201610055908.1A CN201610055908A CN105740376A CN 105740376 A CN105740376 A CN 105740376A CN 201610055908 A CN201610055908 A CN 201610055908A CN 105740376 A CN105740376 A CN 105740376A
Authority
CN
China
Prior art keywords
record
data source
micro services
server
monitoring
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.)
Pending
Application number
CN201610055908.1A
Other languages
Chinese (zh)
Inventor
张元达
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Mainone Zhida Technology Co Ltd
Original Assignee
Beijing Mainone Zhida Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Mainone Zhida Technology Co Ltd filed Critical Beijing Mainone Zhida Technology Co Ltd
Priority to CN201610055908.1A priority Critical patent/CN105740376A/en
Publication of CN105740376A publication Critical patent/CN105740376A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification

Abstract

The invention relates to an API (Application Program Interface) calling statistics and monitoring method in micro-service. The method comprises the following steps: each micro-service server independently records a calling record that the API is called each time, and records the calling record into a temporary memory container; the micro-service server starts a server timer according to a fixed time period, calculates all calling records in the memory container at present when the server timer is executed, and accumulates calling frequencies and calling time to obtain an accumulation record; the micro-service server writes the accumulation record into a general database, and one micro-service server address is added for the accumulation record written into the general database to obtain a data source record; and the general database stores the data source record. The method can regulate time, records calling information in real time and carries out statistics by logs so as to realize a purpose that all data modules are monitored to help carry out early warning and optimization, increase hardware or reduce a server amount, the data of a data source is collated in multiple levels, and server crash can be avoided.

Description

A kind of method of API Calls statistics and monitoring in micro services
Technical field
The present invention relates to computer realm, the method for be specifically related in a kind of micro services API Calls statistics and monitoring.
Background technology
Distributed SOA is significantly high to performance requirement for existing framework, and monitor portion requires record data business volume, and every day, record called record up to more than one hundred million times, and traditional centralized statistics can frequently result in server crash.
The API Statistical monitor of traditional micro services has following 2 big problems:
1, server distribution is extensive, is difficulty with centralized management
2, calling frequency quantity (calling the data volume of formation) huge, traditional mode calculates and storage is directly cumulative and is stored on a summary table, it is difficult to realize monitor in real time.
Summary of the invention
It is an object of the invention to provide a kind of method of API Calls statistics and monitoring in micro services, realize adjustable time, real time record recalls information with log statistic, thus realizing monitoring all data modules, help early warning, optimize, increase hardware or reduce number of servers, according to server, class name, method name, call number, the execution time, average performance times, period and date combination in any realize various statistics, and those class name that scanning call number is maximum and average performance times is the longest on this basis and method name, if beyond threshold values, just in the way of mail, notify related personnel, to be further processed.
It is an object of the invention to be achieved through the following technical solutions:
A kind of method of API Calls statistics and monitoring in micro services, comprises the following steps:
Every micro services server each records the invoked record that calls each time, and described in call record and recorded in interim internal memory container.
Described micro services server is pressed fixed time period and is started server intervalometer, when described server intervalometer performs, what calculate in presently described internal memory container all of calls record, and its calculation is: call number and allocating time are added up, and obtains cumulative record.
Described cumulative record is written in total data storehouse by described micro services server, and the described cumulative record being written to total data storehouse can increase a micro services server address, obtains data source record.
Data source record described in described total data library storage.
Further, data source record described in described total data library storage comprises the following steps:
Described data source record is read by described fixed time period in described total data storehouse, and the recorded content of described data source record is admitted in the table of ephemeral data source, empties described data source record.
And the data of described ephemeral data source table are imported in data source summary table, empty described ephemeral data source table.
Further, described total data storehouse every one hour can the data source summary table interior this hour import to time Data source table in.
Further, described total data storehouse by within 1 day, being date of formation in cycle table, in cycle the previous day all of time Data source table each data accumulation after, import in day Data source table.
Further, call record described in and include class name, method name and execution time.
Further, described calculation is: when described class name and method name be the same from situation just carrying out to described call number and allocating time cumulative.
Further, after described cumulative record is written in total data storehouse by described micro services server, described micro services server empty described interim internal memory container storage call record.
Further, described data source record includes server address, class name, method name, call number and allocating time altogether.
Further, the default value of described fixed time period is 1 minute.
The invention have the benefit that the present invention is directed in multiple different micro services after realizing data classification, and all exclusively enjoy the exclusive total data storehouse of oneself, if client needs user data, so only need to call member micro services interface, obtain member data, call the micro services interface of product, obtain the data of product, and the two micro services is each independent, will not influence each other, accomplish the loose coupling of enterprise-level framework completely.
The present invention realizes adjustable time, real time record recalls information with log statistic, thus realizing monitoring all data modules, help early warning, optimization, increase hardware or reduce number of servers, various statistics is realized according to server, class name, method name, call number, execution time, average performance times, period and date combination in any, and those class name that scanning call number is maximum and average performance times is the longest on this basis and method name, if beyond threshold values, just in the way of mail, related personnel is notified, in order to be further processed.
Accompanying drawing explanation
Below according to accompanying drawing, the present invention is described in further detail.
Fig. 1 is the method flow diagram of the method for API Calls statistics and monitoring in a kind of micro services described in the embodiment of the present invention.
Detailed description of the invention
As it is shown in figure 1, the method for API Calls statistics and monitoring in a kind of micro services described in the embodiment of the present invention, comprise the following steps:
Every micro services server each records the invoked record that calls each time, and described in call record and recorded in interim internal memory container.
nullDescribed micro services server starts server intervalometer by fixed time period (default time is 1 minute),When described server intervalometer performs,What calculate in current time in described internal memory container all of calls record,The described record that calls includes class name、Method name and the time of execution,Its calculation is: when described class name and method name be the same from situation just carrying out to described call number and allocating time cumulative,Obtain cumulative record,Such as: one is C for class name,Method name be F call record,Its execution time is 2 milliseconds,Another is C for class name,Method name be F call record,Its execution time is 3 milliseconds,Perform within this period,It calls record, and to be merged into class name be C,Method name be F call record,Its call number is 2 times and allocating time is 5 milliseconds.The described record that calls presents with the cumulative form recording form all.
Described cumulative record is written in total data storehouse by described micro services server, the described cumulative record being written to total data storehouse can increase a micro services server address, obtain data source record, described data source record includes server address, class name, method name, call number and allocating time altogether, described micro services server empty described interim internal memory container storage call record, in order to again perform to circulate next time.
Described data source record is read by described fixed time period (default value is 1 minute) in described total data storehouse, and the recorded content of described data source record is admitted in the table of ephemeral data source, empty described data source record, in order to again perform to circulate next time.
The data of described ephemeral data source table are imported in data source summary table by described total data storehouse, empty described ephemeral data source table, in order to again perform to circulate next time.
Described total data storehouse every one hour can be interior this hour data source summary table in each data accumulation after import to time Data source table in.
Described total data storehouse by within 1 day, being date of formation in cycle table, in cycle the previous day all of time Data source table each data accumulation after, import in day Data source table.
The present invention is not limited to above-mentioned preferred forms; anyone can draw other various forms of products under the enlightenment of the present invention; no matter but in its shape or structure, do any change, every have same or like with the application like technical scheme, all fall within protection scope of the present invention.

Claims (9)

1. the method for API Calls statistics and monitoring in a micro services, it is characterised in that comprise the following steps:
Every micro services server each records the invoked record that calls each time, and described in call record and recorded in interim internal memory container;
Described micro services server is pressed fixed time period and is started server intervalometer, when described server intervalometer performs, what calculate in presently described internal memory container all of calls record, and its calculation is: call number and allocating time are added up, and obtains cumulative record;
Described cumulative record is written in total data storehouse by described micro services server, and the described cumulative record being written to total data storehouse can increase a micro services server address, obtains data source record;
Data source record described in described total data library storage.
2. the method for API Calls statistics and monitoring in micro services according to claim 1, it is characterised in that data source record described in described total data library storage comprises the following steps:
Described data source record is read by described fixed time period in described total data storehouse, and the recorded content of described data source record is admitted in the table of ephemeral data source, empties described data source record;
And the data of described ephemeral data source table are imported in data source summary table, empty described ephemeral data source table.
3. in micro services according to claim 1 API Calls statistics and monitoring method, it is characterised in that: described total data storehouse every one hour can the data source summary table interior this hour import to time Data source table in.
4. the method for API Calls statistics and monitoring in micro services according to claim 1, it is characterized in that: described total data storehouse was date of formation in cycle table by 1 day, in cycle the previous day all of time Data source table each data accumulation after, import in day Data source table.
5. the method for API Calls statistics and monitoring in micro services according to claim 1, it is characterised in that: described in call record and include class name, method name and execution time.
6. the method for API Calls statistics and monitoring in micro services according to claim 5, it is characterised in that: described calculation is: when described class name and method name be the same from situation just carrying out to described call number and allocating time cumulative.
7. the method for API Calls statistics and monitoring in micro services according to claim 1, it is characterized in that: after described cumulative record is written in total data storehouse by described micro services server, described micro services server empty described interim internal memory container storage call record.
8. the method for API Calls statistics and monitoring in micro services according to claim 1, it is characterised in that: described data source record includes server address, class name, method name, call number and allocating time altogether.
9. the method for API Calls statistics and monitoring in micro services according to claim 1, it is characterised in that: the default value of described fixed time period is 1 minute.
CN201610055908.1A 2016-01-27 2016-01-27 API (Application Program Interface) calling statistics and monitoring method in micro-service Pending CN105740376A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610055908.1A CN105740376A (en) 2016-01-27 2016-01-27 API (Application Program Interface) calling statistics and monitoring method in micro-service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610055908.1A CN105740376A (en) 2016-01-27 2016-01-27 API (Application Program Interface) calling statistics and monitoring method in micro-service

Publications (1)

Publication Number Publication Date
CN105740376A true CN105740376A (en) 2016-07-06

Family

ID=56246638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610055908.1A Pending CN105740376A (en) 2016-01-27 2016-01-27 API (Application Program Interface) calling statistics and monitoring method in micro-service

Country Status (1)

Country Link
CN (1) CN105740376A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108199852A (en) * 2018-04-02 2018-06-22 上海企越信息技术有限公司 A kind of method for authenticating, right discriminating system and computer readable storage medium
CN108228346A (en) * 2016-12-13 2018-06-29 佳能株式会社 service system and its control method
CN108512689A (en) * 2017-12-15 2018-09-07 中国平安财产保险股份有限公司 Micro services business monitoring method and server
CN108959014A (en) * 2017-05-17 2018-12-07 北京京东尚科信息技术有限公司 Method and apparatus for monitor supervision platform
CN109086149A (en) * 2018-08-15 2018-12-25 国云科技股份有限公司 A kind of method that micro services interface calls analysis of central issue
CN109617750A (en) * 2019-01-31 2019-04-12 国网电子商务有限公司 A kind of service method for early warning and gateway
CN109739727A (en) * 2019-01-03 2019-05-10 优信拍(北京)信息科技有限公司 Service monitoring method and device in micro services framework
WO2019134230A1 (en) * 2018-01-08 2019-07-11 平安科技(深圳)有限公司 Database monitoring method, apparatus, terminal device and storage medium
CN110413413A (en) * 2019-07-26 2019-11-05 北京蜜莱坞网络科技有限公司 A kind of method for writing data, device, equipment and storage medium
CN110661815A (en) * 2019-10-22 2020-01-07 中国林业科学研究院热带林业研究所 Request processing method, device, system and medium based on frequency limitation microservice
CN110674201A (en) * 2019-09-17 2020-01-10 上海数禾信息科技有限公司 Method and device for checking enterprise credit worthiness calling condition
CN111782182A (en) * 2020-06-29 2020-10-16 联通(浙江)产业互联网有限公司 Java Web interface request statistical method, computer equipment and readable storage medium
CN111865978A (en) * 2020-07-20 2020-10-30 深圳乐信软件技术有限公司 Method, device, equipment and medium for updating request identifier of micro-service
CN115022311A (en) * 2022-03-23 2022-09-06 北京邮电大学 Selection method and device of micro-service container instances
CN115296942A (en) * 2022-07-22 2022-11-04 中电信数智科技有限公司 Combined API (application program interface) counting charging device based on weighted response

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193291A1 (en) * 2004-02-19 2005-09-01 Oracle International Corporation Application functionality for a test tool for application programming interfaces
CN102185900A (en) * 2011-04-18 2011-09-14 北京新媒传信科技有限公司 Application service platform system and method for developing application services

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193291A1 (en) * 2004-02-19 2005-09-01 Oracle International Corporation Application functionality for a test tool for application programming interfaces
CN102185900A (en) * 2011-04-18 2011-09-14 北京新媒传信科技有限公司 Application service platform system and method for developing application services

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
标点符: "Dubbo:来自于阿里巴巴的分布式服务框架", 《HTTP://WWW.BIAODIANFU.COM/DUBBO.HTML》 *

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228346A (en) * 2016-12-13 2018-06-29 佳能株式会社 service system and its control method
CN108228346B9 (en) * 2016-12-13 2022-04-22 佳能株式会社 Service system and control method thereof
US11303546B2 (en) 2016-12-13 2022-04-12 Canon Kabushiki Kaisha Service system and control method of the same
CN108228346B (en) * 2016-12-13 2022-01-18 佳能株式会社 Service system and control method thereof
CN108959014A (en) * 2017-05-17 2018-12-07 北京京东尚科信息技术有限公司 Method and apparatus for monitor supervision platform
CN108959014B (en) * 2017-05-17 2022-04-12 北京京东尚科信息技术有限公司 Method and apparatus for monitoring a platform
CN108512689A (en) * 2017-12-15 2018-09-07 中国平安财产保险股份有限公司 Micro services business monitoring method and server
CN108512689B (en) * 2017-12-15 2021-08-27 中国平安财产保险股份有限公司 Micro-service monitoring method and server
WO2019134230A1 (en) * 2018-01-08 2019-07-11 平安科技(深圳)有限公司 Database monitoring method, apparatus, terminal device and storage medium
CN108199852B (en) * 2018-04-02 2021-02-26 上海企越信息技术有限公司 Authentication method, authentication system and computer readable storage medium
CN108199852A (en) * 2018-04-02 2018-06-22 上海企越信息技术有限公司 A kind of method for authenticating, right discriminating system and computer readable storage medium
CN109086149A (en) * 2018-08-15 2018-12-25 国云科技股份有限公司 A kind of method that micro services interface calls analysis of central issue
CN109739727A (en) * 2019-01-03 2019-05-10 优信拍(北京)信息科技有限公司 Service monitoring method and device in micro services framework
CN109739727B (en) * 2019-01-03 2022-07-01 优信拍(北京)信息科技有限公司 Service monitoring method and device in micro-service architecture
CN109617750A (en) * 2019-01-31 2019-04-12 国网电子商务有限公司 A kind of service method for early warning and gateway
CN110413413A (en) * 2019-07-26 2019-11-05 北京蜜莱坞网络科技有限公司 A kind of method for writing data, device, equipment and storage medium
CN110674201A (en) * 2019-09-17 2020-01-10 上海数禾信息科技有限公司 Method and device for checking enterprise credit worthiness calling condition
CN110661815A (en) * 2019-10-22 2020-01-07 中国林业科学研究院热带林业研究所 Request processing method, device, system and medium based on frequency limitation microservice
CN111782182A (en) * 2020-06-29 2020-10-16 联通(浙江)产业互联网有限公司 Java Web interface request statistical method, computer equipment and readable storage medium
CN111865978A (en) * 2020-07-20 2020-10-30 深圳乐信软件技术有限公司 Method, device, equipment and medium for updating request identifier of micro-service
CN111865978B (en) * 2020-07-20 2022-11-15 深圳乐信软件技术有限公司 Method, device, equipment and medium for updating request identifier of micro-service
CN115022311A (en) * 2022-03-23 2022-09-06 北京邮电大学 Selection method and device of micro-service container instances
CN115022311B (en) * 2022-03-23 2023-06-09 北京邮电大学 Method and device for selecting micro-service container instance
CN115296942A (en) * 2022-07-22 2022-11-04 中电信数智科技有限公司 Combined API (application program interface) counting charging device based on weighted response

Similar Documents

Publication Publication Date Title
CN105740376A (en) API (Application Program Interface) calling statistics and monitoring method in micro-service
US11868373B2 (en) Method and apparatus for monitoring an in-memory computer system
TWI777004B (en) Marketing information push equipment, devices and storage media
US8510284B2 (en) Large-scale event evaluation using realtime processors
CN104967607B (en) A kind of information processing method, terminal and server
KR102378855B1 (en) Methods and apparatus to estimate demographics of users employing social media
US9104708B2 (en) Managing activities over time in an activity graph
CN103838867A (en) Log processing method and device
US11816172B2 (en) Data processing method, server, and computer storage medium
WO2021068113A1 (en) Method and apparatus for compiling duration statistics, electronic device, and computer-readable medium
CN110647512A (en) Data storage and analysis method, device, equipment and readable medium
US10025645B1 (en) Event Processing System
CN110083579A (en) Incremental data synchronous method, apparatus, computer equipment and computer storage medium
CN113886193A (en) Log data processing method and device, electronic equipment and storage medium
CN108182204A (en) The processing method and processing device of data query based on house prosperity transaction multi-dimensional data
CN106682058B (en) Application program screening method, device and system
CN105407005B (en) Content distribution method and device
CN105872731A (en) Data processing method and device
WO2018000622A1 (en) Wms system and erp system synchronization method and system
CN112181678A (en) Service data processing method, device and system, storage medium and electronic device
WO2019153546A1 (en) Ten-thousand-level dimension data generation method, apparatus and device, and storage medium
CN106658183A (en) Method and device for popping out video login dialog box
US20160078032A1 (en) Method of on-line media scoring
CN109063201B (en) Impala online interactive query method based on mixed storage scheme
CN107870960A (en) Data move system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Inventor after: Zhang Tongming

Inventor after: Guan Rong

Inventor before: Zhang Yuanda

COR Change of bibliographic data
RJ01 Rejection of invention patent application after publication

Application publication date: 20160706

RJ01 Rejection of invention patent application after publication