Title
#general
b

Brandon Mesa

09/22/2022, 9:14 PM
Hey all, is there a way to get resource util for a query executed in osqueryi?
s

sharvil

09/22/2022, 9:18 PM
I am not sure I follow, but there is a
.timer
mode in
osqueryi
— gives a rough of time for that execution
9:18 PM
osquery> .timer on
osquery> select count(*) from system_info;
+----------+
| count(*) |
+----------+
| 1        |
+----------+
Run Time: real 5.009 user 0.001115 sys 0.001575
b

Brandon Mesa

09/22/2022, 9:19 PM
I have a query that is failing the profile.py performance test. I'm hoping to identify what amount of resources the query is using when executed in osqueryi shell, as that is the only time it will actually run
s

sharvil

09/22/2022, 9:26 PM
can you just use
time
on the shell?
time -l -h -p osqueryi "select count(*) from time"
+----------+
| count(*) |
+----------+
| 1        |
+----------+
real 0.23
user 0.02
sys 0.00
            17383424  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
                1240  page reclaims
                   0  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                   0  voluntary context switches
                  30  involuntary context switches
           168702391  instructions retired
            51734903  cycles elapsed
             5424192  peak memory footprint