Comments (3)
Not sure why this would be happening. For my own dashboards, I'm running OSX Lion with ruby 1.9.3-p194 without problems, and I'm loading in tons of libraries and jobs.
Might sound silly, but are you loading any libraries inside of adder.rb
, or are you doing anything computationally expensive? If adder.rb is empty, does it still do the same?
from dashing.
Here is my adder.rb code
(1..1000).each do |a|
system `echo "#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{Time.now}" >> C:/Users/winmais/code/anas_dashboard/fake_data`
sleep(0.2)
end
If I move adder.rb in the dashing root folder there is no problem.
from dashing.
The lib directory is not meant to run code, but rather to supply helper methods & classes for your jobs. If you have any executable code in there, it will run as soon as Dashing starts. Since you're calling sleep 1000 times, that would explain the slow load.
Placing adder.rb in your root folder won't cause a problem because the file won't be loaded/run. The only autoload paths are in jobs
& lib
.
If you want to do something every 0.2 seconds, your best bet is to use jobs. Each job is threaded, so you can do more expensive stuff in there.
jobs/adder.rb
SCHEDULER.every '0.2s', :first_in => 0 do
system `echo "#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{rand(10..100)};#{Time.now}" >> C:/Users/winmais/code/anas_dashboard/fake_data`
end
from dashing.
Related Issues (20)
- Eclipse IDE
- Scheduler, :handle_exception
- How to inject variables in the html of widgets HOT 1
- You have to install development tools first
- Installation on windows throws auth token error HOT 1
- Dashing Dashobarding
- How to leave blank space between widgets HOT 1
- Avoid refreshing the list widget if the data is the same HOT 3
- Dynamically getting values based on data-id HOT 2
- Remove the 'Le' words from the wiki
- Issue Installing on Raspberry Pi HOT 1
- Add widget dynamically based on Server Result
- Save automatically gridster layout after drag widgets
- run job on page refresh
- Upgrade gemspec to run with Rack 1.6 aka Rails 4.2.10 HOT 1
- Suspected plagiarism HOT 1
- Margins around Dashboard
- Push successful but getting "Something Went Wrong"
- Smashing dashboard is displaying random value of "Last updated at"
- Dynamically change widgets data-id does nothing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dashing.