API to record and retrieve real-time statistics abot transactions in a given timeframe.
- Install Maven locally
- Run:
mvn spring-boot:run
Alternatively, you can use the included Maven wrapper and run ./mvnw spring-boot:run
instead.
Run the following in your terminal:
curl -d '{"amount":1, "timestamp":1478192204000}' -H "Content-Type: application/json" -X POST -i localhost:8080/transactions
Make sure you change the timestamp number to the current Unix epoch timestamp.
The following will give you statistics about all transactions in the last 60 seconds:
curl -i localhost:8080/statistics