Multigraph

the loading of Multigraph is getting realy slow, anybody know why?

Lloyd's picture

Re: Multigraph

Volume of data? I always try and select the shortest time period before selecting the data to plot.

Lloyd

Larsjo's picture

Re: Multigraph

ok, i just see a week. So that should not be a big problem.

Wonder if it has something to do with hosting my own server with static publich ipadr. And the setup off script path.

 

http://www.juelsminde.org/solceller/

 

 

vworp's picture

Re: Multigraph

I've had my first play with multigraphs and house-graphs this weekend, both are giving me similar issues. House-graphs take a long time to appear, multigraphs never appear and give me a message "Loading a feed can take time.."

I don't think I have a problem with volume of data, I started a fresh database only four days ago, it only has six inputs and eight feeds.

TrystanLea's picture

Re: Multigraph

I think I may have fixed it, I had missed out a resolution variable in the feeds model - which would have caused it to load data points at full resolution. Could you try installing the latest version?

Have a look at the multigraph here for typical loading times: http://openenergymonitor.org/emon/beehive/v2

vworp's picture

Re: Multigraph

It's made no difference for me.

TrystanLea's picture

Re: Multigraph

Ok I think I've got it this time.. I forgot to add the line to create an index on the mysql feed table. I've just added the line and updated to the emoncms repo so all new feeds from now on will have an index and be much faster.

To add an index to old feeds, run the following mysql command in phpmyadmin for the feeds that need an index:

 

ALTER TABLE feed_1 ADD INDEX (time);

I will see if I can make a script that will do this automatically.

 

TrystanLea's picture

Re: Multigraph

I've added a few lines to the feed conversion script conv.php which is in the root directory of emoncms3. It looks for missing indexes and then add them.

To run conv.php

1. Open the file and uncomment //$runnable = TRUE;

2. and then uncomment:

  //$feeds = get_all_feeds();

To run the script for all feeds.

3. run conv.php in your browser.

vworp's picture

Re: Multigraph

Multigraphs seem to be working for me now. I'll have a bit of a play later and let you know if I have any problems.

vworp's picture

Re: Multigraph

I'm finding that if I try and include the multigraph in a dashboard, it's truncating the lower edge of the graph though the date/times.

 

div class="widget-container-nc"><iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://192.168.1.70/emoncms3/Vis/MultiGraph/multigraph.php" style="width:745px; height:570px;"></iframe></div
 

Lloyd's picture

Re: Multigraph

Oh dear.  I've just update the software to the latest version, run  conv.php, and now my house graphs (embedded dashboard)  are empty, and when I try and login I get:

Unknown column 'lang' in 'field list'

Fatal error: Call to a member function fetch_array() on a non-object in /www/sites/fd9/da3/www.xxxxx.co.uk/web/emoncms3/Includes/db.php on line 56

 

​The output from conv.php was:

converted feed: 1

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 2

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 3

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 4

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 5

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 6

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 7

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 8

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 9

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 10

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 11

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 12

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 13

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 14

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 15

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 16

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 17

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 18

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 19

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 20

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 21

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 22

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 23

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 24

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 25

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 26

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 27

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 28

FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existfeed: 29 already converted

Missing index added to: feed_29

feed: 30 already converted

Missing index added to: feed_30

feed: 31 already converted

Missing index added to: feed_31

feed: 32 already converted

Missing index added to: feed_32

feed: 33 already converted

Missing index added to: feed_33

 

 

Larsjo's picture

Re: Multigraph

 

I'm finding that if I try and

If you look in the php file there is a 100% width and 100% height you can change to 70-80% 

TrystanLea's picture

Re: Multigraph

Lloyd, Im not sure about the FUNCTION xxxxx_co_uk_db.UNIX_TIMESTAMP does not existconverted feed: 27 error have not seen that before, will look into it.

I guess it originates on this line:       $result = db_query("INSERT $feedname SELECT UNIX_TIMESTAMP (time),data FROM feed_tmp"); 

which works fine for me, I wonder if it could be differences in mysql version?

As for Unknown column 'lang' in 'field list', if you run setup.php it will add that field.

TrystanLea's picture

Re: Multigraph

O dear, Has it deleted all your data? I realize that if it fails at that point it will not detect that it has and subsequently delete the feed_tmp data. 

Lloyd's picture

Re: Multigraph

Tracked down the 'lang' field error last night and ran setup.php, which, as you thought, solved that issue.  Re-running conv.php I did not get any errors.  However, when I log in now I get no inputs, feeds or dashboard.  Will try and see what (if any) data is left in my database now by using phpadmin. (I would have thought that even if the inputs were deleted they would have been recreated when I sent a new data packet from emonbase?)

Lloyd

Lloyd's picture

Re: Multigraph

Well inputs, feeds and dashboard all still exist.  I wonder if I screwed up my editing whilst trying to debug last night?

Lloyd

Lloyd's picture

Re: Multigraph

Using the browser debugger,  looking at list_view, I see all my inputs listed as a result of

  var inputs = <?php echo json_encode($inputs); ?>;

However, when the code goes into the update_list function, in never enters the for loop (    for (z in inputs)), so no data is output.  (And this is not a file I have edited)

(Hope that makes sense!)

Lloyd

Lloyd's picture

Re: Multigraph

Seems to have sprung into life (!).  Not sure why, but I'm not going to bother looking.  

Lloyd

TrystanLea's picture

Re: Multigraph

Hello Lloyd, sorry for the slow reply, good to hear that your feed data is still there. I wonder if it was a cache problem as to why the inputs where not displaying. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.