Sum, Difference, Product, and Quotient
The op.sum
, op.difference
, op.product
, and op.quotient
operations provide arithmetic operations across different SSIDs. Time stamps in the different SSIDs are matched.
The following example sums the number of interrupts for CPUs 0 and 2 at the specified time:
$ sstore export -t 2020-09-02T13:37:42 -e 2020-09-02T13:37:43 \ > //:class.cpu//:res.id///:s.[0,2]//:stat.interrupt-count TIME VALUE IDENTIFIER 2020-09-02T13:37:42 422910471.0 //:class.cpu//:res.id/0//:stat.interrupt-count 2020-09-02T13:37:43 422910685.0 //:class.cpu//:res.id/0//:stat.interrupt-count 2020-09-02T13:37:42 8792931.0 //:class.cpu//:res.id/2//:stat.interrupt-count 2020-09-02T13:37:43 8792936.0 //:class.cpu//:res.id/2//:stat.interrupt-count $ sstore export -t 2020-09-02T13:37:42 -e 2020-09-02T13:37:43 \ > //:class.cpu//:res.id///:s.[0,2]//:stat.interrupt-count//:op.sum TIME VALUE IDENTIFIER 2020-09-02T13:37:42 431703402.0 //:class.cpu//:res.id///:s.[0,2]//:stat.interrupt-count//:op.sum 2020-09-02T13:37:43 431703407.0 //:class.cpu//:res.id///:s.[0,2]//:stat.interrupt-count//:op.sum
Different parts of a single partition are not multiple identifiers, as shown in the following example:
$ sstore export -t 2020-09-02T13:58:42 -e 2020-09-02T13:58:43 \ > //:class.cpu//:res.id/1//:stat.usage//:part.mode(user,kernel) TIME VALUE IDENTIFIER 2020-09-02T13:58:42 //:class.cpu//:res.id/1//:stat.usage//:part.mode(user,kernel) kernel: 740559.213307 user: 173458.285965 $ sstore export -t 2020-09-02T13:58:42 -e 2020-09-02T13:58:43 \ > //:class.cpu//:res.id/1//:stat.usage//:part.mode(user,kernel)//:op.sum Warning (//:class.cpu//:res.id/1//:stat.usage//:part.mode(user,kernel)//:op.sum) - //:op.sum does not support partition-type stats
The op.difference
and op.quotient
operations operate on
the same statistic for exactly two different resources. Make sure you order the resource operands
correctly.
$ sstore export -t 2020-09-02T13:37:42 -e 2020-09-02T13:37:43 \ > //:class.cpu//:res.id///:s.[0,2]//:stat.interrupt-count//:op.quotient TIME VALUE IDENTIFIER 2020-09-02T13:37:42 48.0966438835924 //:class.cpu//:res.id///:s.[0,2]//:stat.interrupt-count//:op.quotient 2020-09-02T13:37:43 48.096616533999565 //:class.cpu//:res.id///:s.[0,2]//:stat.interrupt-count//:op.quotient $ sstore export -t 2020-09-02T13:37:42 -e 2020-09-02T13:37:43 \ > //:class.cpu//:res.id///:s.[2,0]//:stat.interrupt-count//:op.quotient TIME VALUE IDENTIFIER 2020-09-02T13:37:42 0.0207914714885364 //:class.cpu//:res.id///:s.[2,0]//:stat.interrupt-count//:op.quotient 2020-09-02T13:37:43 0.0207914833113697 //:class.cpu//:res.id///:s.[2,0]//:stat.interrupt-count//:op.quotient