No side effects, no surprises.

Resource evaluator

The resource evaluator captures a snapshot of the host computer's dynamic attributes. The resource evaluator iterates over each composed object—in the order determined by the dependency tree builder—capturing point-in-time measures of those dynamic attributes.

As a frame of reference, the reader should understand that composed objects may be one of two generic types: resource objects or validation objects. The resource evaluator skips over the validation objects (which are described later), working only with resource objects.

Resource objects specify which component of the host computer to inspect, and which attribute of the component to evaluate. Components may be any part of the host that has measurable attributes, such as CPU, memory, filesystems, network interfaces, etc. Attributes may be any numeric or textual value that provides information about the operational status of the component, such as cpu load, memory utilization, filesystem availability, or network throughput.

In this example, a resource is defined which captures four virtual memory attributes, and places a snapshot of those values in the four variables: vms, vmu, vmf, vmp.

sample-resource.v
[R]
type = resource
resource = memory
vms = virtual_memory_size
vmu = virtual_memory_used
vmf = virtual_memory_free
vmp = virtual_memory_percent

Resource modules may be defined, by plug-in developers, to capture a variety of hardware, operating system, and software package values. When plug-in developers create a custom resource module, they publish a module vocabulary  which is the formal definition of keywords that can be used by system administrators for writing rulebooks.

In the previous example, the four names (virtual_memory_size, virtual_memory_used, virtual_memory_free, virtual_memory_percent) used in the right-hand side of the statements, are keywords that are part of the vocabulary published by the memory resource module.

When the resource evaluator has completed its work, the internal representation of the object [R] might look something like this:

internal resource representation
. . .
vms = 4128764
vmu = 596
vmf = 4128168
vmp = 99
. . .

With this evaluation complete, the variable substitution processor can be started.