Specific embodiment
Graphic operation
An optimized integration of the invention is graphic operation.Graphic operation is the execution of the operation conditions in reaction profile formula system
The operation performed on figure.
An example of defined execution figure with vertex representation in execution figure as shown in figure 1, be distributed in the present invention
Event in formula system, the association between event is represented with the side on connection summit.Included in execution figure defined in the present invention
Two keys:Causality and polymerization.Then, the present invention proposes two kinds of graphic operations on the basis of figure is performed:Burst
(slicing) and polymerization (aggregation).
To in the diagnosis of distributed system, user can attempt to carry out following operation:1) sought according to causal correlation
Look for relevant information;2) operation information is summarized with the suitable polymerization of the form of classifying or conclusion, is entered with trouble-shooting point
Row is further to be analysed in depth.
In performing figure at one, each run case from mesh distribution mark system is represented as a summit
(vertex).Such as, in Fig. 1, event (i.e. summit) is represented using small rectangle.Such as, on the first machine is run on
One thread 102 includes event b 104, event c 106, and event b 104 therein is made by pintf daily records (printf log)
With event c 106 is defined by asynchronous request.The second thread 110 run on the second machine includes event a 112, thing
Part d 114, wherein event d 114 are defined by asynchronous request.The 3rd thread 120 run on the 3rd machine includes event
E 122, event e 122 is used by request.
Run case in distributed system is to be mutually related.Perform figure in, point to while (while directive) by with
In this association of expression.Different types of side can be used for defining different types of association.As described above, figure is being performed
In, event is by fixed-point representation.For example, connecting a source event (source event) and an endpoints using side (use edge)
(destination event) and with the direction that endpoints are pointed to from source event, source event definition or transfer one
Object, the destination of the object is endpoints and is consumed by the endpoints.The example of the object of this type is network
Message or cross-thread are asked.In Fig. 1, the arrow with direction<C, e>130 and arrow<D, e>132 is the example for using side.
Synchronous side (sync edge) is represented from two synchronizations of the different event of different threads, to ensure to shared right
Unique access of elephant or sequential cross-thread are operated.
Order side (fall-through) is connected to two continuous events in same thread, the direction on order side be from
The event that the event for first carrying out is performed after pointing to.Side in Fig. 1<B, c>140 is exactly order side.
Fragmentation
Burst (slicing) operation of the definition in the present invention not only marks operation using special label (tag)
Information.Fragmentation is utilized and performs figure:A root summit, one root event (root event) of correspondence, the root thing are selected first
Part is probably direct or user related to the phenomenon of failure point of special interest, and root event is selected by user.From selected
Fixed root event (root event) is set out, and finds the event for having cause and effect dependence with the event.The process of searching passes through
Directive Fragmentation realizes that Fragmentation includes preceding to Fragmentation (forward slice) and reverse Fragmentation
(backward slice).Forward direction Fragmentation will find all events for directly or indirectly depending on root event, and reverse
The Fragmentation event directly or indirectly interdependent by the root event is found.It is so-called interdependent, refer to the presence of cause and effect pass between event
System.
In practical implementations, search accurate and complete cause and effect dependence very Expenses Cost and be difficult to.
Therefore, in actual applications, rational approximate it is sufficient that.In a kind of idea, it is considered to all of use while and during order just
It is considered a kind of to the rational approximate of cause and effect dependence.Studies have found that, order side actually can not be hidden
Dependence containing cause and effect.For example, in one kind typical case of message handling system realizes, a thread can continuously receive new arrival
Message and call corresponding Message Processing person.It is also to be connected by order side between the calling of two Message Processing persons, but it is real
On border, between the two Message Processing persons and in the absence of any significant cause and effect dependence.In this case, it is similar
Order side can roll up invalid operation so that the burst of cause and effect dependence becomes inefficient.Therefore, in the present invention,
The concept of cause and effect scope (causal scope) is proposed, cause and effect scope is the concept based on " using side ".Cause and effect scope refers to:
The use side specified for one, all events in the range of cause and effect are all the source event (source that side is used with this
Event), i.e., there is dependence in source summit.More precisely, this uses the endpoints (destination on side
Event), i.e. destination vertex and all events related with the endpoints, i.e., since the endpoints, own afterwards
Event associated therewith, either connects by using while still by order, all will be considered as cause and effect scope it
It is interior and there is causality using the source event on side with this.Such as, in Fig. 1, big rectangle 150,152 and 154 is represented
The example of the cause and effect scope in the present invention.
Forward direction Fragmentation and reverse Fragmentation in the present invention are all based on the realization of cause and effect scope, such as, in Fig. 1
The middle example that the forward direction Fragmentation carried out for root event with event a 112 is represented using dash area.
The interface prototype of Fragmentation is as follows:
Graph<TV, TE>Slicing(
this Vertex<TV, TE>SrcVertex,
Slice.Type type);
Converging operation
Polymerization is the effective ways for effectively managing a large amount of letter datas, in particular by graduate polymerization.It is in distribution
Naturally hierarchy is there is in system:Program is generally made up of module, and module is made up of class, and each class includes one group of function,
Here it is natural hierarchy.The execution of distributed system can be polymerized first on thread level, afterwards in process level
Upper polymerization, and then be polymerized on machine level.One distributed system generally includes multiple logical levels, and these logical levels can
Should be specifically used to specify with basis:Such as system action can be analyzed on RPC levels, or in the OS systems of low level
Analyzed using jack interface (socket interface) on system.
One content is related to event, represents the polymerized unit (aggregation unit) belonging to the event.Can define
The polymerized unit of multilayer.Such as, a layer of polymerized unit can be static structure, such as module, class and function.Polymerized unit
Another layer can be operating structure, such as machine, process and thread.Using above-mentioned content and polymerized unit, it becomes possible to right
Event carries out converging operation, and can effectively be reduced after polymerization needs data volume to be processed and information content, improves examining for distributed system
Disconnected efficiency.
The crucial idea of converging operation of the invention is performed on a suitable level of hierarchical structured system
The aggregation of figure, summarizes with to system action.Perform the continuous fragment of the event with identical polymerized unit in figure
Or several events are summarised and gather execution figure (the also execution figure as current level of a level high (segment)
Result figure) in a single event (summit) in.The present invention can be automatic by code position and the mark of run time position
Label are attached in all of event automatically, in this, as a foundation of base polymer operation.Converging operation is one open
Personalized operation, parameter and the degree of polymerization that user can be polymerized with self-defining.That is, the condition of converging operation,
I.e. which event (summit) and side need to be polymerized, and converging operation number of times, that is, carry out converging operation several times, be aggregated to
Which kind of degree all can be by user's sets itself as needed.
Fig. 2 discloses an example of converging operation, the debugging (debugging of converging operation correspondence reproducer
Replication), the lateral shaft in Fig. 2 represents time time.Wherein the latter half of Fig. 2 represents the polymerization on process level
Operation, rectangle therein represents the event after the polymerization on process level, and the title in rectangle is represented in process level
The title of event after upper polymerization, the numeral in rectangle represents the thing in the next level included in the event after the polymerization
The quantity of part.Such as, event Message is included in network process Network 202::DoExecution204, wherein including
12 (thread-level) events.Event ReplicateWrite 212 is included in duplicating process Replication 210, comprising
149 (thread-level) events and event WriteRequestFailed 214, comprising 24 (thread-level) events.In input and output
Event SerializedOIWrite 222 is included in process I/O220, comprising 17 (thread-level) events.The top half of Fig. 2
The title of event after polymerization on expression machine level, under the numeral in rectangle is represented included in the event after the polymerization
The quantity of the event in one level.Such as, event Primary 232 is included in No. 0 machine Machine0 230, wherein wrapping
440 (process level) events are contained.Event Secondary1 242 is included in No. 1 machine Machine1 240,144 are contained
Individual (process level) event.Event Secondary2 252 is included in No. 2 machine Machine2 250,202 (processes are contained
Level) event.When there is copy error, by converging operation, the machine for making a mistake is No. 2 machines, correspondence event
Secondary2 250, at this point it is possible to further the event Secondary2 250 to No. 2 machines is decomposed, in process level
On further search for mistake source.
The interface prototype of converging operation is as follows:
Label functions therein can require to add the mark as polymerization foundation in event automatically or according to user
Sign.
The method for realizing graphic operation
Based on above-mentioned graphic operation, the present invention proposes a kind of method for realizing graphic operation.
With reference to shown in Fig. 3, Fig. 3 discloses the flow chart of the method for realizing graphic operation of an embodiment of the invention.
The method 300 includes:
S302. the execution figure of distributed system, the event in execution figure in vertex representation distributed system, connection top are defined
Association between the side expression event of point.It is as described above, perform in figure while including using while and order side.Use side
A destination vertex is pointed to from a source summit, the source summit defines or transfer an object, and the destination of the object is the terminal top
Put and consumed by the destination vertex.Order side connects two continuous events in same thread, refers to from the event for first carrying out
The event for performing backward.
S304. Fragmentation, since a selected summit in execution figure, searches all summits for depending on the summit
And the interdependent summit in the summit.In one embodiment, Fragmentation uses mode described above, and selection first is held
A summit in row figure as root summit, one root event of the root vertex correspondence.It is then determined that the direction of Fragmentation, before being
To Fragmentation or backward Fragmentation.The all summits for depending on root summit of forward direction Fragmentation lookup, and backward burst
The interdependent all summits in root summit are searched in operation.In one embodiment, the Fragmentation is according to cause and effect scope trip, as
Above-mentioned definition, using side one cause and effect scope of correspondence, all summits in the range of the cause and effect are all to depend on the source for using side
Summit.
S306. converging operation, the several summits that there is dependence in execution figure and the side for connecting these summits are gathered
Integrated condensate, by performing figure generation than performing the result figure of one layer high of figure, the vertex representation condensate in result figure, result figure
In side represent association between condensate, converging operation can be repeated repeatedly, and the result figure of higher level is generated each time.
Described in converging operation described above, condensate includes the quantity on the summit for embodying low a layer that the condensate is included
Mark.
Realize the device of graphic operation
The present invention also propose a kind of device for realizing graphic operation, it is to be understood that this realize graphic operation device be by
What software was realized.Fig. 4 discloses the structure chart of the device for realizing graphic operation of an embodiment of the invention.The device is realized
Method shown in Fig. 3, the device 400 includes:Perform figure definition device 402, slicing apparatus 404 and polyplant 406.
The execution figure that figure definition device 402 defines distributed system is performed, in execution figure in vertex representation distributed system
Event, connect summit side expression event between association.It is as described above, perform in figure while including using while and
Order side.Using side a destination vertex, one object of source summit definition or transfer, the purpose of the object are pointed to from a source summit
Ground is the destination vertex and is consumed by the destination vertex.Order side connects two continuous events in same thread, from elder generation
The event that the event of execution is performed after pointing to.
Slicing apparatus 404 perform Fragmentation, and since a selected summit in execution figure, lookup is all to depend on this
The interdependent summit in the summit on summit and the summit.Slicing apparatus 404 are connected to execution figure definition device 402.In a reality
Apply in example, Fragmentation uses mode described above, select to perform a summit in figure first as root summit, the root
One root event of vertex correspondence.It is preceding to Fragmentation or backward Fragmentation it is then determined that the direction of Fragmentation.Forward direction
Fragmentation searches all summits for depending on root summit, and backward Fragmentation searches the interdependent all summits in root summit.
In one embodiment, the Fragmentation, such as above-mentioned definition, uses side one cause and effect model of correspondence according to cause and effect scope trip
Enclose, all summits in the range of the cause and effect are all to depend on the source summit for using side.
Polyplant 406 is connected to slicing apparatus 404 and execution figure definition device 402, and polyplant 406 performs polymerization behaviour
Make, according to the result of Fragmentation, the several summits that there is dependence in execution figure and the side for connecting these summits are gathered
Integrated condensate, by performing figure generation than performing the result figure of one layer high of figure, the vertex representation condensate in result figure, result figure
In side represent association between condensate, converging operation can be repeated repeatedly, and the result figure of higher level is generated each time.
Described in converging operation described above, condensate includes the quantity on the summit for embodying low a layer that the condensate is included
Mark.
The diagnosis of distributed system
By means of above-mentioned graphic operation, with reference to database manipulation, it becomes possible to realize the diagnosis for distributed system.Wherein
Database manipulation be mainly used in being positioned, such as " where " in database manipulation operation can be used in Fragmentation
Middle positioning root event, or fault point or point interested.
The code of one section of diagnostic method of the distributed system for being integrated with database manipulation and graphic operation of example is as follows:
Where operations therein represent the positioning action in database manipulation, and Slicing operations therein represent graphic operation
In Fragmentation.Where operations determine root fixed point (root event) for Slicing operations.
Following codes represents the error analysis in distributed system, is integrated with database manipulation, Fragmentation and polymerization
Operation:
Following codes represents the CPA in distributed system, be integrated with database manipulation, Fragmentation and
Converging operation:
The diagnostic method of distributed system
The present invention also proposes a kind of diagnostic method of the distributed system for being integrated with graphic operation and database manipulation, with reference to figure
Shown in 5, the method 500 includes:
S502. the execution figure of distributed system, the event in execution figure in vertex representation distributed system, connection top are defined
Association between the side expression event of point.It is as described above, perform in figure while including using while and order side.Use side
A destination vertex is pointed to from a source summit, the source summit defines or transfer an object, and the destination of the object is the terminal top
Put and consumed by the destination vertex.Order side connects two continuous events in same thread, refers to from the event for first carrying out
The event for performing backward.
S504. Fragmentation, Fragmentation is first with an event in the positioning distributed system of database manipulation, root
Determine that a selected summit in execution figure starts according to the event, search all summits for depending on the summit and the summit institute
Interdependent summit.In one embodiment, Fragmentation is first with database manipulation, and such as Where operation selections are distributed
An event in system is performing the corresponding summit of figure determination as root summit as root event based on the root event.Then
Determine the direction of Fragmentation, be preceding to Fragmentation or backward Fragmentation.Forward direction Fragmentation searches all depending on
The summit on root summit, and backward Fragmentation searches the interdependent all summits in root summit.In one embodiment, burst behaviour
Make according to cause and effect scope trip, such as above-mentioned definition, use side one cause and effect scope of correspondence, all summits in the range of the cause and effect
All it is to depend on the source summit for using side.
S506. converging operation, according to the result of Fragmentation, by the several summits that there is dependence in execution figure and
The side for connecting these summits is gathered into condensate, by performing figure generation than performing the result figure of one layer high of figure, the top in result figure
Point represents condensate, and the side in result figure represents the association between condensate, and converging operation can be repeated repeatedly, each secondary
Into the result figure of higher level.Described in converging operation described above, condensate includes embodying what the condensate was included
The mark of the quantity on low one layer of summit.
The diagnostic device of distributed system
The present invention also proposes a kind of diagnostic device of distributed system, it is to be understood that the diagnosis of the distributed system
Device is realized by software.Fig. 6 discloses the structure of the diagnostic device of the distributed system of an embodiment of the invention
Figure.The device realizes the method shown in Fig. 5, and the device 600 includes:Perform figure definition device 602, operation integrating device 608, divide
Sheet devices 604 and polyplant 606.
The execution figure that figure definition device 602 defines distributed system is performed, in execution figure in vertex representation distributed system
Event, connect summit side expression event between association.It is as described above, perform in figure while including using while and
Order side.Using side a destination vertex, one object of source summit definition or transfer, the purpose of the object are pointed to from a source summit
Ground is the destination vertex and is consumed by the destination vertex.Order side connects two continuous events in same thread, from elder generation
The event that the event of execution is performed after pointing to.
The operation integrated graphic operation of integrating device 608 and database manipulation.
Slicing apparatus 604 perform Fragmentation, and slicing apparatus 604 are connected to execution figure definition device 602 and operation is integrated
Device 608.Fragmentation determines to hold first with an event in the positioning distributed system of database manipulation according to the event
A selected summit in row figure starts, and searches all summits for depending on the summit and the interdependent summit in the summit.
In one embodiment, Fragmentation is first with database manipulation, such as a thing in Where operation selection distributed systems
Part is performing the corresponding summit of figure determination as root summit as root event based on the root event.It is then determined that Fragmentation
Direction is preceding to Fragmentation or backward Fragmentation.Forward direction Fragmentation searches all summits for depending on root summit, and
Backward Fragmentation searches the interdependent all summits in root summit.In one embodiment, the Fragmentation is according to cause and effect scope
Trip, such as above-mentioned definition, using side one cause and effect scope of correspondence, all summits in the range of the cause and effect are all to depend on this to make
With the source summit on side.
Polyplant 606 performs converging operation, and polyplant 606 is connected to execution figure definition device 602, operates integrated dress
Put 608 and slicing apparatus 604.The converging operation of polyplant 606 is interdependent by existing in execution figure according to the result of Fragmentation
Several summits of relation and connect the side on these summits and be gathered into condensate, by performing figure generation than performing the knot of one layer high of figure
Fruit is schemed, the vertex representation condensate in result figure, and the side in result figure represents the association between condensate, and converging operation can be repeated
Perform the result figure for repeatedly generating higher level each time.Described in converging operation described above, condensate includes embodying
The mark of the quantity on the summit of included low one layer of the condensate.
Graphic operation proposed by the present invention and can find distribution using the diagnostic techniques of the distributed system of the graphic operation
The causality between run case in system, burst and polymerization are carried out based on the causality to event, to reduce needs
The information content for the treatment of and cause information between association definitely.The diagnosis that the present invention can effectively lift distributed system is accurate
The diagnosis efficiency of true rate.
Above-described embodiment is available to be familiar with person in the art and realizes or using of the invention, be familiar with this area
Personnel can make various modifications or change without deviating from invention thought of the invention, thus protection of the invention to above-described embodiment
Scope is not limited by above-described embodiment, and should be the maximum magnitude for meeting the inventive features that claims are mentioned.