quantiaconsulting / continuous-analytics-examples Goto Github PK
View Code? Open in Web Editor NEWA collection of examples of continuous analytics.
License: Apache License 2.0
A collection of examples of continuous analytics.
License: Apache License 2.0
delayed by a give time interval
label out of order
ho trovato questa bella e chiara lezione su youtube con una repo su github con dentro i suoi notebooks e le slide.
youtube: https://youtu.be/UpsV1y6wMQ8
repo: https://github.com/as595/AllOfYourBases/tree/master/TIARA/GaussianProcessModelling
slides: https://github.com/as595/AllOfYourBases/blob/master/TIARA/GaussianProcessModelling/GaussianProcessModelling.pdf
altre ref:
in questo momento l'unico caso che è sviluppato across sistema è quello del fire alarm. Sarebbe bello svilupparli anche quello del DB della pizza (che ora è solo per SSS), l'IoT della pizza (che ora è solo per flux) e magari quello del braccio robotico (che ora è solo in EPL).
9:00 - 10:00
10:15 - 11:45
11:45 - 13:00
14:15 - 15:30
16:00 - 17:15
17:00 - 18:00
TODO aggiungere esercizi dopo ciascu tutorial. Facile arrivare su 1,5 gg
Suppose you want to monitor with a stream processing engine a group of robots used for picking and placing goods in an Industry 4.0 storehouse.
Each robotic arm sends events reporting its status: ready to pick the good, good grasped, moving the good, placing the good, moving without any good. Several Force-Sensing Resistors measure the stress levels of the robotic arm. If the stress level is between 0 and 6, the robot is safely operating. If it is between 7 and 8, a controller should raise a warning. If it is above 9, a controller should stop the robot.
In EPL propose:
proposte
Valerio:
create schema Arm1 ( status string, stress_level int );
create schema Arm2 ( status string, stress_level int );
create schema Arm3 ( status string, stress_level int );
Pietro:
create schema RobotArm ( id int, status string, stess int );
create schema StressWarning ( armId int, );
create schema StopArmEvent( armId int );
Laura:
create schema RoboticSensorArm( roboticArmId string, status string, stressLevel int );
Andrea: un evento per ogni stato con un riferimento al braccio che lo ha creato mettendo lo stress_level solo negli stati in cui è utile
Ivan:
create schema RoboticArm(id int, status string);
create schema ForceSensingResistors(idArm string, stressLvl int)
NOTA: ci sono due forze:
per ragioni di efficienza anche il modeling di Valerio è appropriato perchè ha tenuto separati i bracci, mentre nelle altre soluzioni serve separarli usando l'ID
per le stesse ragioni la proposta di Andrea potrebbe essere molto buona se servisse fare analisi across braccio raggruppando per stato
direi di continuare usando:
create schema RoboticArm( id string, status string, stressLevel int );
I dati:
RoboticArm={id="1", status="ready", stressLevel=0}
t=t.plus(1 seconds)
RoboticArm={id="1", status="goodGrasped", stressLevel=1}
t=t.plus(1 seconds)
RoboticArm={id="1", status="movingGood", stressLevel=5}
RoboticArm={id="2", status="ready", stressLevel=0}
t=t.plus(1 seconds)
RoboticArm={id="2", status="goodGrasped", stressLevel=5}
t=t.plus(1 seconds)
RoboticArm={id="2", status="movingGood", stressLevel=9}
t=t.plus(5 seconds)
RoboticArm={id="2", status="placingGood", stressLevel=3}
RoboticArm={id="1", status="placingGood", stressLevel=3}
t=t.plus(4 seconds)
RoboticArm={id="1", status="moving", stressLevel=2}
RoboticArm={id="2", status="moving", stressLevel=1}
t=t.plus(3 seconds)
RoboticArm={id="1", status="ready", stressLevel=0}
RoboticArm={id="2", status="ready", stressLevel=0}
t=t.plus(1 seconds)
@Name("E2")
SELECT id, max(stressLevel)
FROM RoboticArm
GROUP BY id
@Name("E3")
SELECT a.id, (a.stressLevel + b.stressLevel + c.stressLevel) / 3
FROM pattern [
every a=RoboticArm(status="goodGrasped") ->
b=RoboticArm(id = a.id, status="movingGood") -> c=RoboticArm(id = a.id, status="placingGood") ];
@Name("E4")
select a.id
from pattern [
(every (a=RoboticArm(status="goodGrasped")) ->
every (b=RoboticArm(id=a.id, status="movingGood")) ->
every (c=RoboticArm(id=a.id, status="placingGood"))) where timer:within(10 sec)
]
where a.stressLevel <= 6 and b.stressLevel > 6 and b.stressLevel <9 and c.stressLevel <= 6;
per periodo per server
....
realizzare una tabella di comparazione con cosa si può fare e cosa no in ciascun linguaggio
nel percorso di demo nel tutorial su ksql_materialized-view verso la fine si cheide di
INSERT INTO calls (name, reason, duration_seconds) VALUES ("derek", "help", 2727);
aspettandosi che
+---------+-------------------+------------+
|NAME |DISTINCT_REASONS |LAST_REASON |
+---------+-------------------+------------+
|derek |4 |help |
ma non può succedere che DISTINCT_REASONS
diventi 4 perchè ci sono solo tre ragioni distinte e aggiugendo help il 3 resta 3. Giustamente, invece cambia l'ultima ragione da refund
a help
immagina che il tutto venga eseguito da una macchiana con anaconda per l'accesso al terminale via web è molto comodo.
Nel caso:
nel fare il tutorial ksql_etl_tutorial ho scoperto che al ritmo della lezione non arrivano i dati nell'elastic (mentre vi arrivano se uno esegue il tutorial una query dopo l'altra senza pause di spiegazione).
Bisognerebbe capire perché. Una prima ipotesi è che i timestamp delle collezioni orders e shipments sono nel passato e se si lascia abbastanza tempo i dati vengono cancellati da kafka perché vecchi.
Di sicuro si può cambiare il percorso di demo in modo da registrare connettori e query prima di mettere gli i dati in postgres e mongo.
in line protocol:
org [measurement/tag]
in a table
tariff
compute consumption
|> aggWindow(1m, agg:last)
|> difference()
compute the cost
join stream with table tariff
mi è capitato già due volte che mi chiedessero come interpolare ad una certa ora e non usare la finestra per sincronizzare, sarebbe bello mostrare come fare nei vari linguaggi
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.