WO2019062077A1 - 计算任务的资源监测方法、装置、设备及可读存储介质 - Google Patents

计算任务的资源监测方法、装置、设备及可读存储介质 Download PDF

Info

Publication number
WO2019062077A1
WO2019062077A1 PCT/CN2018/083016 CN2018083016W WO2019062077A1 WO 2019062077 A1 WO2019062077 A1 WO 2019062077A1 CN 2018083016 W CN2018083016 W CN 2018083016W WO 2019062077 A1 WO2019062077 A1 WO 2019062077A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
task execution
data
running task
unit
Prior art date
Application number
PCT/CN2018/083016
Other languages
English (en)
French (fr)
Other versions
WO2019062077A9 (zh
Inventor
蒋英明
万书武
贺波
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019062077A1 publication Critical patent/WO2019062077A1/zh
Publication of WO2019062077A9 publication Critical patent/WO2019062077A9/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Definitions

  • the present application relates to the field of information processing technologies, and in particular, to a resource monitoring method, apparatus, device, and computer readable storage medium for computing tasks.
  • Spark Distributed Computing System
  • Spark is a fast and versatile computing engine designed for large-scale data processing.
  • the resident service persistent service
  • spark thriftserver service providing database connection
  • spark streaming service for processing data volume
  • Etc. corresponding to the resources used for the allocation, such as the number of CPU cores that need to be used.
  • it is difficult to calculate the resource usage status of the resident service in the computing task which leads to the following problems in the resident service of the computing task: 1.
  • the resource usage rate of the resident service in the computing task is difficult to obtain, and the resource usage rate has a "black box" phenomenon.
  • the embodiment of the present application provides a resource monitoring method, device, device, and computer readable storage medium for computing tasks, which visually demonstrates the resource usage status of the resident service in the computing task, and can implement the resource of the resident service in the computing task. Monitoring, while at the same time rational allocation of resources used by resident services.
  • an embodiment of the present application provides a resource monitoring method for a computing task, where the method includes:
  • the embodiment of the present application provides a resource monitoring device for a computing task, where the device includes: a page obtaining unit, configured to acquire data of a page where a running task execution unit of a resident service in a computing task is located by using a web crawler technology; a parsing unit, configured to parse out the number of the running task execution units according to the data of the page; and a calculating unit, configured to calculate and save the resident according to a linear relationship between the number of running task execution units and the quantity of resources used The number of resources used by the service; the statistical unit, which is used to count the amount of resources used in the preset time period; and the display unit, which is used to display the counted resource usage amount through the view.
  • an embodiment of the present application further provides an apparatus, where the device includes a memory, and a processor connected to the memory;
  • the memory is configured to store program data for resource monitoring that implements a computing task
  • the processor is configured to execute program data stored in the memory to perform a resource monitoring method of the computing task described in the first aspect above.
  • an embodiment of the present application provides a computer readable storage medium, where the one or more program data is stored, and the one or more program data may be processed by one or more processes.
  • the device performs a resource monitoring method for implementing the computing task described in the first aspect above.
  • the embodiment of the present application visualizes the resource usage status of the resident service in the computing task, and can implement the resource monitoring of the resident service in the computing task, and can reasonably allocate the resources used by the resident service.
  • FIG. 1 is a schematic structural diagram of a distributed computing system according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a resource monitoring method for a computing task according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a sub-flow in the method of FIG. 2 according to an embodiment of the present application;
  • FIG. 4 is a schematic diagram of another sub-flow in the method of FIG. 2 provided by the embodiment of the present application;
  • FIG. 5 is a schematic diagram of another sub-flow in the method of FIG. 2 according to an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a resource monitoring method for a computing task according to another embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a resource monitoring apparatus for a computing task according to an embodiment of the present application.
  • FIG. 8 is a schematic block diagram of a page obtaining unit according to an embodiment of the present application.
  • FIG. 9 is a schematic block diagram of a parsing unit provided by an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of a statistical unit provided by an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a resource monitoring apparatus for a computing task according to another embodiment of the present application.
  • FIG. 12 is a schematic block diagram of a resource monitoring device for a computing task according to an embodiment of the present application.
  • FIG. 1 is a schematic diagram of the architecture of a distributed computing system (Apache Spark, Spark for short).
  • the operation principle of the computing task in the distributed computing system will now be briefly introduced through FIG.
  • the master process itself will occupy a certain amount of memory and CPU core according to the set parameters.
  • One of the things that the master process needs to do is to use the Cluster Manager (Spark Standalone cluster).
  • the Spark Standalone cluster is deployed in the most streamlined mode or other resources.
  • the management cluster (such as the YARN resource management cluster) applies to the execution process (Executor) that is required to run the computing task.
  • the cluster resource manager initiates a certain number of executions according to the resource parameters set for the computing task request, wherein the resource parameter includes the resource usage number of the resident service, and each worker node (which can be understood as a physical node) starts a certain number of executions. Executor, each execution process occupies a certain amount of memory and CPU core.
  • the master process After the computing task has applied to the resources required for execution, the master process begins to schedule and execute the code for the computing task.
  • the master process splits the written calculation task code into multiple stages, each part executes a part of the code fragment, creates a batch of task execution units for each stage, and then assigns these task execution units. Execute to each execution process.
  • the task execution unit (task) is the smallest calculation unit.
  • the execution speed of the task execution unit is directly related to the number of CPU cores of each execution process.
  • a CPU core can only execute one thread at a time.
  • the plurality of task execution units allocated to each execution process are executed in a thread by a task execution unit, and the threads are concurrently executed. It can be understood that when a task execution unit executes, a CPU core is needed. If the number of CPU cores is sufficient and the number of task execution units allocated is reasonable, then in general, these task execution unit threads can be executed relatively quickly and efficiently.
  • the actual situation is that it is difficult to count the resource usage status of the resident task, such as the resource usage status of the resident service, so it is difficult to count the resource usage rate of the resident service in a computing task. Since the resource usage of resident services in a computing task is difficult to count, when you start to allocate resources used by resident services, only as many allocations as possible are required to ensure that the application can run normally, which may result in resource allocation. More, there is a phenomenon of waste of resources.
  • the distributed computing system referred to in this application refers to Spark
  • the main control process refers to the Driver Program
  • the cluster resource manager refers to the Cluster Manager
  • the working node refers to the Worker Node.
  • the execution process refers to the Executor
  • the stage refers to the stage
  • the task execution unit refers to the task
  • the task execution unit refers to the running task execution unit, that is, the running task.
  • Resident service refers to a service that continues to run after being opened and has always occupied resources.
  • spark thriftserver a service that provides database connectivity
  • spark streaming a service that handles data volumes
  • FIG. 2 is a schematic flowchart diagram of a resource monitoring method for a computing task according to an embodiment of the present disclosure.
  • the premise of the method is that when the distributed computing system starts, the web UI service corresponding to the distributed computing system is also started, and the running task execution unit of the task scheduling is displayed on the page (web user interface) provided by the web UI service.
  • the method runs on a server with a distributed computing system installed. As shown in FIG. 1, the method includes the following steps S201-S205.
  • S201 Use webpage crawling technology to acquire data of a page where the running task execution unit of the resident service in the computing task is located.
  • web crawler technology is a technology that automatically grabs programs or scripts of web information according to certain rules.
  • Web crawler technology is widely used in Internet search engines or other similar websites, and can automatically collect all the page content that it can access to obtain or update the content and retrieval methods of these websites.
  • the main process consists of three parts: controller, parser and resource library. The main job of the controller is to assign work tasks to each crawler thread in multiple threads.
  • the main job of the parser is to download the web page and process the page, mainly to process some JS script tags, CSS code content, space characters, HTML tags, etc., extract the content of special HTML tags, analyze the data in HTML, crawler
  • the basic work is done by the parser.
  • the resource library is used to store downloaded web resources, and generally uses large database storage, such as an Oracle database, and indexes it.
  • the function of the parser in the web crawler technology is mainly used.
  • step S201 includes sub-steps S301-S302.
  • step S301 Acquire a uniform resource locator parameter of a webpage user interface in the computing task.
  • the web user interface refers to a page opened by a web UI service of a distributed computing system;
  • the uniform resource locator refers to a URL, such as http://www.xxxx.com:80/yyyy;
  • a uniform resource locator parameter refers to the URL parameter.
  • the URL parameters include static character parameters and dynamic character parameters.
  • the static character parameter can be in the form of IP plus port, such as http://IP: port; or the form of domain name plus port, such as http://www.xxx.com: port.
  • the port can be the default port 80 (the default port is not displayed), or it can be customized other available ports such as 8080, 8088, and so on. Such as http://hdp.app.paic.com.cn:8088.
  • Dynamic character parameters include the name of the calculation task, such as jdbc_hduser0102_400. S302. Use the web crawler technology to obtain data of a page where the running task execution unit of the resident service in the computing task is located according to the unified resource locator parameter.
  • the web crawler tool such as the web crawler tool python urllib, which provides a lot of methods for web crawlers in the python urllib tool.
  • the web crawler tool python urllib tool allows us to read the data on the World Wide Web www and ftp as if it were a local file. It can download the html file to which the URL is located to a local hard drive or store it as a temporary file.
  • the python urllib tool uses the python urllib tool to input the name of the page where the running task execution unit of the resident service in the computing task is located, where the name of the page where the running task execution unit of the resident service in the task is located is calculated. For the stages (also available for other names), such as http://www.xxx.com:8088/yyy/xyxy/stages/, to get the data for this page.
  • the python urllib tool is used to obtain the data of the stages page of the running task execution unit of the resident service in the computing task, which may include: importing the urllib library; calling the method in the urllib library to obtain the data of the stages page, such as http://www .xxx.com: 8088/yyy/xyxy/stages/ page; save the data of the obtained stages page. If you want to further view the data of the obtained stage page, you can output the data of the obtained stage page.
  • step S202 includes sub-steps S401-S402.
  • S401 Acquire, from the data of the page where the running task execution unit of the resident service is located, obtain the label of all running task execution units of the resident service. That is, get the label of the running task in the page.
  • the tag includes a tag name and a value corresponding to the tag name.
  • the calculated 30 is taken as the number of running task execution units. In this way, the number of running task execution units of the resident service in the computing task is obtained.
  • the resource refers to the CPU core. If the CPU core corresponding to one device is one, the CPU core used by the resident service can be understood as the number of occupied devices. There is a linear relationship between the number of running task execution units of the resident service and the number of resource usages, which has been predicted in advance. For example, if a running task execution unit corresponds to a CPU core, it can be understood that one running task execution unit corresponds to one thread, and one thread runs on one CPU core. In other embodiments, one device has more CPU cores. If there are two, one running task execution unit corresponds to two CPU cores. In a computing task, there are usually multiple running task execution units executing simultaneously.
  • the number of resource usages of the resident application over a long period of time can be obtained through steps S201-S203.
  • the number of resource usages in the preset time period is counted, that is, S204 includes sub-steps S501-S502.
  • S501. Receive a query instruction, where the query instruction includes a corresponding preset time period.
  • the preset time period may be one hour, one day, one week, one month, three months, half a year, and the like.
  • the preset time period includes a time period between any one of the starting points and any one of the cut-off time points, for example, the preset time period may be the current time as the cut-off time point, or may be the cut-off time period earlier than the current time. Preset time period.
  • the corresponding preset time period in the query instruction has a default value, such as one month.
  • the query instruction also includes a corresponding query object, such as a CPU core. S502.
  • the amount of resources to be displayed can be displayed through distributed system monitoring and network monitoring tools.
  • distributed system monitoring and network monitoring tools include zabbix.
  • Zabbix can monitor various network parameters to ensure the safe operation of the system. Specifically, it is displayed in the form of a curve so that the user can see the corresponding resource usage in the preset time period at a glance. For example, in the coordinate system in which the time is the x-axis and the resource usage number is the y-axis, the number of resource usage in the preset time period is displayed.
  • the amount of resources to be displayed can also be displayed by other suitable tools or in a suitable manner.
  • the query instruction in step S204 can be obtained by the time bar selected/inputted by the user in zabbix, and the selected query object, wherein the time corresponding to the time bar is Set the time period, and select objects including CPU cores and so on. If the resource usage rate is counted in step 204, it can be understood that the resource usage rate is also shown in this step.
  • step S204 further includes setting a time interval, and displaying, by the view, the counted resource usage amount (resource usage rate) according to the time interval.
  • the preset time period is 1 year, the number of resource usage (resource usage) of 1 year is displayed in the view. Since there are many corresponding time points in a year, only the resource usage quantity (resource usage rate) can be displayed in the view; on the other hand, the value of the resource usage quantity (resource usage rate) continuously obtained from the theory is theoretical. In terms of the difference, the difference is not particularly large; and the number of resources used at any moment in a year is also required to occupy some resources. Practically speaking, you can set the time interval in the view to show the amount of resource usage (resource usage) in 1 year. Such as 1 minute interval.
  • the above embodiment obtains the data of the page where the running task execution unit of the resident service in the computing task is located by using the web crawler technology; parses the number of the running task execution unit according to the data of the page; and according to the number of running task execution units Calculate and save the resource usage quantity of the resident service; calculate the resource usage quantity in the preset time period; and display the statistical resource usage quantity through the view.
  • the embodiment of the present application implements resource monitoring of the resident service in the computing task according to the linear relationship between the number of running task execution units of the resident service and the resource usage number in the computing task, and visually displays the resident in the computing task.
  • the resource usage status of the service showing the resource usage saturation of the resident service in the computing task by displaying the resource usage status in the preset time period, providing a reliable basis for resource allocation of the resident service in the computing task, More reasonable allocation of resources used by resident services in computing tasks, avoiding waste of resources due to multiple allocation of resources; and by showing the state of resource usage, it can provide a basis for calculating the performance optimization of resident services, and is more convenient for analysis and calculation. Problems with resident services in the mission, such as the sudden increase in resource usage status, may be problematic.
  • FIG. 6 is a schematic flowchart of a resource monitoring method for a computing task according to another embodiment of the present disclosure.
  • the method embodiment includes S601-S606.
  • S601 is added.
  • FIG. 6 For details of other steps, refer to the description of the corresponding steps in the embodiment of FIG. 1 , and details are not described herein again.
  • the time interval is 1 minute, 5 minutes, etc.
  • the time interval is set to obtain the number of running task execution units of the resident service in the computing task according to the time interval, thereby further improving the efficiency of resource monitoring. It can be understood that the number of running task execution units of the resident service in the computing task is obtained according to the time interval, and the statistical resource usage quantity displayed in the view is also displayed according to the time interval.
  • FIG. 7 is a schematic block diagram of a resource monitoring apparatus for a computing task according to an embodiment of the present application.
  • the premise of the device execution is that when the distributed computing system starts, the web UI service corresponding to the distributed computing system is also started, and the task scheduling execution task execution unit displays on the web UI service provided page (web user interface).
  • the device 70 includes a page obtaining unit 701, a parsing unit 702, a calculating unit 703, a statistic unit 704, and a display unit 705.
  • the page obtaining unit 701 is configured to use the web crawler technology to acquire data of a page where the running task execution unit of the resident service in the computing task is located.
  • web crawler technology is a technology that automatically grabs programs or scripts of web information according to certain rules. Web crawler technology is widely used in Internet search engines or other similar websites, and can automatically collect all the page content that it can access to obtain or update the content and retrieval methods of these websites.
  • the page obtaining unit includes a parameter obtaining unit 801 and a page data acquiring unit 802.
  • the parameter obtaining unit 801 is configured to acquire a uniform resource locator parameter of the webpage user interface in the computing task.
  • the page data obtaining unit 802 is configured to acquire data of a page where the running task execution unit of the resident service in the computing task is located, according to the uniform resource locator parameter, by using a web crawler technology.
  • the parsing unit 702 is configured to parse out the number of running task execution units of the resident service according to the data of the page.
  • the parsing unit includes a tag acquiring unit 901 and a tag value counting unit 902.
  • the tag obtaining unit 901 is configured to acquire, from the data of the page where the running task execution unit of the resident service is located, the tags of all running task execution units of the resident service. That is, get the label of the running task in the page.
  • the tag value statistics unit 902 is configured to count the corresponding values in the tags of all running task execution units as the number of running task execution units.
  • the calculating unit 703 is configured to calculate and save the resource usage quantity of the resident service according to the linear relationship between the number of running task execution units and the resource usage quantity.
  • the statistics unit 704 is configured to count the resource usage quantity resource usage amount in the preset time period.
  • the statistics unit includes a receiving unit 101 and a resource statistics unit 102.
  • the receiving unit 101 is configured to receive a query instruction, where the query instruction includes a corresponding preset time period.
  • the resource statistics unit 102 is configured to count the resource usage quantity of the resident service according to the preset time period corresponding to the query instruction.
  • the display unit 705 is configured to display the counted resource usage amount through the view.
  • the amount of resources to be displayed can be displayed through distributed system monitoring and network monitoring tools.
  • the statistic unit further includes setting a time interval, and the display unit displays the counted resource usage amount (resource usage rate) according to the time interval through the view.
  • FIG. 11 is a schematic block diagram of a resource monitoring apparatus for a computing task according to another embodiment of the present application.
  • the device 110 includes a setting unit 111, a page obtaining unit 112, a parsing unit 113, a calculating unit 114, a statistic unit 115, and a display unit 116.
  • the difference between this embodiment and the embodiment of Fig. 7 is that the setting unit 111 is added.
  • the setting unit 111 is added.
  • the setting unit 111 is configured to set a time interval.
  • the time interval is 1 minute, 5 minutes, etc.
  • the page obtaining unit 112 is further configured to use, according to the time interval, the webpage crawler technology to acquire data of a page where the running task execution unit of the resident service in the computing task is located.
  • the above apparatus may be implemented in the form of computer program data which may be run on a device as shown in FIG.
  • FIG. 12 is a schematic block diagram of a resource monitoring device for computing tasks according to an embodiment of the present disclosure.
  • the device 120 can be a terminal such as a server or the like.
  • the device 120 includes a processor 122, a memory, and a network interface 123 connected by a system bus 121, wherein the memory can include a non-volatile storage medium 124 and an internal memory 125.
  • the non-volatile storage medium 124 can store an operating system 1241 and program data 1242.
  • the processor 122 can be caused to perform a resource monitoring method for a computing task.
  • the processor 122 is configured to provide computing and control capabilities to support operation of the entire device 120.
  • the internal memory 125 provides an environment for the execution of program data that, when executed by the processor 122, causes the processor 122 to perform a resource monitoring method for a computing task.
  • the network interface 123 is used for network communication, such as receiving instructions and the like. It will be understood by those skilled in the art that the structure shown in FIG. 12 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the device 120 to which the solution of the present application is applied.
  • the specific device 120 may be It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • the processor 122 is configured to execute any one of the resource monitoring methods of the foregoing computing tasks for executing program data stored in the memory.
  • the processor 122 may be a central processing unit (CPU), and the processor 122 may also be another general-purpose processor, a digital signal processor (DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device.
  • DSP digital signal processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the embodiment of the present application further provides a computer readable storage medium storing one or more program data, the one or more program data being executable by one or more processors, Any embodiment of a resource monitoring method that implements the aforementioned computing tasks.
  • the computer readable storage medium can be an internal storage unit of the device, such as a hard disk or memory of the device.
  • the computer readable storage medium may also be an external storage device of the device, such as a plug-in hard disk equipped with the device, a smart memory card (SMC), a Secure Digital (SD) card, or the like. Further, the computer readable storage medium may also include both an internal storage unit of the device and an external storage device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例提供一种计算任务的资源监测方法、装置、设备及计算机可读存储介质。所述计算任务的资源监测方法包括:利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据;根据所述页面的数据解析出所述运行任务执行单元的数量;根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存所述常驻服务的资源使用数量;统计预设时间段内的资源使用数量;通过视图展示统计的资源使用数量。

Description

计算任务的资源监测方法、装置、设备及可读存储介质
本申请要求于2017年9月28日提交中国专利局、申请号为201710900536.2、发明名称为“计算任务的资源监测方法、装置、设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息处理技术领域,尤其涉及一种计算任务的资源监测方法、装置、设备及计算机可读存储介质。
背景技术
分布式计算系统(Spark)是专为大规模数据处理而设计的快速通用的计算引擎。在大数据处理中,Spark执行一个计算任务时,会对该计算任务涉及的常驻服务(持续运行的服务),如spark thriftserver(提供数据库连接的服务),spark streaming(处理数据量的服务)等,对应分配所使用的资源,如所需要使用的CPU核的数量。然而针对计算任务中常驻服务的资源使用状态难以统计,导致计算任务中常驻服务存在以下问题:1、计算任务中常驻服务的资源使用率难以获取,资源使用率存在“黑盒”现象;2、由于计算任务中常驻服务的资源分配难以预估,所以在开始分配常驻服务使用的资源时,尽量多的分配以保证应用可以正常的运行,然而这样会导致资源分配过多,存在资源浪费的现象。
发明内容
本申请实施例提供了一种计算任务的资源监测方法、装置、设备及计算机可读存储介质,可视化的展示了计算任务中常驻服务的资源使用状态,可以实现计算任务中常驻服务的资源监测,同时可以合理的分配常驻服务使用的资源。
第一方面,本申请实施例提供了一种计算任务的资源监测方法,该方法包括:
利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据;
根据所述页面的数据解析出所述运行任务执行单元的数量;
根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存所述常驻服务的资源使用数量;
统计预设时间段内的资源使用数量;
通过视图展示统计的资源使用数量。
第二方面,本申请实施例提供了一种计算任务的资源监测装置,该装置包括:页面获取单元,用于利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据;解析单元,用于根据所述页面的数据解析出所述运行任务执行单元的数量;计算单元,用于根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存所述常驻服务的资源使用数量;统计单元,用于统计预设时间段内的资源使用数量;以及展示单元,用于通过视图展示统计的资源使用数量。
第三方面,本申请实施例还提供了一种设备,所述设备包括存储器,以及与所述存储器相连的处理器;
所述存储器用于存储实现计算任务的资源监测的程序数据,所述处理器用于运行所述存储器中存储的程序数据,以执行上述第一方面所述的计算任务的资源监测方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现上述第一方面所述的计算任务的资源监测方法。
本申请实施例可视化的展示了计算任务中常驻服务的资源使用状态,可以实现计算任务中常驻服务的资源监测,同时可以合理的分配常驻服务使用的资源。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要 使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种分布式计算系统的结构组成示意图;
图2是本申请实施例提供的一种计算任务的资源监测方法的流程示意图;
图3是本申请实施例提供的图2方法中的一子流程示意图;
图4是本申请实施例提供的图2方法中的另一子流程示意图;
图5是本申请实施例提供的图2方法中的另一子流程示意图;
图6是本申请另一实施例提供的一种计算任务的资源监测方法的流程示意图;
图7是本申请施例提供的一种计算任务的资源监测装置的示意性框图;
图8是本申请实施例提供的页面获取单元的示意性框图;
图9是本申请实施例提供的解析单元的示意性框图;
图10是本申请实施例提供的统计单元的示意性框图;
图11是本申请另一实施例提供的一种计算任务的资源监测装置的示意性框图;
图12是本申请实施例提供的一种计算任务的资源监测设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
图1是分布式计算系统(Apache Spark,简称Spark)的架构组成示意图。现通过图1简单介绍分布式计算系统中的计算任务的运行原理。当在分布式计 算系统中提交一个计算任务后,这个计算任务会启动一个对应的主控进程(Driver Program)。主控进程本身会根据设置的参数,占有一定数量的内存和CPU核。而主控进程要做的一件事情,就是向集群资源管理器(Cluster Manager,具体可以是Spark Standalone集群,Spark Standalone集群的部署方式是集群方式中最为精简的一种,也可以是其他的资源管理集群,如YARN资源管理集群)申请运行该计算任务需要使用的执行进程(Executor)。集群资源管理器会根据为该计算任务申请设置的资源参数,其中,资源参数包括常驻服务的资源使用数量,在各个工作节点(Worker Node,可理解为物理节点)上,启动一定数量的执行进程(Executor),每个执行进程都占有一定数量的内存和CPU核。
该计算任务申请到了执行所需的资源之后,主控进程就会开始调度和执行计算任务的代码了。主控进程会将编写的计算任务代码分拆为多个阶段(stage),每个阶段执行一部分代码片段,并为每个阶段创建一批任务执行单元(task),然后将这些任务执行单元分配到各个执行进程中执行。任务执行单元(task)是最小的计算单元。任务执行单元的执行速度是跟每个执行进程的CPU核的数量有直接关系。一个CPU核同一时间只能执行一个线程。而每个执行进程上分配到的多个任务执行单元,都是以一个任务执行单元一条线程的方式,多线程并发运行的。可以理解为,一个任务执行单元执行时,需要一个CPU核。如果CPU核数量比较充足,而且分配到的任务执行单元的数量比较合理,那么通常来说,可以比较快速和高效地执行完这些任务执行单元线程。
然而实际情况是,对于计算任务中的资源使用状态,如常驻服务的资源使用状态难以统计,因此很难统计一个计算任务中的常驻服务的资源使用率。由于一个计算任务中的常驻服务的资源使用率难以统计,所以在开始分配常驻服务使用的资源时,只有尽可能多的分配以保证应用可以正常的运行,这样就可能会导致资源分配过多,存在资源浪费的现象。
需要注意的是,无特别说明,本申请中涉及到的分布式计算系统指的是Spark,主控进程指的是Driver Program,集群资源管理器指的是Cluster Manager,工作节点指的是Worker Node,执行进程指的是Executor,阶段指的是stage,任务执行单元指的是task,运行任务执行单元,指的是运行中的任务执行单元,即running task。常驻服务指的是打开后一直持续运行的服务,一直 有占用资源。在分布式计算系统中,如包括spark thriftserver(提供数据库连接的服务),spark streaming(处理数据量的服务)等。
图2为本申请实施例提供的一种计算任务的资源监测方法的流程示意图。该方法的前提是:分布式计算系统启动时,也会启动分布式计算系统所对应的web UI服务,而任务调度的运行任务执行单元在web UI服务提供的页面(网页用户界面)上显示。该方法运行在安装有分布式计算系统的服务器中。如图1所示,该方法包括以下步骤S201-S205。
S201,利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。其中,网页爬虫技术是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本的技术。网页爬虫技术被广泛用于互联网搜索引擎或其他类似网站,可以自动采集所有其能够访问到的页面内容,以获取或更新这些网站的内容和检索方式。在网页爬虫的系统框架中,主过程由控制器,解析器,资源库三部分组成。控制器的主要工作是负责给多线程中的各个爬虫线程分配工作任务。解析器的主要工作是下载网页,进行页面的处理,主要是将一些JS脚本标签、CSS代码内容、空格字符、HTML标签等内容处理掉,抽取特殊HTML标签的内容,分析HTML中的数据,爬虫的基本工作是由解析器完成。资源库是用来存放下载到的网页资源,一般都采用大型的数据库存储,如Oracle数据库,并对其建立索引。在本申请申请中,主要使用的是网页爬虫技术中的解析器的功能。
具体地,如图3所示,利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据,即步骤S201包括子步骤S301-S302。S301,获取计算任务中网页用户界面的统一资源定位符参数。其中,网页用户界面指的是通过分布式计算系统的web UI服务打开的页面;统一资源定位符指的是URL,如http://www.xxxx.com:80/yyyy;统一资源定位符参数指的是URL参数。其中,URL参数包括静态字符参数和动态字符参数。静态字符参数可以是IP加端口的形式,如http://IP:端口;或者是域名加端口的形式,如http://www.xxx.com:端口。其中,端口可以是默认的端口80(一般默认端口不显示),也可以是自定义的其他的可用端口如8080、8088等。如http://hdp.app.paic.com.cn:8088。动态字符参数包括计算任务的名称等,如jdbc_hduser0102_400。S302,根据统 一资源定位符参数,利用网页爬虫技术,获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。在使用网页爬虫技术时,通常借助网页爬虫工具来实现,如网页爬虫工具python urllib,在python urllib工具中提供了很多网页爬虫中需要使用的方法。使用python urllib工具可以使我们像读取本地文件一样读取万维网www和ftp上的数据,它可以将URL定位到的html文件下载到本地的硬盘中或者存储为临时文件。利用python urllib工具,根据获取的统一资源定位符参数,输入计算任务中常驻服务的运行任务执行单元所在的页面的名称,其中,计算任务中常驻服务的运行任务执行单元所在的页面的名称为stages(也可以为其他的名称),如http://www.xxx.com:8088/yyy/xyxy/stages/页面,来获取该页面的数据。利用python urllib工具获取计算任务中常驻服务的运行任务执行单元所在的stages页面的数据,具体可包括:导入urllib库;调用urllib库中的方法来获取stages页面的数据,如http://www.xxx.com:8088/yyy/xyxy/stages/页面;将获取的stages页面的数据保存。若想进一步查看获取的该stages页面的数据,可以将获取到的该stages页面的数据输出。
S202,根据该页面的数据解析出常驻服务的运行任务执行单元的数量。
具体地,如图4所示,根据该页面的数据解析出常驻服务的运行任务执行单元的数量,即步骤S202包括子步骤S401-S402。S401,从获取常驻服务的运行任务执行单元所在的页面的数据中,获取常驻服务的所有运行任务执行单元的标签。即获取页面中running task所在的标签。其中,标签包括标签名称和标签名称所对应的值。S402,统计所有运行任务执行单元的标签中相对应的值作为运行任务执行单元的数量。如统计id=“running task”的标签中相对应的值,0+30=30。将计算得出的30作为运行任务执行单元的数量。如此,就获取了计算任务中常驻服务的运行任务执行单元的数量。
S203,根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存常驻服务的资源使用数量。优选地,资源指的是CPU核,如果一台设备对应的CPU核为一个,常驻服务使用的CPU核可以理解为占用的设备的数量。常驻服务的运行任务执行单元的数量与资源使用数量之间是线性的关系,该线性的关系已经提前预知。如一个运行任务执行单元对应一个CPU核,可以理解为,一个运行任务执行单元对应一个线程,一个线程在一个CPU核上运行。在其他 实施例中,一台设备对应的CPU核多有个,如有两个,那么一个运行任务执行单元对应两个CPU核。一个计算任务中,通常有多个运行任务执行单元在同时执行。
通过步骤S201-S203可以获取长时间内的常驻应用的资源使用数量。
S204,统计预设时间段内的资源使用数量。
具体地,如图5所示,统计预设时间段内的资源使用数量,即S204包括子步骤S501-S502。S501,接收查询指令,该查询指令中包括有对应的预设时间段。其中,预设时间段可以是一个小时、一天、一个星期、一个月、三个月、半年等等。该预设时间段包括任意一个起点和任意一个截止时间点之间的时间段,如可以是以当前时间为截止时间点的预设时间段,也可以是以早于当前时间为截止时间段的预设时间段。该查询指令中对应的预设时间段有一个默认值,如为一个月。其中,查询指令中还包括对应的查询对象,如CPU核等。S502,根据查询指令对应的预设时间段,统计常驻服务的资源使用数量。可以理解为,获取预设时间段内对应的多个时刻的资源使用数量。在其他实施例中,统计常驻服务的资源使用数量还包括根据统计的资源使用数量计算资源使用率。如根据统计的CPU核使用数量计算CPU核使用率等。
S205,通过视图展示统计的资源使用数量。可以通过分布式系统监视及网络监视工具展示待展示资源使用数量。其中,分布式系统监视及网络监视工具包括zabbix。zabbix能监视各种网络参数,保证系统的安全运营。具体地,以曲线的形式展示,以使用户一目了然的看到预设时间段内对应的资源使用情况。如在以时间为x轴,资源使用数量为y轴的坐标系上,展示预设时间段内的资源使用数量的情况。也可以通过其他合适的工具或者合适的方式来展示待展示资源使用数量。如当使用zabbix来展示统计的资源使用数量时,步骤S204中的查询指令可通过zabbix中用户选择/输入的时间条,以及选择的查询对象来得到,其中,时间条上对应的时间即为预设时间段,选择对象包括有CPU核等。若步骤204中统计的是资源使用率,可以理解地,该步骤中展示的也是资源使用率。
在其他实施例中,步骤S204中还包括设置时间间隔,通过视图根据时间间隔展示统计的资源使用数量(资源使用率)。可以理解为,若预设时间段为1 年,那么在视图中展示1年的资源使用数量(资源使用率)。由于一年中对应的时间点有很多个,而在视图中只需展示资源使用数量(资源使用率)的情况即可;另一方面连续获取的资源使用数量(资源使用率)的数值从理论上来讲相差不是特别大;而且统计1年中每时每刻的资源使用数量本身也需要占用一些资源。从实用性上来讲,可以在视图中设置时间间隔来展示1年中的资源使用数量(资源使用率)。如间隔1分钟等。
上述实施例通过利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据;根据所述页面的数据解析出所述运行任务执行单元的数量;根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存所述常驻服务的资源使用数量;统计预设时间段内的资源使用数量;通过视图展示统计的资源使用数量。本申请实施例根据计算任务中常驻服务的运行任务执行单元的数量与资源使用数量之间的线性关系,实现计算任务中常驻服务的资源监测,以可视化的方式展示了计算任务中常驻服务的资源使用状态;通过展示在预设时间段内的资源使用状态,展示了计算任务中常驻服务的资源使用饱和度,为计算任务中常驻服务的资源分配提供了可靠的依据,可以更合理的分配计算任务中常驻服务使用的资源,避免资源多分配而存在的资源浪费;而且通过展示的资源使用状态,可以为计算常驻服务的性能优化提供依据,也更方便了分析计算任务中常驻服务出现的问题,如展示的资源使用状态突然大幅升高,那么可能有问题存在。
图6为本申请另一实施例提供的一种计算任务的资源监测方法的流程示意图。该方法实施例包括S601-S606。该实施例与图1所示的实施例的区别在于:增加了S601。其他步骤的详细内容请参看图1实施例中对应步骤的描述,在此不再赘述。
S601,设置时间间隔。时间间隔如1分钟,5分钟等。
S602,根据该时间间隔,利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。
由于一个计算任务在执行时,一般不会出现资源使用突然的大幅增加或者突然的大幅减少,因此连续获取的多个资源使用数量在数值上可能相差不大。如果每时每刻都获取资源使用数量,一方面获取资源使用数量本身需要占用一 些资源,如CPU资源、内存资源等;另一方面,连续获取的多个资源使用数量由于数值上相差不大,参考意义有限。因此设置时间间隔,以根据时间间隔获取计算任务中常驻服务的运行任务执行单元的数量,进一步提高资源监测的效率。可以理解地,根据时间间隔获取计算任务中常驻服务的运行任务执行单元的数量,那么在视图中展示的统计的资源使用数量也是根据该时间间隔来展示的。
图7是本申请实施例提供的一种计算任务的资源监测装置的示意性框图。该装置执行的前提是:分布式计算系统启动时,也会启动分布式计算系统所对应的web UI服务,而任务调度的运行任务执行单元在web UI服务提供的页面(网页用户界面)上显示。该装置70包括页面获取单元701、解析单元702、计算单元703、统计单元704、展示单元705。
页面获取单元701用于利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。其中,网页爬虫技术是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本的技术。网页爬虫技术被广泛用于互联网搜索引擎或其他类似网站,可以自动采集所有其能够访问到的页面内容,以获取或更新这些网站的内容和检索方式。具体地,如图8所示,页面获取单元包括参数获取单元801、页面数据获取单元802。参数获取单元801用于获取计算任务中网页用户界面的统一资源定位符参数。页面数据获取单元802用于根据统一资源定位符参数,利用网页爬虫技术,获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。
解析单元702用于根据该页面的数据解析出常驻服务的运行任务执行单元的数量。具体地,如图9所示,解析单元包括标签获取单元901、标签值统计单元902。标签获取单元901用于从获取常驻服务的运行任务执行单元所在的页面的数据中,获取常驻服务的所有运行任务执行单元的标签。即获取页面中running task所在的标签。标签值统计单元902用于统计所有运行任务执行单元的标签中相对应的值作为运行任务执行单元的数量。
计算单元703用于根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存常驻服务的资源使用数量。
统计单元704用于统计预设时间段内的资源使用数量资源使用数量。具体 地,如图10所示,统计单元包括接收单元101、资源统计单元102。接收单元101用于接收查询指令,该查询指令中包括有对应的预设时间段。资源统计单元102用于根据查询指令对应的预设时间段,统计常驻服务的资源使用数量。
展示单元705用于通过视图展示统计的资源使用数量。可以通过分布式系统监视及网络监视工具展示待展示资源使用数量。
在其他实施例中,统计单元中还包括设置时间间隔,展示单元通过视图根据时间间隔展示统计的资源使用数量(资源使用率)。
图11为本申请另一实施例提供的一种计算任务的资源监测装置的示意性框图。该装置110包括设置单元111、页面获取单元112、解析单元113、计算单元114、统计单元115、展示单元116。该实施例与图7实施例的区别在于:增加了设置单元111。其他单元的详细内容请参看图6实施例中相对应单元的描述,在此不再赘述。
设置单元111,用于设置时间间隔。时间间隔如1分钟,5分钟等。
页面获取单元112,还用于根据该时间间隔,利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。
上述装置实施例的具体实现过程和达到的有益效果可参看对应方法实施例的对应部分,在此不再赘述。
上述装置可以实现为一种计算机程序数据的形式,该程序数据可以在如图12所示的设备上运行。
图12为本申请实施例提供的一种计算任务的资源监测设备的示意性框图。该设备120可以是终端,如服务器等。该设备120包括通过系统总线121连接的处理器122、存储器和网络接口123,其中,存储器可以包括非易失性存储介质124和内存储器125。该非易失性存储介质124可存储操作系统1241和程序数据1242。该程序数据1242被执行时,可使得处理器122执行一种计算任务的资源监测方法。该处理器122用于提供计算和控制能力,支撑整个设备120的运行。该内存储器125中为程序数据的运行提供环境,该程序数据被处理器122执行时,可使得处理器122执行一种计算任务的资源监测方法。该网络接口123用于进行网络通信,如接收指令等。本领域技术人员可以理解,图12中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申 请方案所应用于其上的设备120的限定,具体的设备120可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器122用于运行存储在存储器中的程序数据,以执行前述计算任务的资源监测方法的任一实施例。
应当理解,在本申请实施例中,处理器122可以是中央处理单元(Central Processing Unit,CPU),该处理器122还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现前述计算任务的资源监测方法的任一实施例。
所述计算机可读存储介质可以是设备的内部存储单元,例如设备的硬盘或内存。所述计算机可读存储介质也可以是设备的外部存储设备,例如所述设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡等。进一步地,所述计算机可读存储介质还可以既包括所述设备的内部存储单元也包括外部存储设备。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的设备、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本申请所提供的几个实施例中,应该理解到,所揭露的设备、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种计算任务的资源监测方法,其特征在于,所述方法包括:
    利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据;
    根据所述页面的数据解析出所述运行任务执行单元的数量;
    根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存所述常驻服务的资源使用数量;
    统计预设时间段内的资源使用数量;
    通过视图展示统计的资源使用数量。
  2. 如权利要求1所述的方法,其特征在于,所述利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据,包括:
    获取计算任务中网页用户界面的统一资源定位符参数;
    根据所述统一资源定位符参数,利用网页爬虫技术,获取计算任务中所述常驻服务的运行任务执行单元所在的页面的数据。
  3. 如权利要求1所述的方法,其特征在于,所述根据所述页面的数据解析出所述运行任务执行单元的数量,包括:
    从所述页面的数据中,获取所述常驻服务的所有运行任务执行单元的标签;
    统计所有运行任务执行单元的标签中相对应的值作为运行任务执行单元的数量。
  4. 如权利要求1所述的方法,其特征在于,所述统计预设时间段内的资源使用数量,包括:
    接收查询指令,所述查询指令中包括有预设时间段;
    根据所述查询指令对应的预设时间段,统计所述常驻服务的资源使用数量。
  5. 如权利要求1所述的方法,其特征在于,所述利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据之前,所述方法还包括:
    设置时间间隔;
    所述利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在 的页面的数据,包括:根据所述时间间隔,利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。
  6. 一种计算任务的资源监测装置,其特征在于,所述装置包括:
    页面获取单元,用于利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据;
    解析单元,用于根据所述页面的数据解析出所述运行任务执行单元的数量;
    计算单元,用于根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存所述常驻服务的资源使用数量;
    统计单元,用于统计预设时间段内的资源使用数量;
    展示单元,用于通过视图展示统计的资源使用数量。
  7. 如权利要求6所述的装置,其特征在于,所述页面获取单元,包括:
    参数获取单元,用于获取计算任务中网页用户界面的统一资源定位符参数;
    页面数据获取单元,用于根据所述统一资源定位符参数,利用网页爬虫技术,获取计算任务中所述常驻服务的运行任务执行单元所在的页面的数据。
  8. 如权利要求6所述的装置,其特征在于,所述解析单元,包括:
    标签获取单元,用于从所述页面的数据中,获取常驻服务的所有运行任务执行单元的标签;
    标签值统计单元,用于统计所有运行任务执行单元的标签中相对应的值作为运行任务执行单元的数量。
  9. 如权利要求6所述的装置,其特征在于,所述统计单元,包括:
    接收单元,用于接收查询指令,所述查询指令中包括有对应的预设时间段;
    资源统计单元,用于根据所述查询指令对应的预设时间段,统计所述常驻服务的资源使用数量。
  10. 如权利要求6所述的装置,其特征在于,所述装置还包括:
    设置单元,用于设置时间间隔;
    所述页面获取单元,还用于根据所述时间间隔,利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。
  11. 一种计算任务的资源监测设备,其特征在于,所述设备包括存储器,以及与所述存储器相连的处理器;
    所述存储器用于存储实现计算任务的资源监测的程序数据;所述处理器用于运行所述存储器中存储的程序数据,以执行如下步骤:
    利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据;
    根据所述页面的数据解析出所述运行任务执行单元的数量;
    根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存所述常驻服务的资源使用数量;
    统计预设时间段内的资源使用数量;
    通过视图展示统计的资源使用数量。
  12. 如权利要求11所述的设备,其特征在于,所述处理器在执行所述利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据时,具体执行如下步骤:
    获取计算任务中网页用户界面的统一资源定位符参数;
    根据所述统一资源定位符参数,利用网页爬虫技术,获取计算任务中所述常驻服务的运行任务执行单元所在的页面的数据。
  13. 如权利要求11所述的设备,其特征在于,所述处理器在执行所述根据所述页面的数据解析出所述运行任务执行单元的数量时,具体执行如下步骤:
    从所述页面的数据中,获取所述常驻服务的所有运行任务执行单元的标签;
    统计所有运行任务执行单元的标签中相对应的值作为运行任务执行单元的数量。
  14. 如权利要求11所述的设备,其特征在于,所述处理器在执行所述统计预设时间段内的资源使用数量时,具体执行如下步骤:
    接收查询指令,所述查询指令中包括有预设时间段;
    根据所述查询指令对应的预设时间段,统计所述常驻服务的资源使用数量。
  15. 如权利要求11所述的设备,其特征在于,所述处理器还执行如下步骤:
    设置时间间隔;
    所述处理器在执行所述利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据时,具体执行:根据所述时间间隔,利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现如下步骤:
    利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据;
    根据所述页面的数据解析出所述运行任务执行单元的数量;
    根据运行任务执行单元的数量与资源使用数量的线性关系,计算并保存所述常驻服务的资源使用数量;
    统计预设时间段内的资源使用数量;
    通过视图展示统计的资源使用数量。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述处理器在执行所述利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据时,具体实现如下步骤:
    获取计算任务中网页用户界面的统一资源定位符参数;
    根据所述统一资源定位符参数,利用网页爬虫技术,获取计算任务中所述常驻服务的运行任务执行单元所在的页面的数据。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述处理器在执行所述根据所述页面的数据解析出所述运行任务执行单元的数量时,具体实现如下步骤:
    从所述页面的数据中,获取所述常驻服务的所有运行任务执行单元的标签;
    统计所有运行任务执行单元的标签中相对应的值作为运行任务执行单元的数量。
  19. 如权利要求16所述的计算机可读存储介质,其特征在于,所述处理器在执行所述统计预设时间段内的资源使用数量时,具体实现如下步骤:
    接收查询指令,所述查询指令中包括有预设时间段;
    根据所述查询指令对应的预设时间段,统计所述常驻服务的资源使用数量。
  20. 如权利要求16所述的计算机可读存储介质,其特征在于,所述处理器还实现如下步骤:
    设置时间间隔;
    所述处理器在执行所述利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据时,具体实现:根据所述时间间隔,利用网页爬虫技术获取计算任务中常驻服务的运行任务执行单元所在的页面的数据。
PCT/CN2018/083016 2017-09-28 2018-04-13 计算任务的资源监测方法、装置、设备及可读存储介质 WO2019062077A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710900536.2 2017-09-28
CN201710900536.2A CN108255665B (zh) 2017-09-28 2017-09-28 计算任务的资源监测方法、装置、设备及可读存储介质

Publications (2)

Publication Number Publication Date
WO2019062077A1 true WO2019062077A1 (zh) 2019-04-04
WO2019062077A9 WO2019062077A9 (zh) 2019-06-06

Family

ID=62722306

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/083016 WO2019062077A1 (zh) 2017-09-28 2018-04-13 计算任务的资源监测方法、装置、设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN108255665B (zh)
WO (1) WO2019062077A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078537B (zh) * 2019-11-29 2023-09-22 珠海金山数字网络科技有限公司 Unity游戏bundle包资源划分的评估方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855248A (zh) * 2011-06-29 2013-01-02 中国移动通信集团广西有限公司 一种用户特征信息的确定方法、装置及系统
CN103559083A (zh) * 2013-10-11 2014-02-05 北京奇虎科技有限公司 网页爬取任务调度方法与任务调度器
US20170019487A1 (en) * 2015-01-31 2017-01-19 Splunk Inc. Automated service discovery in i.t. environments
CN106919449A (zh) * 2017-03-21 2017-07-04 联想(北京)有限公司 一种计算任务的调度控制方法及电子设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855248A (zh) * 2011-06-29 2013-01-02 中国移动通信集团广西有限公司 一种用户特征信息的确定方法、装置及系统
CN103559083A (zh) * 2013-10-11 2014-02-05 北京奇虎科技有限公司 网页爬取任务调度方法与任务调度器
US20170019487A1 (en) * 2015-01-31 2017-01-19 Splunk Inc. Automated service discovery in i.t. environments
CN106919449A (zh) * 2017-03-21 2017-07-04 联想(北京)有限公司 一种计算任务的调度控制方法及电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
XIAOXIAOMO: "Spark Streaming (I)(II) (Non-official translation: Application and Practical Operation Strategies (I) and (II) of Spark Streaming", CSDNBLOG(I, 7 July 2017 (2017-07-07), Retrieved from the Internet <URL:(I) https://blog.csdn.net/imgxr/article/details/80130032 (II) https://blog.csdn.net/imgxr/article/details/80130456> *

Also Published As

Publication number Publication date
CN108255665A (zh) 2018-07-06
WO2019062077A9 (zh) 2019-06-06
CN108255665B (zh) 2020-09-01

Similar Documents

Publication Publication Date Title
US11659020B2 (en) Method and system for real-time modeling of communication, virtualization and transaction execution related topological aspects of monitored software applications and hardware entities
AU2021201512B2 (en) Data stream processing language for analyzing instrumented software
US20180285417A1 (en) Intelligent query parameterization of database workloads
US11016972B2 (en) Splitting a time-range query into multiple sub-queries for serial execution
US20100287553A1 (en) System, method, and software for controlled interruption of batch job processing
WO2018045753A1 (zh) 用于分布式图计算的方法与设备
US11016971B2 (en) Splitting a time-range query into multiple sub-queries for parallel execution
US9423957B2 (en) Adaptive system provisioning
US20150205633A1 (en) Task management in single-threaded environments
US9442817B2 (en) Diagnosis of application server performance problems via thread level pattern analysis
US20160182320A1 (en) Techniques to generate a graph model for cloud infrastructure elements
US20110252407A1 (en) System and method for information extraction from within an active application during execution
JP6890721B2 (ja) 連続するデータブロックの非同期処理
US20170064021A1 (en) Methods and apparatus to monitor usage of virtual computing environments
US20180143897A1 (en) Determining idle testing periods
CN110704097A (zh) 一种数据收集方法、装置及电子设备和存储介质
CN107391528B (zh) 前端组件依赖信息搜索方法及设备
CN108399095B (zh) 支持动态管理定时任务的方法、系统、设备和存储介质
WO2019062077A1 (zh) 计算任务的资源监测方法、装置、设备及可读存储介质
CN113360581A (zh) 数据处理方法、装置及存储介质
US10970055B2 (en) Identifying software and hardware bottlenecks
CN114201508A (zh) 数据处理方法、数据处理装置、电子设备和存储介质
CN104731900A (zh) 一种Hive调度方法及装置
US10949232B2 (en) Managing virtualized computing resources in a cloud computing environment
CN113778658A (zh) 任务分配方法及装置、电子设备、存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18863634

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18863634

Country of ref document: EP

Kind code of ref document: A1