Skip to content

Commit

Permalink
suppress rusage deltas from watchman perf logs
Browse files Browse the repository at this point in the history
Summary:
This just suppresses the `getrusage` delta keys from the
perf samples that show up like this for slow queries:

before:

```
018-02-16T11:04:15,780: [sanitychecks] PERF: {"ru_nvcsw": 1, "ru_nsignals": 0, "ru_msgrcv": 2, "ru_msgsnd": 2, "ru_inblock": 0, "ru_majflt": 0, "ru_nswap": 0, "ru_minflt": 5, "ru_ixrss": 0, "ru_maxrss": 0, "system_time": 0.00046200000000000001, "user_time": 0.00022499999999999999, "elapsed_time": 0.48896899999999999, "pid": 63713, "ru_idrss": 0, "meta": {"root": {"path": "/Users/wez/fb/watchman-fbsource"}}, "version": "4.9.1", "ru_oublock": 0, "ru_nivcsw": 7, "start_time": 1518807855.291414, "description": "clock-test"}
```

after:

```
2018-02-16T11:15:39,272: [sanitychecks] PERF: {"system_time": 0.00093199999999999999, "user_time": 0.00042200000000000001, "elapsed_time": 9.7929099999999991, "pid": 82727, "meta": {"root": {"path": "/Users/wez/fb/watchman-fbsource"}}, "start_time": 1518808529.479985, "version": "4.9.1", "description": "clock-test"}
```

Reviewed By: simpkins

Differential Revision: D7013001

fbshipit-source-id: b2fbb99f6111e92984840e9970cfb2202c586f45
  • Loading branch information
wez authored and ip4368 committed Dec 10, 2018
1 parent 5930bf1 commit 2108f80
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,22 +236,7 @@ void watchman_perf_sample::log() {
#ifdef HAVE_SYS_RESOURCE_H
ADDTV("user_time", usage.ru_utime);
ADDTV("system_time", usage.ru_stime);
#define ADDU(n) info.set(#n, json_integer(usage.n))
ADDU(ru_maxrss);
ADDU(ru_ixrss);
ADDU(ru_idrss);
ADDU(ru_minflt);
ADDU(ru_majflt);
ADDU(ru_nswap);
ADDU(ru_inblock);
ADDU(ru_oublock);
ADDU(ru_msgsnd);
ADDU(ru_msgrcv);
ADDU(ru_nsignals);
ADDU(ru_nvcsw);
ADDU(ru_nivcsw);
#endif // HAVE_SYS_RESOURCE_H
#undef ADDU
#undef ADDTV

// Log to the log file
Expand Down

0 comments on commit 2108f80

Please sign in to comment.