diff --git a/docker-compose.yml b/docker-compose.yml index 3bd3e748..7f4229b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,43 +1,11 @@ version: '2' volumes: - influxdb: - grafana: etcher_pki: etcher_cache: etcher_bash_history: etcher_config_electron: etcher_config_balena_etcher: services: - influxdb: - restart: always - build: ./etcher-pro-monitoring/influxdb - network_mode: host - volumes: - - 'influxdb:/data' - grafana: - restart: always - build: ./etcher-pro-monitoring/grafana - network_mode: host - volumes: - - 'grafana:/data' - environment: - - 'GF_SERVER_HTTP_PORT=80' - - 'GF_PATHS_PROVISIONING=/usr/src/app/provisioning' - - 'GF_SESSION_PROVIDER=memory' - collectd: - build: ./etcher-pro-monitoring/collectd - privileged: true - restart: always - network_mode: host - beep: - build: ./etcher-pro-monitoring/beep - privileged: true - restart: no - benchmark: - build: ./etcher-pro-monitoring/benchmark - privileged: true - restart: always - network_mode: host etcher: build: . privileged: true diff --git a/etcher-pro-monitoring/beep/Dockerfile.template b/etcher-pro-monitoring/beep/Dockerfile.template deleted file mode 100644 index 29858992..00000000 --- a/etcher-pro-monitoring/beep/Dockerfile.template +++ /dev/null @@ -1,3 +0,0 @@ -FROM balenalib/%%BALENA_MACHINE_NAME%%-debian -COPY ./beep.sh ./beep.sh -CMD ./beep.sh diff --git a/etcher-pro-monitoring/beep/beep.sh b/etcher-pro-monitoring/beep/beep.sh deleted file mode 100755 index bd62cfb6..00000000 --- a/etcher-pro-monitoring/beep/beep.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -sleep 1 -echo 0 > /sys/class/pwm/pwmchip0/export -sleep 1 -cd /sys/class/pwm/pwmchip0/pwm0 -echo 250000 > period -echo 125000 > duty_cycle -echo 1 > enable -sleep 1 -echo 0 > enable diff --git a/etcher-pro-monitoring/benchmark/Dockerfile.template b/etcher-pro-monitoring/benchmark/Dockerfile.template deleted file mode 100644 index 1b16f99e..00000000 --- a/etcher-pro-monitoring/benchmark/Dockerfile.template +++ /dev/null @@ -1,37 +0,0 @@ -FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-node:12.18-buster-build as builder -RUN apt-get update -RUN apt-get install -yq --no-install-recommends git curl python -# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923479 -# https://github.com/balena-io-library/base-images/issues/562 -RUN c_rehash -ENV PATH=/root/.cargo/bin:$PATH -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -WORKDIR /usr/src/app -RUN git clone https://github.com/balena-io-playground/parallel-disk-duplicator.git . -RUN git checkout sda-to-sd-b-to-p -RUN cargo build --release -# Also build @ronomon/direct-io -COPY package.json package-lock.json ./ -RUN npm i -# Install etcher-sdk -RUN \ - git clone https://github.com/balena-io-modules/etcher-sdk.git etcher-sdk && \ - cd etcher-sdk && \ - git checkout b32cd4d378a82dd47f1aea8281b726748997b151 && \ - npm i && \ - rm -rf node_modules/ext2fs/deps node_modules/ext2fs/test - -FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-node:12.18-buster -RUN \ - apt-get update && \ - apt-get install -y stress htop dcfldd && \ - rm -rf /var/lib/apt/lists/* -WORKDIR /usr/src/app -COPY sleep.sh dd.sh flash.ts tsconfig.json package.json package-lock.json ./ -COPY --from=builder /usr/src/app/target/release/pdd . -COPY --from=builder /usr/src/app/node_modules ./node_modules -COPY --from=builder /usr/src/app/etcher-sdk ./etcher-sdk -ENV UDEV=1 -ENV UV_THREADPOOL_SIZE=128 -RUN echo "echo \"stress, htop, dd and dcfldd are installed, try running ./flash.ts --help\"" >> /etc/bash.bashrc -CMD sleep infinity diff --git a/etcher-pro-monitoring/benchmark/dd.sh b/etcher-pro-monitoring/benchmark/dd.sh deleted file mode 100755 index 2168bbe2..00000000 --- a/etcher-pro-monitoring/benchmark/dd.sh +++ /dev/null @@ -1,4 +0,0 @@ -for i in {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}; do - dd if=/dev/zero bs=1M count=1500 of=/dev/sd$i & -done -wait diff --git a/etcher-pro-monitoring/benchmark/flash.ts b/etcher-pro-monitoring/benchmark/flash.ts deleted file mode 100755 index 07e31279..00000000 --- a/etcher-pro-monitoring/benchmark/flash.ts +++ /dev/null @@ -1,252 +0,0 @@ -#!/usr/src/app/node_modules/.bin/ts-node - -// @ts-ignore -import { getAlignedBuffer } from '@ronomon/direct-io'; -import { constants, createWriteStream, promises as fs } from 'fs'; -import { resolve as resolvePath } from 'path'; -// @ts-ignore -import * as RWMutex from 'rwmutex'; -import { Readable } from 'stream'; -import { Argv } from 'yargs'; - -const CHUNK_SIZE = 1024 ** 2; -const ALIGNMENT = 4096; - -interface LockableBuffer extends Buffer { - lock: () => Promise<() => void>; - rlock: () => Promise<() => void>; - slice: (start?: number, end?: number) => LockableBuffer; -} - -function attachMutex(buf: Buffer, mutex: RWMutex): LockableBuffer { - const buffer = buf as LockableBuffer; - buffer.lock = mutex.lock.bind(mutex); - buffer.rlock = mutex.rlock.bind(mutex); - const bufferSlice = buffer.slice.bind(buffer); - buffer.slice = (...args) => { - const slice = bufferSlice(...args); - return attachMutex(slice, mutex); - }; - return buffer; -} - -function createBuffer(size: number, alignment: number): LockableBuffer { - return attachMutex(getAlignedBuffer(size, alignment), new RWMutex()); -} - -export class ReadStream extends Readable { - public bytesRead = 0; - private handle: fs.FileHandle; - private ready: Promise; - private buffers: LockableBuffer[]; - private currentBufferIndex = 0; - - constructor( - private debug: boolean, - private path: string, - private direct: boolean, - private end?: number, - private numBuffers = 2, - ) { - super({ - objectMode: true, - highWaterMark: numBuffers - 1, - }); - if (numBuffers < 2) { - throw new Error("numBuffers can't be less than 2"); - } - this.buffers = new Array(numBuffers); - this.ready = this.init(); - } - - private getCurrentBuffer(): LockableBuffer { - let buffer = this.buffers[this.currentBufferIndex]; - if (buffer === undefined) { - buffer = createBuffer(CHUNK_SIZE, ALIGNMENT); - // @ts-ignore - buffer.index = this.currentBufferIndex; - this.buffers[this.currentBufferIndex] = buffer; - } - this.currentBufferIndex = (this.currentBufferIndex + 1) % this.numBuffers; - return buffer; - } - - private async init(): Promise { - let flags = constants.O_RDONLY; - if (this.direct) { - flags |= constants.O_DIRECT | constants.O_EXCL | constants.O_SYNC; - } - this.handle = await fs.open(this.path, flags); - } - - public async _read() { - await this.ready; - const buffer = this.getCurrentBuffer(); - const unlock = await buffer.lock(); - if (this.debug) { - // @ts-ignore - console.log('r start', buffer.index); - } - const { bytesRead } = await this.handle.read( - buffer, - 0, - CHUNK_SIZE, - this.bytesRead, - ); - unlock(); - this.bytesRead += bytesRead; - const slice = buffer.slice(0, bytesRead); - // @ts-ignore - slice.index = buffer.index; - if (this.debug) { - // @ts-ignore - console.log('r end', buffer.index); - } - this.push(slice); - if ( - bytesRead < CHUNK_SIZE || - (this.end !== undefined && this.bytesRead > this.end) - ) { - this.push(null); - await this.handle.close(); - this.emit('close'); - } - } -} - -function nTab(n: number): string { - let result = ''; - for (let i = 0; i < n; i++) { - result += '\t'; - } - return result; -} - -async function flash( - numBuffers: number, - size: number | undefined, - inputDirect: boolean, - outputDirect: boolean, - debug: boolean, - input: string, - outputs: string[] = [], -) { - const promises: Array> = []; - const source = new ReadStream(debug, input, inputDirect, size, numBuffers); - source.setMaxListeners(outputs.length + 1); - promises.push( - new Promise((resolve, reject) => { - source.on('close', resolve); - source.on('error', reject); - }), - ); - const start = new Date().getTime(); - for (let idx = 0; idx < outputs.length; idx++) { - const output = outputs[idx]; - let flags = constants.O_WRONLY; - if (outputDirect) { - flags |= constants.O_DIRECT | constants.O_EXCL | constants.O_SYNC; - } - const destination = createWriteStream(output, { - objectMode: true, - highWaterMark: Math.round(numBuffers / 2) - 1, - // @ts-ignore (flags can be a number) - flags, - }); - destination._writev = undefined; - const origWrite = destination._write.bind(destination); - destination._write = async (...args) => { - const origOnWrite = args[2]; - const unlock = await args[0].rlock(); - if (debug) { - // @ts-ignore - console.log(`${nTab(idx + 1)}w start`, args[0].index); - } - args[2] = (...aargs) => { - unlock(); - if (debug) { - console.log(`${nTab(idx + 1)}w end`, args[0].index); - } - // @ts-ignore - origOnWrite(...aargs); - }; - // @ts-ignore - return origWrite(...args); - }; - promises.push( - new Promise((resolve, reject) => { - destination.on('close', resolve); - destination.on('error', reject); - }), - ); - source.pipe(destination); - } - await Promise.all(promises); - const end = new Date().getTime(); - const duration = (end - start) / 1000; - if (size === undefined) { - size = source.bytesRead; - } - console.log('total time', duration, 's'); - console.log('speed', size / 1024 ** 2 / duration, 'MiB/s'); -} - -const argv = require('yargs').command( - '$0 input [devices..]', - 'Write zeros to devices', - (yargs: Argv) => { - yargs.positional('input', { describe: 'Input device' }); - yargs.positional('devices', { describe: 'Devices to write to' }); - yargs.option('numBuffers', { - default: 2, - describe: 'Number of 1MiB buffers used by the reader', - }); - yargs.option('size', { - type: 'number', - describe: 'Size in bytes', - }); - yargs.option('loop', { - type: 'boolean', - default: false, - describe: 'Indefinitely restart flashing when done', - }); - yargs.option('debug', { - type: 'boolean', - default: false, - describe: 'Show debug information', - }); - yargs.option('inputDirect', { - type: 'boolean', - default: false, - describe: 'Use direct io for input', - }); - yargs.option('outputDirect', { - type: 'boolean', - default: false, - describe: 'Use direct io for output', - }); - }, -).argv; - -async function main() { - if (argv.devices === undefined || argv.devices.length === 0) { - console.error('No output devices provided'); - return; - } - while (true) { - await flash( - argv.numBuffers, - argv.size, - argv.inputDirect, - argv.outputDirect, - argv.debug, - resolvePath(argv.input), - argv.devices.map((f: string) => resolvePath(f)), - ); - if (!argv.loop) { - break; - } - } -} - -main(); diff --git a/etcher-pro-monitoring/benchmark/package-lock.json b/etcher-pro-monitoring/benchmark/package-lock.json deleted file mode 100644 index 25278904..00000000 --- a/etcher-pro-monitoring/benchmark/package-lock.json +++ /dev/null @@ -1,318 +0,0 @@ -{ - "name": "flash", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@ronomon/direct-io": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@ronomon/direct-io/-/direct-io-3.0.1.tgz", - "integrity": "sha512-NkKB32bjq7RfMdAMiWayphMlVWzsfPiKelK+btXLqggv1vDVgv2xELqeo0z4uYLLt86fVReLPxQj7qpg0zWvow==", - "requires": { - "@ronomon/queue": "^3.0.1" - } - }, - "@ronomon/queue": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@ronomon/queue/-/queue-3.0.1.tgz", - "integrity": "sha512-STcqSvk+c7ArMrZgYxhM92p6O6F7t0SUbGr+zm8s9fJple5EdJAMwP3dXqgdXeF95xWhBpha5kjEqNAIdI0r4w==" - }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" - }, - "@types/node": { - "version": "12.12.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.29.tgz", - "integrity": "sha512-yo8Qz0ygADGFptISDj3pOC9wXfln/5pQaN/ysDIzOaAWXt73cNHmtEC8zSO2Y+kse/txmwIAJzkYZ5fooaS5DQ==", - "dev": true - }, - "@types/yargs": { - "version": "15.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz", - "integrity": "sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==", - "dev": true, - "requires": { - "@types/yargs-parser": "*" - } - }, - "@types/yargs-parser": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", - "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", - "dev": true - }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "rwmutex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/rwmutex/-/rwmutex-1.0.0.tgz", - "integrity": "sha1-/dHqaoe3f0SecteF+eonTL4UDe0=", - "requires": { - "debug": "^3.0.1" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "ts-node": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz", - "integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==", - "dev": true, - "requires": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.6", - "yn": "3.1.1" - } - }, - "typescript": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.2.tgz", - "integrity": "sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ==", - "dev": true - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" - }, - "yargs": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.1.0.tgz", - "integrity": "sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^16.1.0" - } - }, - "yargs-parser": { - "version": "16.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz", - "integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true - } - } -} diff --git a/etcher-pro-monitoring/benchmark/package.json b/etcher-pro-monitoring/benchmark/package.json deleted file mode 100644 index c7ebe977..00000000 --- a/etcher-pro-monitoring/benchmark/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "flash", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "devDependencies": { - "@types/node": "^12.12.29", - "@types/yargs": "^15.0.4", - "ts-node": "^8.6.2", - "typescript": "^3.8.2" - }, - "dependencies": { - "@ronomon/direct-io": "^3.0.1", - "rwmutex": "^1.0.0", - "yargs": "^15.1.0" - } -} diff --git a/etcher-pro-monitoring/benchmark/sleep.sh b/etcher-pro-monitoring/benchmark/sleep.sh deleted file mode 100755 index 179db3d3..00000000 --- a/etcher-pro-monitoring/benchmark/sleep.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -if [ ! -d /sys/class/gpio/gpio150 ]; then - echo 150 > /sys/class/gpio/export; - echo 1 > /sys/class/gpio/gpio150/value -else - echo 1 > /sys/class/gpio/gpio150/value -fi - -if [ ! -d /sys/class/gpio/gpio101 ]; then echo 101 > /sys/class/gpio/export; fi -if [ -d /sys/class/gpio/gpio101 ]; then echo 0 > /sys/class/gpio/gpio101/value; fi -if [ ! -d /sys/class/gpio/gpio131 ]; then echo 131 > /sys/class/gpio/export; fi -if [ -d /sys/class/gpio/gpio131 ]; then echo 1 > /sys/class/gpio/gpio131/value; fi -if [ -d /sys/class/pwm/pwmchip2/pwm0 ]; then echo 0 > /sys/class/pwm/pwmchip2/pwm0/enable; fi - -#echo enabled > /sys/class/tty/ttymxc0/power/wakeup -echo freeze > /sys/power/state - -if [ ! -d /sys/class/gpio/gpio150 ]; then - echo 150 > /sys/class/gpio/export; - echo 0 > /sys/class/gpio/gpio150/value -else - echo 0 > /sys/class/gpio/gpio150/value -fi - -if [ ! -d /sys/class/gpio/gpio101 ]; then echo 101 > /sys/class/gpio/export; fi -if [ -d /sys/class/gpio/gpio101 ]; then echo 1 > /sys/class/gpio/gpio101/value; fi -if [ ! -d /sys/class/gpio/gpio131 ]; then echo 131 > /sys/class/gpio/export; fi -if [ -d /sys/class/gpio/gpio131 ]; then echo 0 > /sys/class/gpio/gpio131/value; fi -if [ -d /sys/class/pwm/pwmchip2/pwm0 ]; then echo 1 > /sys/class/pwm/pwmchip2/pwm0/enable; fi diff --git a/etcher-pro-monitoring/benchmark/tsconfig.json b/etcher-pro-monitoring/benchmark/tsconfig.json deleted file mode 100644 index 1c62b4a8..00000000 --- a/etcher-pro-monitoring/benchmark/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "noImplicitAny": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "strictNullChecks": true, - "resolveJsonModule": true, - "moduleResolution": "node", - "module": "commonjs", - "target": "es2018", - "typeRoots": ["./node_modules/@types", "./typings"], - "allowSyntheticDefaultImports": true - } -} diff --git a/etcher-pro-monitoring/collectd/Dockerfile.template b/etcher-pro-monitoring/collectd/Dockerfile.template deleted file mode 100644 index 16e0ec1e..00000000 --- a/etcher-pro-monitoring/collectd/Dockerfile.template +++ /dev/null @@ -1,8 +0,0 @@ -FROM balenalib/%%BALENA_MACHINE_NAME%%-debian -RUN \ - apt-get update && \ - apt-get install --yes collectd && \ - rm -rf /var/lib/apt/lists/* -RUN sed -i '/LoadPlugin rrdtool/d' /etc/collectd/collectd.conf -COPY ./influxdb.conf /etc/collectd/collectd.conf.d/influxdb.conf -CMD collectd -C /etc/collectd/collectd.conf -f diff --git a/etcher-pro-monitoring/collectd/influxdb.conf b/etcher-pro-monitoring/collectd/influxdb.conf deleted file mode 100644 index 64310f6f..00000000 --- a/etcher-pro-monitoring/collectd/influxdb.conf +++ /dev/null @@ -1,11 +0,0 @@ -FQDNLookup false -LoadPlugin network -LoadPlugin thermal -LoadPlugin cpufreq - - - Server "0.0.0.0" "25826" - - - - diff --git a/etcher-pro-monitoring/grafana/Dockerfile.template b/etcher-pro-monitoring/grafana/Dockerfile.template deleted file mode 100644 index c6f98458..00000000 --- a/etcher-pro-monitoring/grafana/Dockerfile.template +++ /dev/null @@ -1,13 +0,0 @@ -FROM balenalib/%%BALENA_MACHINE_NAME%%-debian -RUN \ - apt-get update && \ - apt-get install --yes apt-transport-https software-properties-common wget jq && \ - wget -q -O - https://packages.grafana.com/gpg.key | apt-key add - && \ - add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" && \ - apt-get update && \ - apt-get install --yes grafana && \ - rm -rf /var/lib/apt/lists/* -COPY ./grafana.ini /usr/share/grafana/conf/custom.ini -COPY ./provisioning /usr/src/app/provisioning -COPY ./*.sh /usr/src/app/ -CMD /usr/src/app/entry.sh diff --git a/etcher-pro-monitoring/grafana/entry.sh b/etcher-pro-monitoring/grafana/entry.sh deleted file mode 100755 index 33a49b54..00000000 --- a/etcher-pro-monitoring/grafana/entry.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -/usr/src/app/set_default_dashboard.sh & -exec grafana-server -homepath /usr/share/grafana diff --git a/etcher-pro-monitoring/grafana/grafana.ini b/etcher-pro-monitoring/grafana/grafana.ini deleted file mode 100644 index fe95a4e9..00000000 --- a/etcher-pro-monitoring/grafana/grafana.ini +++ /dev/null @@ -1,7 +0,0 @@ -[paths] -data = /data/grafana/data -logs = /data/grafana/logs -plugins = /data/grafana/plugins - -[auth.anonymous] -enabled = true diff --git a/etcher-pro-monitoring/grafana/provisioning/dashboards/dashboards.yml b/etcher-pro-monitoring/grafana/provisioning/dashboards/dashboards.yml deleted file mode 100644 index 66fd4a85..00000000 --- a/etcher-pro-monitoring/grafana/provisioning/dashboards/dashboards.yml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: 1 - -providers: -- name: 'default' - orgId: 1 - folder: '' - type: file - editable: true - disableDeletion: true - updateIntervalSeconds: 10 - options: - path: /usr/src/app/provisioning/dashboards diff --git a/etcher-pro-monitoring/grafana/provisioning/dashboards/status.json b/etcher-pro-monitoring/grafana/provisioning/dashboards/status.json deleted file mode 100644 index 59182fdc..00000000 --- a/etcher-pro-monitoring/grafana/provisioning/dashboards/status.json +++ /dev/null @@ -1,2149 +0,0 @@ -{ - "annotations": { - "list": [ - { - "$$hashKey": "object:7", - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "hiddenSeries": false, - "id": 21, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "alias": "Thermal zone 0", - "groupBy": [], - "measurement": "thermal_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "thermal_zone0" - } - ] - }, - { - "alias": "Thermal zone 1", - "groupBy": [], - "measurement": "thermal_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "thermal_zone1" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Temperature", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "celsius", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "hiddenSeries": false, - "id": 10, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "groupBy": [ - { - "params": [ - "type_instance" - ], - "type": "tag" - } - ], - "measurement": "memory_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - } - ] - ], - "tags": [] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Memory usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 0, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 8 - }, - "hiddenSeries": false, - "id": 19, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "groupBy": [ - { - "params": [ - "instance" - ], - "type": "tag" - } - ], - "measurement": "disk_write", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT derivative(\"value\", 1s) FROM \"disk_read\" WHERE (\"type\" = 'disk_octets' AND (\"instance\" = 'sda' OR \"instance\" = 'sdb' OR \"instance\" = 'sdc' OR \"instance\" = 'sdd' OR \"instance\" = 'sde' OR \"instance\" = 'sdf' OR \"instance\" = 'sdg' OR \"instance\" = 'sdh' OR \"instance\" = 'sdi' OR \"instance\" = 'sdj' OR \"instance\" = 'sdk' OR \"instance\" = 'sdl' OR \"instance\" = 'sdm' OR \"instance\" = 'sdn' OR \"instance\" = 'sdo' OR \"instance\" = 'sdp')) AND $timeFilter GROUP BY \"instance\"", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "type", - "operator": "=", - "value": "disk_octets" - }, - { - "condition": "AND", - "key": "instance", - "operator": "=", - "value": "sda" - }, - { - "condition": "OR", - "key": "instance", - "operator": "=", - "value": "sdb" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Disk read", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 0, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 8 - }, - "hiddenSeries": false, - "id": 18, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "groupBy": [ - { - "params": [ - "instance" - ], - "type": "tag" - } - ], - "measurement": "disk_write", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT derivative(\"value\", 1s) FROM \"disk_write\" WHERE (\"type\" = 'disk_octets' AND (\"instance\" = 'sda' OR \"instance\" = 'sdb' OR \"instance\" = 'sdc' OR \"instance\" = 'sdd' OR \"instance\" = 'sde' OR \"instance\" = 'sdf' OR \"instance\" = 'sdg' OR \"instance\" = 'sdh' OR \"instance\" = 'sdi' OR \"instance\" = 'sdj' OR \"instance\" = 'sdk' OR \"instance\" = 'sdl' OR \"instance\" = 'sdm' OR \"instance\" = 'sdn' OR \"instance\" = 'sdo' OR \"instance\" = 'sdp')) AND $timeFilter GROUP BY \"instance\"", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "type", - "operator": "=", - "value": "disk_octets" - }, - { - "condition": "AND", - "key": "instance", - "operator": "=", - "value": "sda" - }, - { - "condition": "OR", - "key": "instance", - "operator": "=", - "value": "sdb" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Disk write", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 3, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 16 - }, - "hiddenSeries": false, - "id": 2, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": true, - "targets": [ - { - "groupBy": [ - { - "params": [ - "type_instance" - ], - "type": "tag" - } - ], - "measurement": "cpu_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "0" - }, - { - "condition": "AND", - "key": "type_instance", - "operator": "!=", - "value": "idle" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU 0", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percent", - "label": null, - "logBase": 1, - "max": "100", - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 16 - }, - "hiddenSeries": false, - "id": 4, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "groupBy": [ - { - "params": [ - "type_instance" - ], - "type": "tag" - } - ], - "measurement": "cpu_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "1" - }, - { - "condition": "AND", - "key": "type_instance", - "operator": "!=", - "value": "idle" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU 1", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percent", - "label": null, - "logBase": 1, - "max": "100", - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 24 - }, - "hiddenSeries": false, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "groupBy": [ - { - "params": [ - "type_instance" - ], - "type": "tag" - } - ], - "measurement": "cpu_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "2" - }, - { - "condition": "AND", - "key": "type_instance", - "operator": "!=", - "value": "idle" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU 2", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "percent", - "label": null, - "logBase": 1, - "max": "100", - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 24 - }, - "hiddenSeries": false, - "id": 8, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "groupBy": [ - { - "params": [ - "type_instance" - ], - "type": "tag" - } - ], - "measurement": "cpu_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "3" - }, - { - "condition": "AND", - "key": "type_instance", - "operator": "!=", - "value": "idle" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU 3", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "percent", - "label": null, - "logBase": 1, - "max": "100", - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 0, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 32 - }, - "hiddenSeries": false, - "id": 28, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "groupBy": [ - { - "params": [ - "type_instance" - ], - "type": "tag" - } - ], - "measurement": "cpufreq_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - } - ] - ], - "tags": [] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU Frequency", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "hertz", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 32 - }, - "hiddenSeries": false, - "id": 14, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "groupBy": [], - "measurement": "load_shortterm", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - } - ] - ], - "tags": [] - }, - { - "groupBy": [], - "measurement": "load_midterm", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - } - ] - ], - "tags": [] - }, - { - "groupBy": [], - "measurement": "load_longterm", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - } - ] - ], - "tags": [] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "System load", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 0, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 40 - }, - "hiddenSeries": false, - "id": 22, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "groupBy": [ - { - "params": [ - "instance" - ], - "type": "tag" - } - ], - "measurement": "disk_write", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT derivative(\"value\", 1s) FROM \"disk_read\" WHERE (\"type\" = 'disk_octets' AND (\"instance\" = 'mmcblk0boot0' OR \"instance\" = 'mmcblk0boot1' OR \"instance\" = 'mmcblk0p1' OR \"instance\" = 'mmcblk0p2' OR \"instance\" = 'mmcblk0p3' OR \"instance\" = 'mmcblk0p4' OR \"instance\" = 'mmcblk0p5' OR \"instance\" = 'mmcblk0p6')) AND $timeFilter GROUP BY \"instance\"", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "type", - "operator": "=", - "value": "disk_octets" - }, - { - "condition": "AND", - "key": "instance", - "operator": "=", - "value": "sda" - }, - { - "condition": "OR", - "key": "instance", - "operator": "=", - "value": "sdb" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "eMMC read", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 0, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 40 - }, - "hiddenSeries": false, - "id": 23, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "groupBy": [ - { - "params": [ - "instance" - ], - "type": "tag" - } - ], - "measurement": "disk_write", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT derivative(\"value\", 1s) FROM \"disk_write\" WHERE (\"type\" = 'disk_octets' AND (\"instance\" = 'mmcblk0boot0' OR \"instance\" = 'mmcblk0boot1' OR \"instance\" = 'mmcblk0p1' OR \"instance\" = 'mmcblk0p2' OR \"instance\" = 'mmcblk0p3' OR \"instance\" = 'mmcblk0p4' OR \"instance\" = 'mmcblk0p5' OR \"instance\" = 'mmcblk0p6')) AND $timeFilter GROUP BY \"instance\"", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "type", - "operator": "=", - "value": "disk_octets" - }, - { - "condition": "AND", - "key": "instance", - "operator": "=", - "value": "sda" - }, - { - "condition": "OR", - "key": "instance", - "operator": "=", - "value": "sdb" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "eMMC write", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 48 - }, - "hiddenSeries": false, - "id": 12, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "groupBy": [ - { - "params": [ - "type_instance" - ], - "type": "tag" - } - ], - "measurement": "df_value", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "etc-hosts" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "data partition usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 0, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 48 - }, - "hiddenSeries": false, - "id": 29, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "disk_write", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT derivative(sum(\"value\"), 1s) FROM \"disk_write\" WHERE (((\"instance\" = 'sda') OR (\"instance\" = 'sdb') OR (\"instance\" = 'sdc') OR (\"instance\" = 'sdd') OR (\"instance\" = 'sde') OR (\"instance\" = 'sdf') OR (\"instance\" = 'sdg') OR (\"instance\" = 'sdh') OR (\"instance\" = 'sdi') OR (\"instance\" = 'sdj') OR (\"instance\" = 'sdk') OR (\"instance\" = 'sdl') OR (\"instance\" = 'sdm') OR (\"instance\" = 'sdn') OR (\"instance\" = 'sdo') OR (\"instance\" = 'sdp')) AND \"type\" = 'disk_octets') AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "sum" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "sdb" - }, - { - "condition": "AND", - "key": "type", - "operator": "=", - "value": "disk_octets" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Total disk write (/dev/sd[a-p])", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 56 - }, - "hiddenSeries": false, - "id": 25, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "groupBy": [], - "measurement": "interface_rx", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "wlan0" - }, - { - "condition": "AND", - "key": "type", - "operator": "=", - "value": "if_octets" - } - ] - }, - { - "groupBy": [], - "measurement": "interface_tx", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "wlan0" - }, - { - "condition": "AND", - "key": "type", - "operator": "=", - "value": "if_octets" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "wlan0", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 56 - }, - "hiddenSeries": false, - "id": 26, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "groupBy": [], - "measurement": "interface_rx", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "eth0" - }, - { - "condition": "AND", - "key": "type", - "operator": "=", - "value": "if_octets" - } - ] - }, - { - "groupBy": [], - "measurement": "interface_tx", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [ - "1s" - ], - "type": "derivative" - } - ] - ], - "tags": [ - { - "key": "instance", - "operator": "=", - "value": "eth0" - }, - { - "condition": "AND", - "key": "type", - "operator": "=", - "value": "if_octets" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "eth0", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "5s", - "schemaVersion": 22, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-5m", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "Status", - "uid": "SuDbKk_Zk", - "variables": { - "list": [] - }, - "version": 2 -} diff --git a/etcher-pro-monitoring/grafana/provisioning/datasources/influxdb-datasource.yml b/etcher-pro-monitoring/grafana/provisioning/datasources/influxdb-datasource.yml deleted file mode 100644 index b8d8c9f6..00000000 --- a/etcher-pro-monitoring/grafana/provisioning/datasources/influxdb-datasource.yml +++ /dev/null @@ -1,21 +0,0 @@ -# config file version -apiVersion: 1 - -# list of datasources to insert/update depending -# what's available in the database -datasources: - # name of the datasource. Required -- name: InfluxDB - # datasource type. Required - type: influxdb - database: collectd - # access mode. proxy or direct (Server or Browser in the UI). Required - access: proxy - # org id. will default to orgId 1 if not specified - orgId: 1 - # url - url: http://0.0.0.0:8086 - version: 1 - # allow users to edit datasources from the UI. - editable: false - isDefault: true diff --git a/etcher-pro-monitoring/grafana/set_default_dashboard.sh b/etcher-pro-monitoring/grafana/set_default_dashboard.sh deleted file mode 100755 index 2daef6c2..00000000 --- a/etcher-pro-monitoring/grafana/set_default_dashboard.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -x - -GRAFANA_URL="127.0.0.1:$GF_SERVER_HTTP_PORT" - -count=0 -max_retries=10 - -while [[ $count -lt $max_retries ]]; do - test_cmd=$(curl "http://$GRAFANA_URL/api/health" | jq -r -e .database) - - if [ "$test_cmd" != 'ok' ]; then - count=$(( "$count" + 1 )) - sleep 10 - continue - fi - if curl -sq -w "\n" -X PUT "http://$GRAFANA_URL/api/user/preferences" \ - -H 'Accept-Encoding: gzip, deflate, br' -H 'X-Grafana-Org-Id: 1' -H \ - 'Content-Type: application/json;charset=UTF-8' -H \ 'Accept: application/json' --data-binary \ - '{"homeDashboardId":1,"theme":"","timezone":""}' --compressed; then - break - else - count=$(( "$count" + 1 )) - sleep 10 - continue - fi -done diff --git a/etcher-pro-monitoring/influxdb/Dockerfile.template b/etcher-pro-monitoring/influxdb/Dockerfile.template deleted file mode 100644 index 8de754f5..00000000 --- a/etcher-pro-monitoring/influxdb/Dockerfile.template +++ /dev/null @@ -1,8 +0,0 @@ -FROM balenalib/%%BALENA_MACHINE_NAME%%-debian -RUN \ - apt-get update && \ - apt-get install --yes influxdb collectd-core && \ - rm -rf /var/lib/apt/lists/* -RUN sed -i 's|/var/lib/influxdb|/data/influxdb|g' /etc/influxdb/influxdb.conf -COPY ./config.toml ./config.toml -CMD influxd -config="config.toml" diff --git a/etcher-pro-monitoring/influxdb/config.toml b/etcher-pro-monitoring/influxdb/config.toml deleted file mode 100644 index 506b16c9..00000000 --- a/etcher-pro-monitoring/influxdb/config.toml +++ /dev/null @@ -1,569 +0,0 @@ -### Welcome to the InfluxDB configuration file. - -# The values in this file override the default values used by the system if -# a config option is not specified. The commented out lines are the configuration -# field and the default value used. Uncommenting a line and changing the value -# will change the value used at runtime when the process is restarted. - -# Once every 24 hours InfluxDB will report usage data to usage.influxdata.com -# The data includes a random ID, os, arch, version, the number of series and other -# usage data. No data from user databases is ever transmitted. -# Change this option to true to enable reporting. -reporting-enabled = false - -# Bind address to use for the RPC service for backup and restore. -# bind-address = "127.0.0.1:8088" - -### -### [meta] -### -### Controls the parameters for the Raft consensus group that stores metadata -### about the InfluxDB cluster. -### - -[meta] - # Where the metadata/raft database is stored - dir = "/data/influxdb/meta" - - # Automatically create a default retention policy when creating a database. - # retention-autocreate = true - - # If log messages are printed for the meta service - # logging-enabled = true - -### -### [data] -### -### Controls where the actual shard data for InfluxDB lives and how it is -### flushed from the WAL. "dir" may need to be changed to a suitable place -### for your system, but the WAL settings are an advanced configuration. The -### defaults should work for most systems. -### - -[data] - # The directory where the TSM storage engine stores TSM files. - dir = "/data/influxdb/data" - - # The directory where the TSM storage engine stores WAL files. - wal-dir = "/data/influxdb/wal" - - # The amount of time that a write will wait before fsyncing. A duration - # greater than 0 can be used to batch up multiple fsync calls. This is useful for slower - # disks or when WAL write contention is seen. A value of 0s fsyncs every write to the WAL. - # Values in the range of 0-100ms are recommended for non-SSD disks. - wal-fsync-delay = "2s" - - - # The type of shard index to use for new shards. The default is an in-memory index that is - # recreated at startup. A value of "tsi1" will use a disk based index that supports higher - # cardinality datasets. - # index-version = "inmem" - - # Trace logging provides more verbose output around the tsm engine. Turning - # this on can provide more useful output for debugging tsm engine issues. - # trace-logging-enabled = false - - # Whether queries should be logged before execution. Very useful for troubleshooting, but will - # log any sensitive data contained within a query. - # query-log-enabled = true - - # Settings for the TSM engine - - # CacheMaxMemorySize is the maximum size a shard's cache can - # reach before it starts rejecting writes. - # Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k). - # Values without a size suffix are in bytes. - # cache-max-memory-size = "1g" - - # CacheSnapshotMemorySize is the size at which the engine will - # snapshot the cache and write it to a TSM file, freeing up memory - # Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k). - # Values without a size suffix are in bytes. - # cache-snapshot-memory-size = "25m" - - # CacheSnapshotWriteColdDuration is the length of time at - # which the engine will snapshot the cache and write it to - # a new TSM file if the shard hasn't received writes or deletes - # cache-snapshot-write-cold-duration = "10m" - - # CompactFullWriteColdDuration is the duration at which the engine - # will compact all TSM files in a shard if it hasn't received a - # write or delete - # compact-full-write-cold-duration = "4h" - - # The maximum number of concurrent full and level compactions that can run at one time. A - # value of 0 results in 50% of runtime.GOMAXPROCS(0) used at runtime. Any number greater - # than 0 limits compactions to that value. This setting does not apply - # to cache snapshotting. - # max-concurrent-compactions = 0 - - # The threshold, in bytes, when an index write-ahead log file will compact - # into an index file. Lower sizes will cause log files to be compacted more - # quickly and result in lower heap usage at the expense of write throughput. - # Higher sizes will be compacted less frequently, store more series in-memory, - # and provide higher write throughput. - # Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k). - # Values without a size suffix are in bytes. - # max-index-log-file-size = "1m" - - # The maximum series allowed per database before writes are dropped. This limit can prevent - # high cardinality issues at the database level. This limit can be disabled by setting it to - # 0. - # max-series-per-database = 1000000 - - # The maximum number of tag values per tag that are allowed before writes are dropped. This limit - # can prevent high cardinality tag values from being written to a measurement. This limit can be - # disabled by setting it to 0. - # max-values-per-tag = 100000 - - # If true, then the mmap advise value MADV_WILLNEED will be provided to the kernel with respect to - # TSM files. This setting has been found to be problematic on some kernels, and defaults to off. - # It might help users who have slow disks in some cases. - # tsm-use-madv-willneed = false - -### -### [coordinator] -### -### Controls the clustering service configuration. -### - -[coordinator] - # The default time a write request will wait until a "timeout" error is returned to the caller. - # write-timeout = "10s" - - # The maximum number of concurrent queries allowed to be executing at one time. If a query is - # executed and exceeds this limit, an error is returned to the caller. This limit can be disabled - # by setting it to 0. - # max-concurrent-queries = 0 - - # The maximum time a query will is allowed to execute before being killed by the system. This limit - # can help prevent run away queries. Setting the value to 0 disables the limit. - # query-timeout = "0s" - - # The time threshold when a query will be logged as a slow query. This limit can be set to help - # discover slow or resource intensive queries. Setting the value to 0 disables the slow query logging. - # log-queries-after = "0s" - - # The maximum number of points a SELECT can process. A value of 0 will make - # the maximum point count unlimited. This will only be checked every second so queries will not - # be aborted immediately when hitting the limit. - # max-select-point = 0 - - # The maximum number of series a SELECT can run. A value of 0 will make the maximum series - # count unlimited. - # max-select-series = 0 - - # The maxium number of group by time bucket a SELECT can create. A value of zero will max the maximum - # number of buckets unlimited. - # max-select-buckets = 0 - -### -### [retention] -### -### Controls the enforcement of retention policies for evicting old data. -### - -[retention] - # Determines whether retention policy enforcement enabled. - # enabled = true - - # The interval of time when retention policy enforcement checks run. - # check-interval = "30m" - -### -### [shard-precreation] -### -### Controls the precreation of shards, so they are available before data arrives. -### Only shards that, after creation, will have both a start- and end-time in the -### future, will ever be created. Shards are never precreated that would be wholly -### or partially in the past. - -[shard-precreation] - # Determines whether shard pre-creation service is enabled. - # enabled = true - - # The interval of time when the check to pre-create new shards runs. - # check-interval = "10m" - - # The default period ahead of the endtime of a shard group that its successor - # group is created. - # advance-period = "30m" - -### -### Controls the system self-monitoring, statistics and diagnostics. -### -### The internal database for monitoring data is created automatically if -### if it does not already exist. The target retention within this database -### is called 'monitor' and is also created with a retention period of 7 days -### and a replication factor of 1, if it does not exist. In all cases the -### this retention policy is configured as the default for the database. - -[monitor] - # Whether to record statistics internally. - # store-enabled = true - - # The destination database for recorded statistics - # store-database = "_internal" - - # The interval at which to record statistics - # store-interval = "10s" - -### -### [http] -### -### Controls how the HTTP endpoints are configured. These are the primary -### mechanism for getting data into and out of InfluxDB. -### - -[http] - # Determines whether HTTP endpoint is enabled. - # enabled = true - - # The bind address used by the HTTP service. - # bind-address = ":8086" - - # Determines whether user authentication is enabled over HTTP/HTTPS. - # auth-enabled = false - - # The default realm sent back when issuing a basic auth challenge. - # realm = "InfluxDB" - - # Determines whether HTTP request logging is enabled. - log-enabled = false - - # Determines whether the HTTP write request logs should be suppressed when the log is enabled. - # suppress-write-log = false - - # When HTTP request logging is enabled, this option specifies the path where - # log entries should be written. If unspecified, the default is to write to stderr, which - # intermingles HTTP logs with internal InfluxDB logging. - # - # If influxd is unable to access the specified path, it will log an error and fall back to writing - # the request log to stderr. - # access-log-path = "" - - # Determines whether detailed write logging is enabled. - # write-tracing = false - - # Determines whether the pprof endpoint is enabled. This endpoint is used for - # troubleshooting and monitoring. - # pprof-enabled = true - - # Enables a pprof endpoint that binds to localhost:6060 immediately on startup. - # This is only needed to debug startup issues. - # debug-pprof-enabled = false - - # Determines whether HTTPS is enabled. - # https-enabled = false - - # The SSL certificate to use when HTTPS is enabled. - # https-certificate = "/etc/ssl/influxdb.pem" - - # Use a separate private key location. - # https-private-key = "" - - # The JWT auth shared secret to validate requests using JSON web tokens. - # shared-secret = "" - - # The default chunk size for result sets that should be chunked. - # max-row-limit = 0 - - # The maximum number of HTTP connections that may be open at once. New connections that - # would exceed this limit are dropped. Setting this value to 0 disables the limit. - # max-connection-limit = 0 - - # Enable http service over unix domain socket - # unix-socket-enabled = false - - # The path of the unix domain socket. - # bind-socket = "/var/run/influxdb.sock" - - # The maximum size of a client request body, in bytes. Setting this value to 0 disables the limit. - # max-body-size = 25000000 - - # The maximum number of writes processed concurrently. - # Setting this to 0 disables the limit. - # max-concurrent-write-limit = 0 - - # The maximum number of writes queued for processing. - # Setting this to 0 disables the limit. - # max-enqueued-write-limit = 0 - - # The maximum duration for a write to wait in the queue to be processed. - # Setting this to 0 or setting max-concurrent-write-limit to 0 disables the limit. - # enqueued-write-timeout = 0 - - -### -### [ifql] -### -### Configures the ifql RPC API. -### - -[ifql] - # Determines whether the RPC service is enabled. - # enabled = true - - # Determines whether additional logging is enabled. - # log-enabled = true - - # The bind address used by the ifql RPC service. - # bind-address = ":8082" - - -### -### [logging] -### -### Controls how the logger emits logs to the output. -### - -[logging] - # Determines which log encoder to use for logs. Available options - # are auto, logfmt, and json. auto will use a more a more user-friendly - # output format if the output terminal is a TTY, but the format is not as - # easily machine-readable. When the output is a non-TTY, auto will use - # logfmt. - # format = "auto" - - # Determines which level of logs will be emitted. The available levels - # are error, warn, info, and debug. Logs that are equal to or above the - # specified level will be emitted. - level = "error" - - # Suppresses the logo output that is printed when the program is started. - # The logo is always suppressed if STDOUT is not a TTY. - suppress-logo = true - -### -### [subscriber] -### -### Controls the subscriptions, which can be used to fork a copy of all data -### received by the InfluxDB host. -### - -[subscriber] - # Determines whether the subscriber service is enabled. - # enabled = true - - # The default timeout for HTTP writes to subscribers. - # http-timeout = "30s" - - # Allows insecure HTTPS connections to subscribers. This is useful when testing with self- - # signed certificates. - # insecure-skip-verify = false - - # The path to the PEM encoded CA certs file. If the empty string, the default system certs will be used - # ca-certs = "" - - # The number of writer goroutines processing the write channel. - # write-concurrency = 40 - - # The number of in-flight writes buffered in the write channel. - # write-buffer-size = 1000 - - -### -### [[graphite]] -### -### Controls one or many listeners for Graphite data. -### - -[[graphite]] - # Determines whether the graphite endpoint is enabled. - # enabled = false - # database = "graphite" - # retention-policy = "" - # bind-address = ":2003" - # protocol = "tcp" - # consistency-level = "one" - - # These next lines control how batching works. You should have this enabled - # otherwise you could get dropped metrics or poor performance. Batching - # will buffer points in memory if you have many coming in. - - # Flush if this many points get buffered - # batch-size = 5000 - - # number of batches that may be pending in memory - # batch-pending = 10 - - # Flush at least this often even if we haven't hit buffer limit - # batch-timeout = "1s" - - # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. - # udp-read-buffer = 0 - - ### This string joins multiple matching 'measurement' values providing more control over the final measurement name. - # separator = "." - - ### Default tags that will be added to all metrics. These can be overridden at the template level - ### or by tags extracted from metric - # tags = ["region=us-east", "zone=1c"] - - ### Each template line requires a template pattern. It can have an optional - ### filter before the template and separated by spaces. It can also have optional extra - ### tags following the template. Multiple tags should be separated by commas and no spaces - ### similar to the line protocol format. There can be only one default template. - # templates = [ - # "*.app env.service.resource.measurement", - # # Default template - # "server.*", - # ] - -### -### [collectd] -### -### Controls one or many listeners for collectd data. -### - -[[collectd]] - enabled = true - bind-address = ":25826" # the bind address - database = "collectd" # Name of the database that will be written to - retention-policy = "" - batch-size = 5000 # will flush if this many points get buffered - batch-pending = 10 # number of batches that may be pending in memory - batch-timeout = "10s" - read-buffer = 0 # UDP read buffer size, 0 means to use OS default - typesdb = "/usr/share/collectd" - security-level = "none" # "none", "sign", or "encrypt" - auth-file = "/etc/collectd/auth_file" - parse-multivalue-plugin = "split" # "split" or "join" - - # enabled = false - # bind-address = ":25826" - # database = "collectd" - # retention-policy = "" - # - # The collectd service supports either scanning a directory for multiple types - # db files, or specifying a single db file. - # typesdb = "/usr/local/share/collectd" - # - # security-level = "none" - # auth-file = "/etc/collectd/auth_file" - - # These next lines control how batching works. You should have this enabled - # otherwise you could get dropped metrics or poor performance. Batching - # will buffer points in memory if you have many coming in. - - # Flush if this many points get buffered - # batch-size = 5000 - - # Number of batches that may be pending in memory - # batch-pending = 10 - - # Flush at least this often even if we haven't hit buffer limit - # batch-timeout = "10s" - - # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. - # read-buffer = 0 - - # Multi-value plugins can be handled two ways. - # "split" will parse and store the multi-value plugin data into separate measurements - # "join" will parse and store the multi-value plugin as a single multi-value measurement. - # "split" is the default behavior for backward compatability with previous versions of influxdb. - # parse-multivalue-plugin = "split" -### -### [opentsdb] -### -### Controls one or many listeners for OpenTSDB data. -### - -[[opentsdb]] - # enabled = false - # bind-address = ":4242" - # database = "opentsdb" - # retention-policy = "" - # consistency-level = "one" - # tls-enabled = false - # certificate= "/etc/ssl/influxdb.pem" - - # Log an error for every malformed point. - # log-point-errors = true - - # These next lines control how batching works. You should have this enabled - # otherwise you could get dropped metrics or poor performance. Only points - # metrics received over the telnet protocol undergo batching. - - # Flush if this many points get buffered - # batch-size = 1000 - - # Number of batches that may be pending in memory - # batch-pending = 5 - - # Flush at least this often even if we haven't hit buffer limit - # batch-timeout = "1s" - -### -### [[udp]] -### -### Controls the listeners for InfluxDB line protocol data via UDP. -### - -[[udp]] - # enabled = false - # bind-address = ":8089" - # database = "udp" - # retention-policy = "" - - # InfluxDB precision for timestamps on received points ("" or "n", "u", "ms", "s", "m", "h") - # precision = "" - - # These next lines control how batching works. You should have this enabled - # otherwise you could get dropped metrics or poor performance. Batching - # will buffer points in memory if you have many coming in. - - # Flush if this many points get buffered - # batch-size = 5000 - - # Number of batches that may be pending in memory - # batch-pending = 10 - - # Will flush at least this often even if we haven't hit buffer limit - # batch-timeout = "1s" - - # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. - # read-buffer = 0 - -### -### [continuous_queries] -### -### Controls how continuous queries are run within InfluxDB. -### - -[continuous_queries] - # Determines whether the continuous query service is enabled. - # enabled = true - - # Controls whether queries are logged when executed by the CQ service. - # log-enabled = true - - # Controls whether queries are logged to the self-monitoring data store. - # query-stats-enabled = false - - # interval for how often continuous queries will be checked if they need to run - # run-interval = "1s" - -### -### [tls] -### -### Global configuration settings for TLS in InfluxDB. -### - -[tls] - # Determines the available set of cipher suites. See https://golang.org/pkg/crypto/tls/#pkg-constants - # for a list of available ciphers, which depends on the version of Go (use the query - # SHOW DIAGNOSTICS to see the version of Go used to build InfluxDB). If not specified, uses - # the default settings from Go's crypto/tls package. - # ciphers = [ - # "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", - # "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - # ] - - # Minimum version of the tls protocol that will be negotiated. If not specified, uses the - # default settings from Go's crypto/tls package. - # min-version = "tls1.2" - - # Maximum version of the tls protocol that will be negotiated. If not specified, uses the - # default settings from Go's crypto/tls package. - # max-version = "tls1.2"