Go to main content

Using Oracle® Solaris 11.4 StatsStore and System Web Interface

Exit Print View

Updated: February 2019
 
 

Top Values

The op.top operation returns at most the limit largest values of the given SSIDs over the specified period. The default value of limit is 5. Use op.top(limit) to change the limit to return more or fewer of the largest values. Fewer than limit values might be returned because zero values and NO_DATA are not included in the results.

The proc class represents process statistics. The op.top operation is useful for reducing the process data to information about only the most active of hundreds of processes on the system. The following example lists the three processes that are using the largest percentage of CPU resources:

$ sstore capture '//:class.proc//:res.*//:stat.cpu-percentage//:op.top(3)'
TIME                VALUE IDENTIFIER
2016-05-17T18:14:09 24.54833984375 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:09 0.4150390625 //:class.proc//:res.sstored/959/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:09 0.091552734375 //:class.proc//:res.zpool-rpool/5/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:10 24.5697021484375 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:10 0.4119873046875 //:class.proc//:res.sstored/959/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:10 0.0885009765625 //:class.proc//:res.zpool-rpool/5/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:11 24.2889404296875 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:11 0.4058837890625 //:class.proc//:res.sstored/959/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:11 0.091552734375 //:class.proc//:res.zpool-rpool/5/root//:stat.cpu-percentage//:op.top(3)

The sstore export command presents all the data for one resource and then all the data for the next resource. If data is recorded over a long period of time, the values shown by export could be very different from the values shown by capture because the sstore export command compares all available historical data to determine which resources are the top in value over the entire period. Over time, the sstore capture results will show different sets of top processes at different points in time. The sstore capture command shows only limit number of SSIDs at each particular time but will show more than limit number of SSIDs in the complete results over a long period of time. The sstore export command shows only limit number of SSIDs in the complete results.

The following sstore export command specifies the start time from the preceding sstore capture command and requests only three results for each SSID. Notice that the zpool-rpool/5 process is not one of the top three over a longer period. The pkg/1869 process starts at a later time but is the second-largest CPU user over the entire period. If the -p option is not specified, many more values are shown, but only for these same three resources.

$ sstore export -t 2016-05-17T18:14:09 -p 3 '//:class.proc//:res.*//:stat.cpu-percentage//:op.top(3)'
TIME                VALUE IDENTIFIER
2016-05-17T18:14:09 24.54833984375 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:10 24.5697021484375 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:11 24.2889404296875 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:52 1.275634765625 //:class.proc//:res.pkg/1869/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:53 2.8717041015625 //:class.proc//:res.pkg/1869/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:54 3.8787841796875 //:class.proc//:res.pkg/1869/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:09 0.4150390625 //:class.proc//:res.sstored/959/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:10 0.4119873046875 //:class.proc//:res.sstored/959/root//:stat.cpu-percentage//:op.top(3)
2016-05-17T18:14:11 0.4058837890625 //:class.proc//:res.sstored/959/root//:stat.cpu-percentage//:op.top(3)

By default, the op.top operation sorts SSIDs by comparing the average of all values for each SSID. If you prefer you can sort the top SSIDs by comparing the largest of all values of each SSID or by comparing the variance among all values of each SSID. The op.top operation takes an optional metric argument that can have a value of either max or variance. In the preceding example, the result from specifying op.top(3, metric=max) is exactly the same as the result from specifying op.top(3) because the largest value of pkg/1855 is larger than the largest value of pkg/1869, which is larger than the largest value of sstored/959.

The following example shows that the variance in values of pkg/1869 is greater than the variance in values of pkg/1855, which is greater than the variance in values of rad/1874. This result also shows that the variance in values of rad/1874 is greater than the variance in values of sstored/959.

$ sstore export -t 2016-05-17T18:14:09 -p 3 '//:class.proc//:res.*//:stat.cpu-percentage//:op.top(3,metric=variance)'
TIME                VALUE IDENTIFIER
2016-05-17T18:14:52 1.275634765625 //:class.proc//:res.pkg/1869/root//:stat.cpu-percentage//:op.top(3, metric=variance)
2016-05-17T18:14:53 2.8717041015625 //:class.proc//:res.pkg/1869/root//:stat.cpu-percentage//:op.top(3, metric=variance)
2016-05-17T18:14:54 3.8787841796875 //:class.proc//:res.pkg/1869/root//:stat.cpu-percentage//:op.top(3, metric=variance)
2016-05-17T18:14:09 24.54833984375 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3, metric=variance)
2016-05-17T18:14:10 24.5697021484375 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3, metric=variance)
2016-05-17T18:14:11 24.2889404296875 //:class.proc//:res.pkg/1855/root//:stat.cpu-percentage//:op.top(3, metric=variance)
2016-05-17T18:14:52 0.115966796875 //:class.proc//:res.rad/1874/root//:stat.cpu-percentage//:op.top(3, metric=variance)
2016-05-17T18:14:53 0.1068115234375 //:class.proc//:res.rad/1874/root//:stat.cpu-percentage//:op.top(3, metric=variance)
2016-05-17T18:14:54 0.1007080078125 //:class.proc//:res.rad/1874/root//:stat.cpu-percentage//:op.top(3, metric=variance

The following examples show how the op.top operation handles partitioned SSIDs. The following example shows the number of bytes sent by each listed application.

$ sstore capture //:class.net/ip//:stat.out-bytes//:part.application
2016-05-18T12:18:55  //:class.net/ip//:stat.out-bytes//:part.application
                    sshd: 332648.0
                    httpd: 0.0
                    sched: 79741.0
                    nscd: 604.0
                    pkg: 0.0
                    extract_boot_fil: 0.0
                    grub-mkconfig: 0.0
                    00_header: 0.0
                    nfsmapid: 399.0
                    grub-install: 0.0
                    ntpd: 448.0
                    ldap_cachemgr: 3051.0
2016-05-18T12:18:56  //:class.net/ip//:stat.out-bytes//:part.application
                    sshd: 348264.0
                    httpd: 0.0
                    sched: 86397.0
                    nscd: 604.0
                    pkg: 5302.0
                    extract_boot_fil: 0.0
                    grub-mkconfig: 0.0
                    00_header: 0.0
                    nfsmapid: 399.0
                    grub-install: 0.0
                    ntpd: 448.0
                    ldap_cachemgr: 3051.0

The following sstore capture command reduces the data to just the largest three partition key values at each data point.

$ sstore capture '//:class.net/ip//:stat.out-bytes//:part.application//:op.top(3)'
2016-05-18T12:18:55  //:class.net/ip//:stat.out-bytes//:part.application//:op.top(3)
                    sshd: 332648.0
                    sched: 79741.0
                    ldap_cachemgr: 3051.0
2016-05-18T12:18:56  //:class.net/ip//:stat.out-bytes//:part.application//:op.top(3)
                    sshd: 348264.0
                    sched: 86397.0
                    pkg: 5302.0

The sstore export command determines the top values of each partition key over the entire period for which data are available and then compares those top values for each key to determine the top keys over the entire period. Thus the sstore export command shows the same partition keys at each time stamp, even if the key has a zero value at some points. In the preceding sstore capture results, the ldap_cachemgr key has the third largest value of all the partition keys at time 12:18:55. The sstore export results at that same time report the value of the pkg key because over the entire time period, the sshd, sched, and pkg keys have the highest values. The sstore export results show these same three keys in this same order at all data points.

$ sstore export '//:class.net/ip//:stat.out-bytes//:part.application//:op.top(3)'
2016-05-18T12:18:55  //:class.net/ip//:stat.out-bytes//:part.application//:op.top(3)
                    sshd: 332648.0
                    sched: 79741.0
                    pkg: 0.0
2016-05-18T12:18:56  //:class.net/ip//:stat.out-bytes//:part.application//:op.top(3)
                    sshd: 348264.0
                    sched: 86397.0
                    pkg: 5302.0

If a single SSID specifies both partitioned SSIDs and non-partitioned SSIDs, partitioned SSIDs are ignored. The following command records only values for //:class.proc//:res.*//:stat.cpu-percentage; no values are recorded for //:class.net/ip//:stat.out-bytes//:part.application:

$ sstore capture \
> '//:s.[//:class.proc//:res.*//:stat.cpu-percentage,//:class.net/ip//:stat.out-bytes//:part.application]//:op.top'

If you specify multiple non-partitioned SSIDs in a single SSID for op.top, all data values are compared together to determine the top values. Possibly the values of one of the component SSIDs will not appear in the op.top results.