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.
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
.
- Ensure the database is available (see Database)
- Start
powerapi-demo-rest-server
(usemvn spring-boot:run -f powerapi-demo-rest-server/pom.xml
) - Start
powerapi-demo-monitor-proxy
(usemvn spring-boot:run -f powerapi-demo-monitor-proxy/pom.xml
) - Head over localhost:8080 and start playing
⚠️ Be sure to usemvn spring-boot:run
to launch the monitoring proxy. The SIGAR library won't be loaded otherwise.
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