Real Time Test Data
with Grafana
Speakers: Giannis Papadakis
Software QA Automation Manager
29th November 2018
1
Agenda
2
• Introduction to Grafana
• Introduction to Monitoring
• Test Data Visualization
• Demo
• Q&A
Goal
3
● Represent Test Data as Time Series Data
● Build Test Metrics
● Review Tests Runtime
● Alerting based on conditions
Real-time data monitoring (RTDM) is a process through which an
administrator can review, evaluate and modify the use of data on
software, a database or a system.
It enables data administrators to review the overall processes and
functions performed on the data in real time, or as it happens,
through graphical charts and bars on a central
interface/dashboard.
RTDM
4
Time Series
5
● A time series is a series of data points indexed in time
order
● Time series is a sequence taken at successive equally
spaced points in time
● Thus it is a sequence of discrete-time data
“Wikipedia”
Data Point
6
● A data point is a discrete unit of information.
● In a general sense, any single fact is a data point.
● In a statistical or analytical context, a data point is usually
derived from a measurement or research and can be
represented numerically and/or graphically
Introduction to Grafana
7
Observability
Introduction to Grafana
8
Introduction to Grafana
9
Grafana allows you to query, visualize, alert on and understand
your metrics no matter where they are stored and no matter
from where they came from
Introduction to Grafana
10
● Advanced graphing
● Powerful query editors
● Dashboards
● Dynamic queries and dashboards
● Multi tenant user / organization support
● Client side & server side rendering of panels
Introduction to Grafana
11
Application Logs can be time series data
Introduction to Grafana
12
Tests can wrap time series data
Introduction to Grafana
13
Not really relational data
More efficient at storing timeseries data
Better at querying timeseries data
Introduction to Grafana
14
Introduction to Grafana
15
InfluxDB Query Editor
16
Prometheus Query Editor
17
Alert Notifications
18
Alert Notifications
19
Supported Types of Alerts:
● Slack
● Email
● Kafka
● PagerDuty
Alert Notifications
20
Alert Notifications
21
Define Slack Settings and Test it on the fly!!!
● Slack URL
● Channel
● Bot Token
Alert Notifications
22
Dashboards
23
● Dashboards are composed of Panels arranged on a grid
● Grafana makes it easy to construct the right queries
● Create the perfect Dashboard for your need
● A culture of being data-driven
● Whitebox monitoring
● Application metrics
● Test metrics
● Something you have to build into your system
Introduction to Monitoring
24
Monitor symptoms not causes
● Rate
● Errors
● Duration
Introduction to Monitoring
25
● Running integration tests on a daily basis is
inevitable nowadays!
● The results are produced when CI completes
its execution
● It might be “annoying” in certain cases!!!
● It might be “cool” to have a real time data
monitoring platform to produce results runtime
● Also it could be “cool” to build metrics around
your test infrastructure
Test Data Visualization
26
Seeding Test Data
Test Data Visualization
27
Test Data Visualization
28
● Measurement is the assignment of a number to
a characteristic of an object or event, which
can be compared with other objects or events
“Wikipedia”
Test Data Visualization
29
We can collect all the possible test metrics like
● Test case status
● Test case duration
● Test suite status
● Test suite duration
Test Data Visualization
30
We can derive some of the metrics
● Test cases count grouped by status on a
specific day
● Test suite duration trend for the week,
month, year etc
Test Data Visualization
31
InfluxDB is a time-series database
● sudo docker run -p 8086:8086 -v $PWD:/var/lib/influxdb
influxdb
● curl -i -XPOST http://localhost:8086/query
--data-urlencode "q=CREATE DATABASE selenium"
InfluxDB Setup
32
Test Data Visualization
33
Add InfluxDB Java Driver as Maven/Gradle dependency
InfluxDB Setup
34
Connect to your Datasource with InfluxDB Driver
Test Data Visualization
35
Test Class Metrics as points to InfluxDB
● Tag keys/values holds metadata adding info in measurements (String)
● Field keys contains information of what is measured (String)
● Field values can be of any type and actual holds the measured values
Test Data Visualization
36
Test Method Metrics as points to InfluxDB
● Description tag: Group results by description
● Name tag: Group
Test Data Visualization
37
Test Data Visualization
38
We made it to send results to InfluxDB which is great so far
How to query the results and visualize our test data!?
Grafana is our solution of course!!!
Test Data Visualization
39
Test Data Visualization
40
Test Data Visualization
41
Test Data Visualization
42
“Get your facts first,
then you can distort them as you please.”
- Mark Twain
● https://grafana.com/
● https://www.influxdata.com/
● https://confengine.com/selenium-conf-2018/proposal/6086/enh
ancing-tests-with-smart-reports-and-useful-visualisation
● https://github.com/atypon/workshop/tree/mot
Resources
43
44
Q & A
Thank you!

Real Time Test Data with Grafana