Skip to content

ResLens Frontend Repository. A continuous profiling and visualization tool for CPU, Memory and more....

License

Notifications You must be signed in to change notification settings

harish876/ResLens

 
 

Repository files navigation

ResLens is a comprehensive CPU and memory profiler for ResilientDB which aims to provide granular performance metrics by integrating profiling tools like eBPF, node exporter, process exporter, LevelDB internal statistics and custom prometheus hooks. We aim to provide a platform which provides database specific metrics that provide detailed information on what happens under the hood and help optimize system performance. This is an ambitious idea that we are improving on constantly but are proud to share a packaged version of ResLens currently.


Table of Contents

  1. Overview
  2. Features
  3. Usage
  4. Installation
  5. Contributing
  6. License
  7. Acknowledgments

Overview

ResLens provides CPU, memory, and build statistics aiming to provide detailed information on what happens under the hood and help optimize system performance.

Key Highlights:

  • Integrated terminal-like playground to Get and Set values to/from ResilientDB.
  • Real-time flame graph generation for memory and CPU profiling and detailed call stack analysis for processes.
  • Custom CPP hooks integrated to provide metrics not exposed by LevelDB like cache hit ratio, storage engine metrics like the number of SST tables, number of files at each level, etc.
  • Web-based frontend for interactive performance insights.
  • Aggregating different profiling tools and packaging into a single dashboard.
  • Lightweight and optimized for Linux-based systems.

Features

  • Granular Profiling: Analyze memory and CPU usage down to individual function calls.
  • Flame Graph Visualization: Generate real-time flame graphs to identify bottlenecks.
  • Call Stack Recording: Track and analyze call stacks during runtime.
  • User-Friendly Frontend: Visualize results via a web-based interface.
  • Dependency Analyzer: Check dependency graphs generated by bazel and visualize them in an easy-to-view way.
  • Output Options: Export results in JSON, PNG, and other formats and analyze them using external tools.

Usage

Description
Description: Flamegraph showing the call stack when a Get method is called on ResilientDB's key value store. This graph shows the function caller which is invoked by the ResilientDB-GraphQL service and is serviced at the end by the storage engine, which is LevelDB. The storage engine calls the in-memory LRU cache to check for cache hits and, when not found, calls its internal functions to retrieve the key-value pair.

Todo: Add more examples


Installation

Prerequisites

  • Operating System: Linux (e.g., Ubuntu 20.04+).

  • Announcement: We know that these are a lot of tools to install and set up. Our team is working on automating the process of installation and setup.

  • Service Dependencies:

    • Install our fork ResilientDB from here
    • Install ResilientDB's Graphql service to expose HTTP endpoints to use the Get and Set values to the Key value store from here.
    • Install ResLens's middleware service to aggregate data from our profiling services and expose HTTP endpoints to allow the ResLens Dashboard to access this data. Here
  • System Dependencies: These services are essential for hooking into various aspects of ResilientDB and monitoring its performance.

    • Prometheus: Expose metrics collected by services like node_exporter and process-exporter to the frontend.
    • NodeExporter: Expose system-level metrics.
    • ProcessExporter: Expose process-level metrics.
    • Pyroscope (v0.37.0): Provide fine-grained profiling metrics at a process level using eBPF.

Steps to Run

  • Offline Mode - Learn, Explore and familiarize with the dashboard without setting up the profiling environment.

    1. Clone this repository. This is the frontend Dashboard to access the profiling data collected. Running the dashboard without an accompanying backend will display data profiled and collected by the team during the time of demo.
    git clone https://github.com/Bismanpal-Singh/ResLens
    
  • Online/Live Mode - Gauge metrics, optimise performance by looking at live metrics from the profiling environment.

    1. Clone this repository. This is the frontend Dashboard to access the profiling data collected.
    git clone https://github.com/Bismanpal-Singh/ResLens
    1. Clone the ResilientDB repository. This is the service which will be profiled by ResLens. Follow the installation instructions to install ResilientDB and set it up.
    git clone https://github.com/harish876/incubator-resilientDB
    1. Clone the ResilientDB Graphql repository. This is the service which will be used to Get and Set data from ResilientDB's key value store. Follow the installation instructions to install and setup this service.
    git clone https://github.com/apache/incubator-resilientdb-graphql.
    1. Clone the ResLens middleware service. This is the service which will be used to aggregate data from different profiling services.
    git clone https://github.com/harish876/ResLens-middleware
    1. Follow this step by step installation manual to install, setup, resolve errors, and configure the profiling environment. TODO ADD LINK

Contribution

  1. Harish Gokul (http://github.com/harish876): Lead Developer for ResLens responsible for

    • Ideation, Execution and Architecture Design for the project.
    • Development of CPP Hooks, integration of prometheus hooks, and third party profiling libraries.
    • Development of profiling environment
    • Development of ResLens middleware service
    • Contributed heavily to the frontend dashboard design.
    • Documentation and blog author.
  2. Bismanpal Anand (http://github.com/bismanpal-singh): Designer & Developer for ResLens responsible for

    • Structured and Designed the ResLens website.
    • Experimented with various approaches to enhance usability while maintaining simplicity and elegance.
    • Contributed to the design of the frontend dashboard, ensuring intuitive visualization of metrics and data.
    • Contributed in implementing the ResLens middleware service to bridge data collection and presentation.
    • Contributed heavily to the frontend dashboard design.
    • Gathered memory metrics and profiling data by working with APIs & tools and integrated them into the dashboard

License

TODO

Acknowledgements

  • We would like to acknowledge the good folks of ResView for the inspiration and a reference point to start our project.

About

ResLens Frontend Repository. A continuous profiling and visualization tool for CPU, Memory and more....

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.8%
  • Other 1.2%