SlideShare a Scribd company logo
April 7, 2021
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
• Travel addict
• Photography enthusiast
• Tech interested
• Robotics/Industrial engineer
Why are we here?
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
source cloud.google.com
source edition.cnn.com
What is going on at my place?
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitor internet speed day & night
 Collect data
 View data
Monitor internet speed day & night
 Collect data
 View data
… and what can I do if I’m not at home?
NEED
 Measure
 Store
 Visualize
 Communication
HOW-TO
 Raspberry Pi
 Spreadsheet
 Spreadsheet
 Not possible
PRO
 Easy to implement
 Low effort to present data
CONS
 Local
 Requires PC to open file
 Writing data (concurrency)
 SD card corruption
Need to find a better solution!
NEED
 Measure
 Store
 Visualize
 Communication
HOW-TO
 Raspberry Pi
 InfluxDB
 Grafana
 Sense-hat
 Telegram
PRO
 Nothing to store locally
 Maintenance not on me!
 Possibility to learn flux!
CONS
 Not much!!
Time to switch to influxdb2!
 Several options available
 Needed
▪ PublicAPI
▪ Scriptable
▪ Debian-like compatible
 Not needed
▪ 100% uptime
▪ Certification
speedtest.net
speedtest CLI
 Time Series DB
 Needed
▪ Free
▪ Cloud based
▪ Public API
 Not needed
▪ 100% uptime
▪ Large storage
influxdata
cloud free tier
 Dashboard
 Needed
▪ Free
▪ Cloud based
▪ Nice-looking
▪ App based (desiderata)
 Not needed
▪ 100% uptime
▪ Lots of dashboards
Grafana
cloud free
 Somehow give fast feedback
about my network
 Needed
▪ Free
▪ Request based
▪ Easy to implement
 Not needed
▪ 100% uptime
telegram
custom bot
Let’s look at the implementation
RaspberryPi #1
RaspberryPi #2
info: astro-pi.org
INTERACTIVE
$ speedtest
Speedtest by Ookla
Server: <Server Name> (id = <Server ID>)
ISP: <ISP>
Latency: 6.87 ms (1.95 ms jitter)
Download: 77.37 Mbps (data used: 62.7 MB)
Upload: 19.98 Mbps (data used: 9.0 MB)
Packet Loss: 0.0%
Result URL: https://www.speedtest.net/result/c/<UUID>
SCRIPTED
$ speedtest --format json
{ "type": "result",
"timestamp": "2021-04-07T18:00:00Z",
"ping":
{ "jitter": 0.696,
"latency": 6.645 },
"download":
{ "bandwidth": 7662563,
"bytes": 47087360,
"elapsed": 5914 },
"upload":
{ "bandwidth": 2197125,
"bytes": 7004736,
"elapsed": 3607 },
"packetLoss": 0,
"isp": "<ISP>",
"interface":
{ "internalIp": "<LAN ip>",
"name": "<LAN interface name>",
"macAddr": "<LAN interface MAC>",
"isVpn": false,
"externalIp": "<Public IP>" },
"server":
{ "id": <Server ID>,
"name": "<Server Name>",
"location": "<Server Location>",
"valcountry": "Italy",
"host": "<Server Host>",
"port": 8080,
"ip": "<Server IP>" },
"result":
{ "id": "<UUID>",
"url": https://www.speedtest.net/result/c/<UUID>}
}
[[outputs.influxdb_v2]]
urls = [ "${SPEEDTEST_SERVERURL}" ]
token = "${SPEEDTEST_TOKEN}"
organization = "${SPEEDTEST_ORGANIZATION}"
bucket = "${SPEEDTEST_BUCKET}"
[[processors.converter]]
[processors.converter.fields]
string = [
"server_id",
]
integer = [
"server_port",
]
float = [
"download_bandwidth",
"download_bytes",
"download_elapsed",
"upload_bandwidth",
"upload_bytes",
"upload_elapsed",
"packetLoss",
"ping_latency",
"ping_jitter",
]
[[inputs.exec]]
interval = "15m"
commands = [
"/usr/bin/speedtest --accept-license --accept-gdpr -f
json",
]
name_override="${SPEEDTEST_MEASUREMENT}"
timeout = "60s"
data_format = "json"
json_time_format = "2006-01-02T15:04:05Z"
json_time_key = "timestamp"
tag_keys = [
"interface_externalIp",
"interface_internalIp",
"isp",
"server_host"
]
json_string_fields = [
"server_location",
"server_name",
"server_testcountry",
"server_ip",
"result_id",
"result_url",
]
from(bucket: mybucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r["_measurement"] == mymeasurement and (
r["_field"] == "download_bandwidth" or
r["_field"] == "upload_bandwidth" or
r["_field"] == "ping_latency"
)
)
|> keep(columns: ["_time", "_field", "_value"])
|> aggregateWindow(every: v.windowPeriod, fn: valmean, createEmpty: false)
|> map(fn: (r) => ({
r with _value: if (r._field == "download_bandwidth" or r._field == "upload_bandwidth") then
r._value * 8.0 else r._value
})
)
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
from(bucket: mybucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r["_measurement"] == mymeasurement and (
r["_field"] == "download_bandwidth" or r["_field"] == "upload_bandwidth" or r["_field"] == "ping_latency" or r["_field"] ==
"server_name" or r["_field"] == "packetLoss" or r["_field"] == "server_location")
)
|> pivot(rowKey:["_time"], columnKey:["_field"], valueColumn:"_value")
|> group(columns: ["server_host"])
|> keep(columns: ["download_bandwidth", "upload_bandwidth", "ping_latency", "packetLoss", "server_location", "server_name", "serve
r_host"])
|> reduce(identity: {
server_name: "", server_location: "", valcount: 0.0, download_bandwidth: 0.0, upload_bandwidth: 0.0, ping_latency: 0.0, packet
Loss: 0.0, },
fn: (r, accumulator) => ({
server_name: r.server_name,
server_location: r.server_location,
valcount: accumulator.valcount + 1.0,
download_bandwidth: (r.download_bandwidth + accumulator.download_bandwidth * accumulator.valcount) / (accumulator.valcount + 1
.0),
upload_bandwidth: (r.upload_bandwidth + accumulator.upload_bandwidth * accumulator.valcount) / (accumulator.valcount + 1.0),
ping_latency: (r.ping_latency + accumulator.ping_latency * accumulator.valcount) / (accumulator.valcount + 1.0),
packetLoss: (r.packetLoss + accumulator.packetLoss * accumulator.valcount) / (accumulator.valcount + 1.0),
})
)
|> map(fn: (r) => ({ r with download_bandwidth: r.download_bandwidth * 8.0, upload_bandwidth: r.upload_bandwidth * 8.0 }))
|> drop(columns: ["server_host"])
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
from(bucket: mybucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r["_measurement"] == mymeasurement and (
r["_field"] == "results_id" or
r["_field"] == "server_name" or
r["_field"] == "server_location"
)
)
|> keep(columns: ["_time", "_field", "_value"])
|> sort(columns: ["_time"], desc: true)
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
import "experimental"
import "date"
option task = {name: "DailyMinMax", cron: "0 2 * * *"}
today = () => (date.truncate(t: now(), unit: 1d))
yesterday = (boundary="start") => {
timeValue = if boundary == "end" then experimental.subDuration(d: 1ns, from: today()) else experimental.subDuration(d: 24h, from: today())
return timeValue
}
from(bucket: mybucket)
|> range(start: yesterday(), stop: yesterday(boundary: "end"))
|> timeShift(duration: 1h, columns: ["_start", "_stop", "_time"])
|> filter(fn: (r) => (r["_measurement"] == mymeasurement and (r["_field"] ==
"download_bandwidth" or r["_field"] == "upload_bandwidth" or r["_field"] == "pingLatency")))
|> keep(columns: ["_time", "_field", "_value"])
|> reduce(identity: { valcount: 0.0, valmin: 0.0, valmax: 0.0, valmean: 0.0, }, fn: (r, accumulator) =>
({
valcount: accumulator.valcount + 1.0,
valmin: if accumulator.valcount == 0.0 then r._value else if r._value < accumulator.valmin then r._value else accumulator.valmin,
valmax: if accumulator.valcount == 0.0 then r._value else if r._value > accumulator.valmax then r._value else accumulator.valmax,
valmean: (r._value + accumulator.valmean * accumulator.valcount) / (accumulator.valcount + 1.0),
}))
|> map(fn: (r) => ({r with _time: yesterday(boundary: "end"), _measurement: "daily", data: r._field}))
|> to( bucket: <mybucket>, org: <myorganization>, tagColumns: ["data"], fieldFn: (r) =>
({ "valcount": r.valcount, "valmean": r.valmean, "valmin": r.valmin, "valmax": r.valmax, }))
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
 Visual feedback
 Periodical & on-demand
Python + AstroPi(kind-of)
info: astro-pi.org
[...]
self.query = 'import "math" 
from(bucket: "' + self.bucket + '") 
|> range(start: -1d) 
|> filter(fn: (r) => 
r["host"] == "%s" and 
r["_measurement"] == "' + self.measurement + '" and ( 
r["_field"] == "download_bandwidth" or 
r["_field"] == "upload_bandwidth" or 
r["_field"] == "ping_latency" 
) 
) 
|> keep(columns: ["_time", "_field", "_value"]) 
|> sort(columns: ["_time"], desc: false) 
|> last() 
|> map(fn: (r) => ({ 
r with _value: if (r._field == "download_bandwidth" or r._field ==
"upload_bandwidth") then math.round(x: (r._value * 8.0 / 10000.0)) /
100.0 else r._value 
}) 
) 
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn:
"_value")'
db_client = InfluxDBClient(url=self.url, token=self.token,
org=self.org)
db_data = db_client.query_api().query_stream(query=(self.query_string
% hostsname), org=self.org)
[...]
 Visual feedback
 Periodical & on-demand
Python + AstroPi(kind-of)
info: astro-pi.org
[...]
self.query = 'import "math" 
from(bucket: "' + self.bucket + '") 
|> range(start: -1d) 
|> filter(fn: (r) => 
r["host"] == "%s" and 
r["_measurement"] == "' + self.measurement + '" and ( 
r["_field"] == "download_bandwidth" or 
r["_field"] == "upload_bandwidth" or 
r["_field"] == "ping_latency" 
) 
) 
|> keep(columns: ["_time", "_field", "_value"]) 
|> sort(columns: ["_time"], desc: false) 
|> last() 
|> map(fn: (r) => ({ 
r with _value: if (r._field == "download_bandwidth" or r._field ==
"upload_bandwidth") then math.round(x: (r._value * 8.0 / 10000.0)) /
100.0 else r._value 
}) 
) 
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn:
"_value")'
db_client = InfluxDBClient(url=self.url, token=self.token,
org=self.org)
db_data = db_client.query_api().query_stream(query=(self.query_string
% hostsname), org=self.org)
[...]
PROS
 Something quick and easy
 On demand
 Custom telegram bot on
Raspberry Pi
CONS
 No slack app & workspace
 No live notifications (yet)
 No service in case of network
issues
PROS
 Something quick and easy
 On demand
 Custom telegram bot on
Raspberry Pi
CONS
 No slack app & workspace
 No live notifications (yet)
 No service in case of network
issues
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
 Do not use random test server
 Select optimal test server
 Use good hardware at home
 Integration with Smart Speakers (?)
 Automatic daily reporting
 Event notifications
 …
github.com/mirkodcomparetti/
We look forward to bringing together our
community of developers to learn, interact
and share tips and use cases.
10-11 May 2021
Hands-On Flux Training
18-19 May 2021
Virtual Experience
www.influxdays.com/emea-2021-virtual-experience/
Ad

Recommended

Time Series Meetup: Virtual Edition | July 2020
Time Series Meetup: Virtual Edition | July 2020
InfluxData
 
Obtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and Telegraf
Obtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and Telegraf
InfluxData
 
Performance Profiling in Rust
Performance Profiling in Rust
InfluxData
 
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
InfluxData
 
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
InfluxData
 
Presto in Treasure Data
Presto in Treasure Data
Mitsunori Komatsu
 
Ordered Record Collection
Ordered Record Collection
Hadoop User Group
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
InfluxData
 
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxData
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
Databricks
 
Upgrading To The New Map Reduce API
Upgrading To The New Map Reduce API
Tom Croucher
 
MariaDB and Clickhouse Percona Live 2019 talk
MariaDB and Clickhouse Percona Live 2019 talk
Alexander Rubin
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
Sages
 
Shrug2017 arcpy data_and_you
Shrug2017 arcpy data_and_you
SHRUG GIS
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Sages
 
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Spark Summit
 
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxData
 
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
Altinity Ltd
 
ClickHouse Features for Advanced Users, by Aleksei Milovidov
ClickHouse Features for Advanced Users, by Aleksei Milovidov
Altinity Ltd
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using Telegraf
InfluxData
 
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
Altinity Ltd
 
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Altinity Ltd
 
Webinar slides: Adding Fast Analytics to MySQL Applications with Clickhouse
Webinar slides: Adding Fast Analytics to MySQL Applications with Clickhouse
Altinity Ltd
 
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
Altinity Ltd
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Sages
 
Optimizing the Grafana Platform for Flux
Optimizing the Grafana Platform for Flux
InfluxData
 
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
InfluxData
 
Flux and InfluxDB 2.0
Flux and InfluxDB 2.0
InfluxData
 
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
InfluxData
 
9:40 am InfluxDB 2.0 and Flux – The Road Ahead Paul Dix, Founder and CTO | ...
9:40 am InfluxDB 2.0 and Flux – The Road Ahead Paul Dix, Founder and CTO | ...
InfluxData
 

More Related Content

What's hot (20)

InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxData
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
Databricks
 
Upgrading To The New Map Reduce API
Upgrading To The New Map Reduce API
Tom Croucher
 
MariaDB and Clickhouse Percona Live 2019 talk
MariaDB and Clickhouse Percona Live 2019 talk
Alexander Rubin
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
Sages
 
Shrug2017 arcpy data_and_you
Shrug2017 arcpy data_and_you
SHRUG GIS
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Sages
 
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Spark Summit
 
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxData
 
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
Altinity Ltd
 
ClickHouse Features for Advanced Users, by Aleksei Milovidov
ClickHouse Features for Advanced Users, by Aleksei Milovidov
Altinity Ltd
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using Telegraf
InfluxData
 
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
Altinity Ltd
 
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Altinity Ltd
 
Webinar slides: Adding Fast Analytics to MySQL Applications with Clickhouse
Webinar slides: Adding Fast Analytics to MySQL Applications with Clickhouse
Altinity Ltd
 
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
Altinity Ltd
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Sages
 
Optimizing the Grafana Platform for Flux
Optimizing the Grafana Platform for Flux
InfluxData
 
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
InfluxData
 
Flux and InfluxDB 2.0
Flux and InfluxDB 2.0
InfluxData
 
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxData
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
Databricks
 
Upgrading To The New Map Reduce API
Upgrading To The New Map Reduce API
Tom Croucher
 
MariaDB and Clickhouse Percona Live 2019 talk
MariaDB and Clickhouse Percona Live 2019 talk
Alexander Rubin
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
Sages
 
Shrug2017 arcpy data_and_you
Shrug2017 arcpy data_and_you
SHRUG GIS
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Sages
 
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Spark Summit
 
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxData
 
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
Altinity Ltd
 
ClickHouse Features for Advanced Users, by Aleksei Milovidov
ClickHouse Features for Advanced Users, by Aleksei Milovidov
Altinity Ltd
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using Telegraf
InfluxData
 
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
Altinity Ltd
 
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Altinity Ltd
 
Webinar slides: Adding Fast Analytics to MySQL Applications with Clickhouse
Webinar slides: Adding Fast Analytics to MySQL Applications with Clickhouse
Altinity Ltd
 
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
Altinity Ltd
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Sages
 
Optimizing the Grafana Platform for Flux
Optimizing the Grafana Platform for Flux
InfluxData
 
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
InfluxData
 
Flux and InfluxDB 2.0
Flux and InfluxDB 2.0
InfluxData
 

Similar to Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi (20)

Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
InfluxData
 
9:40 am InfluxDB 2.0 and Flux – The Road Ahead Paul Dix, Founder and CTO | ...
9:40 am InfluxDB 2.0 and Flux – The Road Ahead Paul Dix, Founder and CTO | ...
InfluxData
 
Optimizing InfluxDB Performance in the Real World | Sam Dillard | InfluxData
Optimizing InfluxDB Performance in the Real World | Sam Dillard | InfluxData
InfluxData
 
InfluxData Platform Future and Vision
InfluxData Platform Future and Vision
InfluxData
 
Devoxx france 2015 influx db
Devoxx france 2015 influx db
Nicolas Muller
 
Devoxx france 2015 influxdb
Devoxx france 2015 influxdb
Nicolas Muller
 
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Accumulo Summit
 
Timeseries - data visualization in Grafana
Timeseries - data visualization in Grafana
OCoderFest
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using Telegraf
InfluxData
 
Beautiful Monitoring With Grafana and InfluxDB
Beautiful Monitoring With Grafana and InfluxDB
leesjensen
 
Tick
Tick
Vincenzo Ferrari
 
InfluxDB 1.0 - Optimizing InfluxDB by Sam Dillard
InfluxDB 1.0 - Optimizing InfluxDB by Sam Dillard
InfluxData
 
StreamSight - Query-Driven Descriptive Analytics for IoT and Edge Computing
StreamSight - Query-Driven Descriptive Analytics for IoT and Edge Computing
Demetris Trihinas
 
OPTIMIZING THE TICK STACK
OPTIMIZING THE TICK STACK
InfluxData
 
Flink Forward San Francisco 2018: - Jinkui Shi and Radu Tudoran "Flink real-t...
Flink Forward San Francisco 2018: - Jinkui Shi and Radu Tudoran "Flink real-t...
Flink Forward
 
Advanced kapacitor
Advanced kapacitor
InfluxData
 
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
InfluxData
 
OPTIMIZING THE TICK STACK
OPTIMIZING THE TICK STACK
InfluxData
 
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
InfluxData
 
Scott Anderson [InfluxData] | InfluxDB Tasks – Beyond Downsampling | InfluxDa...
Scott Anderson [InfluxData] | InfluxDB Tasks – Beyond Downsampling | InfluxDa...
InfluxData
 
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
InfluxData
 
9:40 am InfluxDB 2.0 and Flux – The Road Ahead Paul Dix, Founder and CTO | ...
9:40 am InfluxDB 2.0 and Flux – The Road Ahead Paul Dix, Founder and CTO | ...
InfluxData
 
Optimizing InfluxDB Performance in the Real World | Sam Dillard | InfluxData
Optimizing InfluxDB Performance in the Real World | Sam Dillard | InfluxData
InfluxData
 
InfluxData Platform Future and Vision
InfluxData Platform Future and Vision
InfluxData
 
Devoxx france 2015 influx db
Devoxx france 2015 influx db
Nicolas Muller
 
Devoxx france 2015 influxdb
Devoxx france 2015 influxdb
Nicolas Muller
 
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Accumulo Summit
 
Timeseries - data visualization in Grafana
Timeseries - data visualization in Grafana
OCoderFest
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using Telegraf
InfluxData
 
Beautiful Monitoring With Grafana and InfluxDB
Beautiful Monitoring With Grafana and InfluxDB
leesjensen
 
InfluxDB 1.0 - Optimizing InfluxDB by Sam Dillard
InfluxDB 1.0 - Optimizing InfluxDB by Sam Dillard
InfluxData
 
StreamSight - Query-Driven Descriptive Analytics for IoT and Edge Computing
StreamSight - Query-Driven Descriptive Analytics for IoT and Edge Computing
Demetris Trihinas
 
OPTIMIZING THE TICK STACK
OPTIMIZING THE TICK STACK
InfluxData
 
Flink Forward San Francisco 2018: - Jinkui Shi and Radu Tudoran "Flink real-t...
Flink Forward San Francisco 2018: - Jinkui Shi and Radu Tudoran "Flink real-t...
Flink Forward
 
Advanced kapacitor
Advanced kapacitor
InfluxData
 
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
InfluxData
 
OPTIMIZING THE TICK STACK
OPTIMIZING THE TICK STACK
InfluxData
 
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
InfluxData
 
Scott Anderson [InfluxData] | InfluxDB Tasks – Beyond Downsampling | InfluxDa...
Scott Anderson [InfluxData] | InfluxDB Tasks – Beyond Downsampling | InfluxDa...
InfluxData
 
Ad

More from InfluxData (20)

Announcing InfluxDB Clustered
Announcing InfluxDB Clustered
InfluxData
 
Best Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow Ecosystem
InfluxData
 
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
InfluxData
 
Power Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDB
InfluxData
 
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
InfluxData
 
Build an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING Stack
InfluxData
 
Meet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using Rust
InfluxData
 
Introducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud Dedicated
InfluxData
 
Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB
InfluxData
 
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
InfluxData
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
InfluxData
 
Introducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage Engine
InfluxData
 
Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena
InfluxData
 
Understanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage Engine
InfluxData
 
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
InfluxData
 
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
InfluxData
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
InfluxData
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
InfluxData
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
InfluxData
 
Announcing InfluxDB Clustered
Announcing InfluxDB Clustered
InfluxData
 
Best Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow Ecosystem
InfluxData
 
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
InfluxData
 
Power Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDB
InfluxData
 
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
InfluxData
 
Build an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING Stack
InfluxData
 
Meet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using Rust
InfluxData
 
Introducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud Dedicated
InfluxData
 
Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB
InfluxData
 
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
InfluxData
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
InfluxData
 
Introducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage Engine
InfluxData
 
Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena
InfluxData
 
Understanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage Engine
InfluxData
 
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
InfluxData
 
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
InfluxData
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
InfluxData
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
InfluxData
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
InfluxData
 
Ad

Recently uploaded (20)

10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
2025_06_18 - OpenMetadata Community Meeting.pdf
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
The Future of AI Agent Development Trends to Watch.pptx
The Future of AI Agent Development Trends to Watch.pptx
Lisa ward
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Cluster-Based Multi-Objective Metamorphic Test Case Pair Selection for Deep N...
Cluster-Based Multi-Objective Metamorphic Test Case Pair Selection for Deep N...
janeliewang985
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
2025_06_18 - OpenMetadata Community Meeting.pdf
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
The Future of AI Agent Development Trends to Watch.pptx
The Future of AI Agent Development Trends to Watch.pptx
Lisa ward
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Cluster-Based Multi-Objective Metamorphic Test Case Pair Selection for Deep N...
Cluster-Based Multi-Objective Metamorphic Test Case Pair Selection for Deep N...
janeliewang985
 

Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi

  • 3. • Travel addict • Photography enthusiast • Tech interested • Robotics/Industrial engineer
  • 4. Why are we here?
  • 9. What is going on at my place?
  • 11. Monitor internet speed day & night  Collect data  View data
  • 12. Monitor internet speed day & night  Collect data  View data … and what can I do if I’m not at home?
  • 13. NEED  Measure  Store  Visualize  Communication HOW-TO  Raspberry Pi  Spreadsheet  Spreadsheet  Not possible
  • 14. PRO  Easy to implement  Low effort to present data CONS  Local  Requires PC to open file  Writing data (concurrency)  SD card corruption Need to find a better solution!
  • 15. NEED  Measure  Store  Visualize  Communication HOW-TO  Raspberry Pi  InfluxDB  Grafana  Sense-hat  Telegram
  • 16. PRO  Nothing to store locally  Maintenance not on me!  Possibility to learn flux! CONS  Not much!! Time to switch to influxdb2!
  • 17.  Several options available  Needed ▪ PublicAPI ▪ Scriptable ▪ Debian-like compatible  Not needed ▪ 100% uptime ▪ Certification speedtest.net speedtest CLI
  • 18.  Time Series DB  Needed ▪ Free ▪ Cloud based ▪ Public API  Not needed ▪ 100% uptime ▪ Large storage influxdata cloud free tier
  • 19.  Dashboard  Needed ▪ Free ▪ Cloud based ▪ Nice-looking ▪ App based (desiderata)  Not needed ▪ 100% uptime ▪ Lots of dashboards Grafana cloud free
  • 20.  Somehow give fast feedback about my network  Needed ▪ Free ▪ Request based ▪ Easy to implement  Not needed ▪ 100% uptime telegram custom bot
  • 21. Let’s look at the implementation
  • 23. INTERACTIVE $ speedtest Speedtest by Ookla Server: <Server Name> (id = <Server ID>) ISP: <ISP> Latency: 6.87 ms (1.95 ms jitter) Download: 77.37 Mbps (data used: 62.7 MB) Upload: 19.98 Mbps (data used: 9.0 MB) Packet Loss: 0.0% Result URL: https://www.speedtest.net/result/c/<UUID> SCRIPTED $ speedtest --format json { "type": "result", "timestamp": "2021-04-07T18:00:00Z", "ping": { "jitter": 0.696, "latency": 6.645 }, "download": { "bandwidth": 7662563, "bytes": 47087360, "elapsed": 5914 }, "upload": { "bandwidth": 2197125, "bytes": 7004736, "elapsed": 3607 }, "packetLoss": 0, "isp": "<ISP>", "interface": { "internalIp": "<LAN ip>", "name": "<LAN interface name>", "macAddr": "<LAN interface MAC>", "isVpn": false, "externalIp": "<Public IP>" }, "server": { "id": <Server ID>, "name": "<Server Name>", "location": "<Server Location>", "valcountry": "Italy", "host": "<Server Host>", "port": 8080, "ip": "<Server IP>" }, "result": { "id": "<UUID>", "url": https://www.speedtest.net/result/c/<UUID>} }
  • 24. [[outputs.influxdb_v2]] urls = [ "${SPEEDTEST_SERVERURL}" ] token = "${SPEEDTEST_TOKEN}" organization = "${SPEEDTEST_ORGANIZATION}" bucket = "${SPEEDTEST_BUCKET}" [[processors.converter]] [processors.converter.fields] string = [ "server_id", ] integer = [ "server_port", ] float = [ "download_bandwidth", "download_bytes", "download_elapsed", "upload_bandwidth", "upload_bytes", "upload_elapsed", "packetLoss", "ping_latency", "ping_jitter", ] [[inputs.exec]] interval = "15m" commands = [ "/usr/bin/speedtest --accept-license --accept-gdpr -f json", ] name_override="${SPEEDTEST_MEASUREMENT}" timeout = "60s" data_format = "json" json_time_format = "2006-01-02T15:04:05Z" json_time_key = "timestamp" tag_keys = [ "interface_externalIp", "interface_internalIp", "isp", "server_host" ] json_string_fields = [ "server_location", "server_name", "server_testcountry", "server_ip", "result_id", "result_url", ]
  • 25. from(bucket: mybucket) |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == mymeasurement and ( r["_field"] == "download_bandwidth" or r["_field"] == "upload_bandwidth" or r["_field"] == "ping_latency" ) ) |> keep(columns: ["_time", "_field", "_value"]) |> aggregateWindow(every: v.windowPeriod, fn: valmean, createEmpty: false) |> map(fn: (r) => ({ r with _value: if (r._field == "download_bandwidth" or r._field == "upload_bandwidth") then r._value * 8.0 else r._value }) )
  • 27. from(bucket: mybucket) |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == mymeasurement and ( r["_field"] == "download_bandwidth" or r["_field"] == "upload_bandwidth" or r["_field"] == "ping_latency" or r["_field"] == "server_name" or r["_field"] == "packetLoss" or r["_field"] == "server_location") ) |> pivot(rowKey:["_time"], columnKey:["_field"], valueColumn:"_value") |> group(columns: ["server_host"]) |> keep(columns: ["download_bandwidth", "upload_bandwidth", "ping_latency", "packetLoss", "server_location", "server_name", "serve r_host"]) |> reduce(identity: { server_name: "", server_location: "", valcount: 0.0, download_bandwidth: 0.0, upload_bandwidth: 0.0, ping_latency: 0.0, packet Loss: 0.0, }, fn: (r, accumulator) => ({ server_name: r.server_name, server_location: r.server_location, valcount: accumulator.valcount + 1.0, download_bandwidth: (r.download_bandwidth + accumulator.download_bandwidth * accumulator.valcount) / (accumulator.valcount + 1 .0), upload_bandwidth: (r.upload_bandwidth + accumulator.upload_bandwidth * accumulator.valcount) / (accumulator.valcount + 1.0), ping_latency: (r.ping_latency + accumulator.ping_latency * accumulator.valcount) / (accumulator.valcount + 1.0), packetLoss: (r.packetLoss + accumulator.packetLoss * accumulator.valcount) / (accumulator.valcount + 1.0), }) ) |> map(fn: (r) => ({ r with download_bandwidth: r.download_bandwidth * 8.0, upload_bandwidth: r.upload_bandwidth * 8.0 })) |> drop(columns: ["server_host"])
  • 29. from(bucket: mybucket) |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == mymeasurement and ( r["_field"] == "results_id" or r["_field"] == "server_name" or r["_field"] == "server_location" ) ) |> keep(columns: ["_time", "_field", "_value"]) |> sort(columns: ["_time"], desc: true)
  • 31. import "experimental" import "date" option task = {name: "DailyMinMax", cron: "0 2 * * *"} today = () => (date.truncate(t: now(), unit: 1d)) yesterday = (boundary="start") => { timeValue = if boundary == "end" then experimental.subDuration(d: 1ns, from: today()) else experimental.subDuration(d: 24h, from: today()) return timeValue } from(bucket: mybucket) |> range(start: yesterday(), stop: yesterday(boundary: "end")) |> timeShift(duration: 1h, columns: ["_start", "_stop", "_time"]) |> filter(fn: (r) => (r["_measurement"] == mymeasurement and (r["_field"] == "download_bandwidth" or r["_field"] == "upload_bandwidth" or r["_field"] == "pingLatency"))) |> keep(columns: ["_time", "_field", "_value"]) |> reduce(identity: { valcount: 0.0, valmin: 0.0, valmax: 0.0, valmean: 0.0, }, fn: (r, accumulator) => ({ valcount: accumulator.valcount + 1.0, valmin: if accumulator.valcount == 0.0 then r._value else if r._value < accumulator.valmin then r._value else accumulator.valmin, valmax: if accumulator.valcount == 0.0 then r._value else if r._value > accumulator.valmax then r._value else accumulator.valmax, valmean: (r._value + accumulator.valmean * accumulator.valcount) / (accumulator.valcount + 1.0), })) |> map(fn: (r) => ({r with _time: yesterday(boundary: "end"), _measurement: "daily", data: r._field})) |> to( bucket: <mybucket>, org: <myorganization>, tagColumns: ["data"], fieldFn: (r) => ({ "valcount": r.valcount, "valmean": r.valmean, "valmin": r.valmin, "valmax": r.valmax, }))
  • 34.  Visual feedback  Periodical & on-demand Python + AstroPi(kind-of) info: astro-pi.org [...] self.query = 'import "math" from(bucket: "' + self.bucket + '") |> range(start: -1d) |> filter(fn: (r) => r["host"] == "%s" and r["_measurement"] == "' + self.measurement + '" and ( r["_field"] == "download_bandwidth" or r["_field"] == "upload_bandwidth" or r["_field"] == "ping_latency" ) ) |> keep(columns: ["_time", "_field", "_value"]) |> sort(columns: ["_time"], desc: false) |> last() |> map(fn: (r) => ({ r with _value: if (r._field == "download_bandwidth" or r._field == "upload_bandwidth") then math.round(x: (r._value * 8.0 / 10000.0)) / 100.0 else r._value }) ) |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")' db_client = InfluxDBClient(url=self.url, token=self.token, org=self.org) db_data = db_client.query_api().query_stream(query=(self.query_string % hostsname), org=self.org) [...]
  • 35.  Visual feedback  Periodical & on-demand Python + AstroPi(kind-of) info: astro-pi.org [...] self.query = 'import "math" from(bucket: "' + self.bucket + '") |> range(start: -1d) |> filter(fn: (r) => r["host"] == "%s" and r["_measurement"] == "' + self.measurement + '" and ( r["_field"] == "download_bandwidth" or r["_field"] == "upload_bandwidth" or r["_field"] == "ping_latency" ) ) |> keep(columns: ["_time", "_field", "_value"]) |> sort(columns: ["_time"], desc: false) |> last() |> map(fn: (r) => ({ r with _value: if (r._field == "download_bandwidth" or r._field == "upload_bandwidth") then math.round(x: (r._value * 8.0 / 10000.0)) / 100.0 else r._value }) ) |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")' db_client = InfluxDBClient(url=self.url, token=self.token, org=self.org) db_data = db_client.query_api().query_stream(query=(self.query_string % hostsname), org=self.org) [...]
  • 36. PROS  Something quick and easy  On demand  Custom telegram bot on Raspberry Pi CONS  No slack app & workspace  No live notifications (yet)  No service in case of network issues
  • 37. PROS  Something quick and easy  On demand  Custom telegram bot on Raspberry Pi CONS  No slack app & workspace  No live notifications (yet)  No service in case of network issues
  • 44.  Do not use random test server  Select optimal test server  Use good hardware at home
  • 45.  Integration with Smart Speakers (?)  Automatic daily reporting  Event notifications  …
  • 47. We look forward to bringing together our community of developers to learn, interact and share tips and use cases. 10-11 May 2021 Hands-On Flux Training 18-19 May 2021 Virtual Experience www.influxdays.com/emea-2021-virtual-experience/