Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

A POC to demonstrate the abilities of PowerAPI. Not related to the utility, just showing it off. ;)

License

Notifications You must be signed in to change notification settings

BureauDesMembresLu/powerapi-demo

Repository files navigation

PowerAPI demo

Build status Test coverage Technical debt Issues License: Apache 2.0

This project was designed as a proof-of-concept to quickly demonstrate the possibilities of using PowerAPI and the importance of coding properly.

This project is not related to PowerAPI but only makes use of the tool.

Project structure

The project is divided into two main modules:

  • powerapi-demo-rest-server is a simple REST server that uses various non-optimized implementations to return the same results.
  • powerapi-demo-monitor-proxy runs as a local server that proxifies calls to the monitored server and adds the monitoring information to the result from the original call. It comes with a web interface to show the code's performance.

Every behavior of each project can be tuned in the related application.yml.

Running

  1. Ensure the database is available (see Database)
  2. Start powerapi-demo-rest-server (use mvn spring-boot:run -f powerapi-demo-rest-server/pom.xml)
  3. Start powerapi-demo-monitor-proxy (use mvn spring-boot:run -f powerapi-demo-monitor-proxy/pom.xml)
  4. Head over localhost:8080 and start playing

⚠️ Be sure to use mvn spring-boot:run to launch the monitoring proxy. The SIGAR library won't be loaded otherwise.

Contributing

Web interface development

Having to start the whole applications to develop web interfaces is not really efficient. In order to avoid this, a development with a Sinon server responding with fake data is available. To start it, head into the powerapi-demo-monitor-proxy.

# Install all dependencies
yarn install

# Run the dev server via Gulp
gulp serve:dev --gulpfile gulp
# Run using NPM
npm run dev