summaryrefslogtreecommitdiff
path: root/templates/project/jobs/convergence.rb
diff options
context:
space:
mode:
Diffstat (limited to 'templates/project/jobs/convergence.rb')
-rw-r--r--templates/project/jobs/convergence.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/templates/project/jobs/convergence.rb b/templates/project/jobs/convergence.rb
new file mode 100644
index 0000000..f66b6a5
--- /dev/null
+++ b/templates/project/jobs/convergence.rb
@@ -0,0 +1,13 @@
+points = []
+(1..10).each do |i|
+ points << { x: i, y: rand(50) }
+end
+last_x = points.last[:x]
+
+SCHEDULER.every '2s' do
+ points.shift
+ last_x += 1
+ points << { x: last_x, y: rand(50) }
+
+ send_event('convergence', points: points)
+end \ No newline at end of file