Future of the Files-Fu - a revolutionary file sharing service - is in danger, as their client app seems to consume too much CPU, making the service unusable...
This is a proof-of-concept demo, addressing some aspects of the home assignment for the interview with Hive Streaming
See Implementation Notes for techical discussion, motivations etc. This README focuses further on now to build and run the demo.
- JDK and SBT available on
$PATH
to build and run the service - Running InfluxDB instance to store the data and render the reports.
This was tested with free tier of the Cloud service, but local install should work as well
- an API token with full access rights (unsafe, but we assume you have separate organization in Influx for this demo, or at least don't have anything important in there)
- InfluxDB CLI available on
$PATH
to initialize DB and run the query examples
- create
src/main/resources/influx-auth.properties
withthis will be used by scala code in integration tests and simulationuser="<your organization>" password="<your API token>"
- run
bin/init-config
to initialize your~/.influxdbv2/configs
for the CLI
- Initialize the bucket in InfluxDB with
bin/reset-data
- Use the following SBT commands:
test
: to build and unit test as usualit:testOnly filesfu.Acceptance
: small acceptance test to make sure data really ends up in influxit:testOnly filesfu.Simulation
: a simulation, feeding random data to illustrate particular scenario. After this is done, reports in the next section should show something sensible- the source can be modified to alter the scenario
run
: to simply run the server to play with it usingcurl
or similar tool- it currently only supports
POST
at the path/sessions
and accepts JSON messages - one per line. The message structure is defined in Messages.scala
- it currently only supports
- To empty the database and start over, use
bin/reset-data
any time
To illustrate how the report could look like we created some histograms for the InfluxDB web console. To recreate it, navigate to Dashboards->Create dashboard->Import dashboard. Import example-dashboard.json. With the data from the simulation above it would look like: