api.use1a1.rockset.com
Run this script on Cloud9, as you did in the beginning (make sure you see the script in the directory):
python scriptReadS3.py
After the script is running, navigate to the + icon in Grafana and click on Add a new panel:
Please reference the below image.
a) In the Grafana text editor, paste the first analytical query - remember you saved it as a Query Lambda earlier.
b) For Time Column, enter timen. On the far right, choose Gauge (see the below image):
To recap, here’s our 1st query:
SELECT
TIME_BUCKET(days(1), c._event_time) as timen,
AVG(c.price_float) as avgprice,
FROM
commons.CarPurchases as c
WHERE
c._event_time > :startTime AND c._event_time < :stopTime
GROUP BY
timen
ORDER BY
timen
It might take a few seconds for the visualization to show up– don’t worry if it doesn’t show up immediately.
Name the panel AvgPurchaseByMinute. Then, Apply the changes:
Finally, click Save on the upper right [not shown]. Save the dashboard as Real-time Dashboard:
Set the refresh period to 1m. You should see the numbers updating live on Grafana every minute. If it doesn’t show up immediately, don’t panic– it may take a few minutes for it to initially load!
Copy the second analytical query you wrote and paste it into the Grafana editor. As a reminder, the query you’re pasting is this:
SELECT
comp.companyName,
count(*) as purchases_from_car_company,
TIME_BUCKET(MINUTES(1), c._event_time) as timen
FROM
commons.CarPurchases AS c
JOIN commons.CarCompanies AS comp ON c.id = try_Cast(comp.companyId AS int)
WHERE
c._event_time > :startTime AND c._event_time < :stopTime
GROUP BY
comp.companyName,
timen
ORDER BY
count(*) DESC;
Refer to the image below:
Note- we don’t have to update the timestamp to be UTC on the second panel because that setting is already applied.
Congrats! You’ve built a real-time reporting dashboard. This marks the end of the first part of the workshop.