Defining Resources
Some statistics apply to the entire class, and no separate resources need to be defined within that class. For example, the //:class.app/solaris/sysstat/sysconf
system configuration statistics are for the entire system. No resources are defined for that class.
Some statistics have a value for the entire class and separate values for individual resources within the class. For example, //:class.cpu//:res.id/0//:stat.usage
gives usage statistics for one CPU in the system, while //:class.cpu//:stat.usage
gives usage statistics for all CPUs in the system combined.
If you know the resources in the class at the time you define the class, define those resources as static-instances
in the class json
file as described in Adding Static Resources.
If some instances of the class are not known when you define the class, you can add those resources dynamically as described in Adding Resources Dynamically.
A single class can have some resources that are statically defined and others that are added dynamically.
A resource inherits class metadata, and you can add metadata that only applies to the resources.