cse47242
4 years ago
4 changed files with 10349 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
version: '2' |
||||
|
services: |
||||
|
influxdb: |
||||
|
image: influxdb |
||||
|
ports: |
||||
|
- 8083:8083 |
||||
|
- 8086:8086 |
||||
|
volumes: |
||||
|
- ./data:/var/lib/influxdb |
||||
|
chronograf: |
||||
|
image: chronograf |
||||
|
ports: |
||||
|
- 8888:8888 |
||||
|
- 10000:10000 |
||||
|
iot-ddg: |
||||
|
image: node:6 |
||||
|
working_dir: /app |
||||
|
volumes: |
||||
|
- '.:/app' |
||||
|
command: bash -c "npm update npm -g && npm install && tail -f /dev/null" |
||||
|
environment: |
||||
|
- INFLUX_HOST=influxdb |
||||
|
- INFLUX_DATABASE=iot-dummy |
@ -0,0 +1,23 @@ |
|||||
|
const DeviceManager = require('./src/fake-device-manager') |
||||
|
const FakeDeviceConnection = require('./src/fake-device-connection')() |
||||
|
|
||||
|
const updateStats = require('./src/stats') |
||||
|
|
||||
|
console.log('Generating data - send interval: 30s') |
||||
|
|
||||
|
let deviceManager = DeviceManager({ |
||||
|
deviceCount: 10, |
||||
|
metricsInterval: 30, |
||||
|
connection: FakeDeviceConnection, |
||||
|
onUpdateStats: updateStats, |
||||
|
measurements: { |
||||
|
temperature: {type: 'integer', min: -10, max: 50}, |
||||
|
air_humidity: {type: 'integer', min: 30, max: 100}, |
||||
|
ground_humidity: {type: 'integer', min: 30, max: 100}, |
||||
|
airforce: {type: 'integer', min: 30, max: 100} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
updateStats(deviceManager) |
||||
|
|
||||
|
deviceManager.start() |
File diff suppressed because it is too large
@ -0,0 +1,30 @@ |
|||||
|
{ |
||||
|
"name": "iot-dummy-data-generator", |
||||
|
"version": "0.1.0", |
||||
|
"description": "Spawn dummy IoT devices and generate custom data that can be send to some data store.", |
||||
|
"main": "index.js", |
||||
|
"scripts": { |
||||
|
"test": "mocha --watch --reporter spec" |
||||
|
}, |
||||
|
"author": "Vedran Jukic", |
||||
|
"license": "MIT", |
||||
|
"dependencies": { |
||||
|
"influx": "^5.0.3", |
||||
|
"object-sizeof": "^1.1.1", |
||||
|
"progress": "^1.1.8" |
||||
|
}, |
||||
|
"devDependencies": { |
||||
|
"eslint": "^3.11.1", |
||||
|
"eslint-config-standard": "^6.2.1", |
||||
|
"eslint-plugin-promise": "^3.4.0", |
||||
|
"eslint-plugin-standard": "^2.0.1", |
||||
|
"chai": "^3.5.0", |
||||
|
"deepstream.io": "^2.0.0", |
||||
|
"deepstream.io-client-js": "^2.0.0", |
||||
|
"diff": "^3.0.1", |
||||
|
"jsdoc": "^3.4.3", |
||||
|
"mocha": "^3.1.2", |
||||
|
"sinon": "^1.17.6", |
||||
|
"winston": "^2.3.0" |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue