Hey all, is there a way to get resource util for a...
# general
b
Hey all, is there a way to get resource util for a query executed in osqueryi?
s
I am not sure I follow, but there is a
.timer
mode in
osqueryi
— gives a rough of time for that execution
Copy code
osquery> .timer on
osquery> select count(*) from system_info;
+----------+
| count(*) |
+----------+
| 1        |
+----------+
Run Time: real 5.009 user 0.001115 sys 0.001575
b
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
can you just use
time
on the shell?
Copy code
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