![]() |
License
Manager Example of Monitoring Using the FLEA Language |
|
This document provides an example of using FLEA to define event monitors. For general information on Cs3's monitoring efforts, click here. I. INTRODUCTION Monitoring refers to the task of watching some system's activities so as to detect when certain combinations of events have happened. In principle, the user (who might be a person or a computer system) could observe the monitored system's events directly, and perform all the reasoning to deduce occurrencies of the combinations of events in which he/she/it is interested. The whole purpose of the Cs3's monitoring technology is to take over the burden of this reasoning. This document focusses on FLEA, Cs3's small language for expressing event combinations, and illustrates its use in monitoring a small but intuitive example. Further links point to screen snapshots illustrating how the experimental user-interface for FLEA facilitates the task of defining events, and also illustrates how event notifications are reported to the user. LICENSE MANAGER EXAMPLE (return) A license manager is a system that handles requests to use a piece of licensed software so as to permit multiple, simultaneous invocations of that software provided that there are never more simultaneous invocations than licenses purchased. The license manager itself is built to ensure the requirement on limiting the number of invocations, so there is little point our monitoring this. Instead, we might wish use monitoring to help us determine how many licenses to purchase, what limit to place on our user population, which machine to host the license manager itself on, whether to configure licenses to have some pre-set expiry time after which they must be renewed, etc. For a general discussion of monitoring and license manager issues, the interested reader is referred to [Fickas&Feather1995]. For simplicity, this document will focus on monitoring of just licenses, users, and their acquisition of licenses. EXTERNAL EVENTS (return) Users may request licenses, return licenses that they have been granted, and cancel pending requests for licenses. The license manager may grant the request for a license. The systems administrator may increase or decrease the number of licenses, and add and remove registered users (people who will be allowed to request licenses). These interactions, between license manager and its environment, are what we monitor. Each such interation is something we call an "external event" - an "event" because it is takes place at some instant in time (e.g., the time at which a user requests a license), and "external" because it is a product of the system that we are monitoring (namely the license manager and its environment of users and systems administrator). Suppose that we start by deciding to monitor just the addition and removal of users, and the addition and removal of licenses. We would declare this interest to the monitor as follows: (defevent
AddLicense :external ( timestamp ) ) The first line declares an external event named AddLicense, with only a timestamp parameter, indicated by the singleton parameter list ( timestamp ). Similarly for RemoveLicense. The third line declares an external event named AddUser, with a two parameters, of type timestamp and String. Each occurrence of this event will have a timestamp and a string-valued parameter corresponding to the name of the user being added. Similarly for RemoveUser. Having issued these declarations, the monitor will thereafter take notice of these events, remembering them in its database of events, and allowing the definition of further events in terms of these external events. LOGICAL COMBINATIONS OF EVENTS (return) Logical combinations of events can be defined. For example, (defevent
AddOrRemoveLicense :definition ( ( tX ) s.t. ( or (AddLicense tX )
(RemoveLicense tX ) ) ) ) If an event is defined in terms of other events that themselves have parameters, then there will be a variety of ways in which those parameter values can be used. Examples: (
defevent AddOrRemoveMartin :definition ( ( tX ) s.t. (
defevent AddOrRemoveUser :definition ( ( tX P1 ) s.t. ( or (AddUser
tX P1) (RemoveUser tX P1) ) ) ) Our experimental user-interface for FLEA makes the task of defining events such as the above a simple matter. To see further details, click here. SEQUENCES OF EVENTS (return) Sequences
of events are often useful to define. For example: The time at which the AddThenRemoveLicense event occurs is the time at which the later of its constituent events (namely, RemoveLicense) occurs. Although it might seem nice to try to define the time of the AddThenRemoveLicense event to be the time of the earlier of its constituent events, it would be contrary to the spirit of FLEA to do so ( i.e., we stronglyrecommend against it!). Generally, the time of a defined event should be the earliest time at which that event can be determined to have occurred. Thus at the time of an AddLicense event, we have no way of knowing whether or not a RemoveLicense event will follow; it is only if and when a RemoveLicense event does thereafter occur that we can determine that the AddThenRemoveLicense event has occurred. PARAMETERIZED EVENTS (return) Just as was the case with logical events, if an event is defined in terms of a sequence of other events that themselves have parameters, then there will be a variety of ways in which those parameter values can be used. Examples: (
defevent AddThenRemoveMartin :definition ( ( tB ) s.t. (
defevent AddThenRemoveSameUser :definition ( ( tB P1 ) s.t. (
defevent AddThenRemoveSomeSameUser :definition ( ( tB ) s.t. (
defevent AddThenRemoveUsers :definition ( ( tB PA1 PB1 ) s.t. (
defevent AddThenRemoveSomeUsers :definition ( ( tB ) s.t. (
defevent AddMartinThenRemoveSomeUser :definition ( ( tB P2 ) s.t. SEQUENCES EXCLUDING EVENTS (return) Sequences of events that exclude certain event during those sequences are definable. For example: (
defevent LicenseChangeWithoutUserChange :definition ( ( tB ) s.t. COUNTING EVENTS (return) Events can be counted. For example: (
defrel CountAddLicenses :definition ( ( x ) s.t. ( countof0 (AddLicense
* ) x ) ) ) (
defrel CountLicenses :definition ( ( x ) s.t. As with other definitions, the experimental user-interface for FLEA makes the task of defining counts such as the above a simple matter. To see further details, click here. TRANSITION EVENTS (return) Events can be defined to occur whenever some particular transition occurs. Examples: (
defevent MoreThan5Users :transition ( ( tx ) s.t. (
defevent MoreLicensesThanUsers :transition ( ( tx ) s.t. (
defevent UsersMoreThanTwiceLicenses :transition ( ( tx ) s.t. The experimental user-interface for FLEA for defining transition events such as the above can be see by clicking here. FURTHER DECLARATIONS OF EXTERNAL EVENTS (return) So far all our definitions have been in terms of the four external events AddUser, RemoveUser, AddLicense and RemoveLicense. Remember, however, that there are other interactions between license manager and its environment in which we might take an interest, namely users' requesting, returning and cancelling requests for licenses, and the license manager granting license requests. It is possible to provide declarations of these external events as we go along (of course, until we issue such declarations, the monitor will have been ignoring occurrences of these events, and we cannot have defined any other events in terms of them). The declarations would be in the same style as the originally declared external events, namely: (defevent
RequestLicense :external ( timestamp String ) ) TIME-SENSITIVE EVENTS (return) In monitoring the license manager, we might wish to know whether or not the monitor is fulfilling user's requests for licenses in a timely manner. Two related forms of declarations allow for the definition of such time-sensitive events: (
defevent Speedy :definition ( ( tB P1 ) s.t. (
defevent tardy :definition ( ( lim P1 ) s.t. The experimental user-interface for FLEA for defining time-sensitive events such as the above can be see by clicking here. CONCLUDING EXAMPLE (return) We finish with an example that computes a measure of "user happiness", defined as the percentage of the number of Speedy events out of the total number of Speedy and Tardy events, provided the number of Speedy and Tardy events totals at least 20 (since we do not want to compute this percentage on too few statstics to be meaningful). The definition is: (
defrel UserHappiness :definition ( ( x ) s.t. As with the counts we defined earlier, it is possible to define transition events in terms of this value, for example: (
defevent TooHappy :transition ( ( tx ) s.t. ( start ( > (UserHappiness
= ) 90 ) ) ) ) The experimental user-interface for FLEA for defining percentages such as the above can be see by clicking here.
|
||||
| Logical Combinations | Counts | Transition Events | Time Events | Percentage Relations |