A server that shows the total amount of energy metered by an Arduino battery analyzer. A series of sensor data values (time in seconds, voltage in volts, and current in amps) are located in the file "sensors.json". The server responds with an approximate value for kWh measured over the given time interval. The server is built from Dropwizard and uses the Jackson Streaming API to read the data from the JSON file.
$ curl -d "starttime=STARTTIME&endtime=ENDTIME" http://localhost:8080/ | jq .
where STARTTIME and ENDTIME are time in seconds.
$ gradle clean build
$ ./gradlew run
or
$ java -jar build/libs/energy-server-0.0.1-SNAPSHOT-all.jar server
$ ./gradlew test