Gathering CPU/RAM usage of namespaced pods with Java client

Cluster information:

minikube 1.4 on Ubuntu 18.04 (Kubernetes v1.16.0 on Docker 18.09.9)

Is there anyone here who has experience using the java-client for Kubernetes. I am building a software
with which I control Kubernetes processes via a web application. Here I encounter the following problem. I would like to track the CPU and RAM usage of my pods and the cluster as a whole. Unfortunately I couldn’t find any information anywhere that would have helped me in this regard. I am explicitly not looking for an external tool for this but would like to solve it myself as far as possible. Does anyone have experience with this? I’m building the software with Java 1.8 (with maven) and i’m using the Kubernetes java-client version 5.0.0. If you need additional information please let me know.

EDIT: Basically i want to build something like the kubectl top pod --namespace=xyz command.