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

Record network usage of a Fleetspeak client (Bytes sent/received) #299

Open
tsehori opened this issue Sep 30, 2020 · 0 comments
Open

Record network usage of a Fleetspeak client (Bytes sent/received) #299

tsehori opened this issue Sep 30, 2020 · 0 comments

Comments

@tsehori
Copy link
Contributor

tsehori commented Sep 30, 2020

We want to record the network usage of a single Fleetspeak client deployed, so that we can later on plot, inspect and analyze this data for measuring performance and be alerted if there are any unexpected "spikes" in network usage.
An example for a use case is GRR, that has a dashboard for Client Load Stats (google/grr#859) which fetches its data from Fleetspeak server's datastore.

The concept is similar to other metrics gathered from Fleetspeak clients, such as resident memory size.
As an example, check out #275 to learn more about how IO MiB read/write is implemented.

Implementation details:
Other metrics gathered for individual Fleetspeak clients are using the ResourceUsageFetcher struct, and specifically the method ResourceUsageForPID. Unlike those metrics, the kernel does not have information about the network usage of a given process PID, so this cannot be fetched using the library gopsutil.
Thus, an idea for implementing this: add a new struct (a singleton effectively) that will become a field in ResourceUsageFetcher. This new singleton will also be shared with the StreamingCommunicator struct (note that an implementation may needed for polling as well), so network usage data can be recorded when messages enter/exit the Fleetspeak client in the methods readLoop and writeLoop, where both are called from the connect method of StreamingCommunicator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant