Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show processes and sockets #3521

Merged
merged 37 commits into from
Dec 12, 2023
Merged

Show processes and sockets #3521

merged 37 commits into from
Dec 12, 2023

Conversation

mavam
Copy link
Member

@mavam mavam commented Sep 18, 2023

This PR is a POC that we can expose detailed endpoint-centric information. The new show processes aspect provides a list of running processes.

Example:

tenzir '
    show processes
    | select pid, ppid, name, utime, stime
    | head 3
    | write json -C
    '

Possible output:

{
  "name": "tenzir",
  "pid": 85558,
  "ppid": 73678,
  "utime": "213.75ms",
  "stime": "30.87ms"
}
{
  "name": "mdworker_shared",
  "pid": 85496,
  "ppid": 1,
  "utime": "49.08ms",
  "stime": "22.42ms"
}
{
  "name": "mdworker_shared",
  "pid": 85495,
  "ppid": 1,
  "utime": "59.11ms",
  "stime": "38.93ms"
}

@mavam mavam added feature New functionality operator Source, transformation, and sink labels Sep 18, 2023
@mavam mavam force-pushed the topic/show-processes branch 2 times, most recently from 7c6658f to 12a86b2 Compare September 20, 2023 08:39
@mavam
Copy link
Member Author

mavam commented Sep 20, 2023

@tenzir/engineering does anyone have an idea why this is not performing the conditional include as I'd expect?

#if defined(TENZIR_MACOS)
#  include <mach/mach_time.h>
#endif

CI gives this error:

/__w/tenzir/tenzir/libtenzir/include/tenzir/os.hpp:17:12: fatal error: mach/mach_time.h: No such file or directory
   17 | #  include <mach/mach_time.h>
      |            ^~~~~~~~~~~~~~~~~~

@jachris
Copy link
Contributor

jachris commented Sep 20, 2023

#if defined(TENZIR_MACOS)
#  include <mach/mach_time.h>
#endif

You have to use #if TENZIR_MACOS instead, because TENZIR_MACOS is always defined (but either to 0 or 1).

@mavam
Copy link
Member Author

mavam commented Sep 21, 2023

@jachris thanks 🙈

@mavam mavam changed the title Show processes on macOS Show processes and sockets on macOS Sep 21, 2023
@mavam mavam marked this pull request as ready for review September 21, 2023 15:08
@mavam mavam force-pushed the topic/show-processes branch 2 times, most recently from 8c1276e to 447e69a Compare September 27, 2023 07:01
@mavam mavam changed the title Show processes and sockets on macOS Show processes and sockets Sep 29, 2023
@mavam mavam force-pushed the topic/show-processes branch 2 times, most recently from 540fee3 to e19f631 Compare October 9, 2023 06:27
web/docs/operators/sources/processes.nd Outdated Show resolved Hide resolved
web/docs/operators/sources/processes.nd Outdated Show resolved Hide resolved
@dominiklohmann dominiklohmann merged commit 68e0698 into main Dec 12, 2023
46 checks passed
@dominiklohmann dominiklohmann deleted the topic/show-processes branch December 12, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality operator Source, transformation, and sink
Projects
None yet
5 participants