Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gaps in charts -> Timing issue. #3

Closed
grctest opened this issue Mar 30, 2017 · 12 comments
Closed

Gaps in charts -> Timing issue. #3

grctest opened this issue Mar 30, 2017 · 12 comments
Labels

Comments

@grctest
Copy link
Owner

grctest commented Mar 30, 2017

There are gaps appearing in the charts, this is likely caused by the netdata chart refreshing every 5 seconds whilst the stats.sh script refreshing less frequently & potentially netdata querying whilst stats.sh is writing to the file?

Some timing rebalancing should fix this.

@NickAnEngineer
Copy link
Contributor

Think this might be solved by changing the netdata process priority up to nice (see here). Or the upgrade to ubuntu 17.04 might have fixed it, did both at the same time and forgot to check netdata until after the upgrade.

@grctest grctest added the bug label Apr 19, 2017
@iFoggz
Copy link
Contributor

iFoggz commented Apr 22, 2017

umm i saw the gaps and i didnt like it
what i saw in stats.sh is when "grc getinfo >" is run it'll clear the file for the new data and not always does the daemon reply in a timely fashion so for a short time the file is 0 in size. I modified the lines differently to accommodate that thou its not most pretty solution but works for me and has 3 extra files.

grc getinfo > /home/gridcoin/.GridcoinResearch/getinfo.tmp && /bin/cp -f /home/gridcoin/.GridcoinResearch/getinfo.tmp /home/gridcoin/.GridcoinResearch/getinfo.json
grc getstakinginfo > /home/gridcoin/.GridcoinResearch/getstakinginfo.tmp && /bin/cp -f /home/gridcoin/.GridcoinResearch/getstakinginfo.tmp /home/gridcoin/.GridcoinResearch/getstakinginfo.json
grc getdifficulty > /home/gridcoin/.GridcoinResearch/difficulty.tmp && /bin/cp -f /home/gridcoin/.GridcoinResearch/difficulty.tmp /home/gridcoin/.GridcoinResearch/difficulty.json

now i make it put the reply from daemon to a .tmp file instead and then && /bin/cp -f .tmp .json. the && means that if A is successful execute B essentially. in doing that the .json file always has data for the charts so if its in between an update while the daemon hasn't supplied a reply it'll have something to keep the chart smooth.

for me it wasn't netdata having a problem it was simply that there was nothing in the file and it came back with no data for chart.

just configured up the rest of my netdata behind a webserver but you can see its smooth from here on out http://vancouver01.gridcoin.ifoggz-network.xyz

@iFoggz
Copy link
Contributor

iFoggz commented Apr 22, 2017

This morning I was having a coffee and I was thinking to myself. "Why would you make another inode structure when you could just rename the inode structure." After all it won't pass the && till its successfully done command A. So I've modified the code to the following and made it smaller to not include the /bin/.

Renaming the inode is faster then making a new one so it even more decreases the chance of a gap further. So with cp -f replaced by mv -f

grc getinfo > /home/gridcoin/.GridcoinResearch/getinfo.tmp && mv -f /home/gridcoin/.GridcoinResearch/getinfo.tmp /home/gridcoin/.GridcoinResearch/getinfo.json
grc getstakinginfo > /home/gridcoin/.GridcoinResearch/getstakinginfo.tmp && mv -f /home/gridcoin/.GridcoinResearch/getstakinginfo.tmp /home/gridcoin/.GridcoinResearch/getstakinginfo.json
grc getdifficulty > /home/gridcoin/.GridcoinResearch/difficulty.tmp && mv -f /home/gridcoin/.GridcoinResearch/difficulty.tmp /home/gridcoin/.GridcoinResearch/difficulty.json

mv is faster on a local filesystem.

Edit: This will also make it so there wont always be 6 files in the directory also.

@iFoggz
Copy link
Contributor

iFoggz commented Apr 22, 2017

Ive made another change to my stats.sh as the excessive repeating of path shouldn't be needed at all. Let's clean it up??

GRCPATH='/home/gridcoin/.GridcoinResearch/'
grc getinfo > "$GRCPATH"/getinfo.tmp && mv -f "$GRCPATH"/getinfo.tmp "$GRCPATH"/getinfo.json
grc getstakinginfo > "$GRCPATH"/getstakinginfo.tmp && mv -f "$GRCPATH"/getstakinginfo.tmp "$GRCPATH"/getstakinginfo.json
grc getdifficulty > "$GRCPATH"/difficulty.tmp && mv -f "$GRCPATH"/difficulty.tmp "$GRCPATH"/difficulty.json

@NickAnEngineer
Copy link
Contributor

@Foggyx420 do you want to update the gridcoin_netdata_stats.sh file in the service folder too? It can all be merged in one then. I can't at the moment but that script is just a mirror or the stats.sh with all the timing stuff ripped out.

@iFoggz
Copy link
Contributor

iFoggz commented Apr 22, 2017

there is a gridcoin_netdata_stats.sh file? hrm i wasn't aware of that. have stats.sh running with source and modifications to that has been whats affected the output on the charts for me.

@NickAnEngineer
Copy link
Contributor

NickAnEngineer commented Apr 22, 2017 via email

@iFoggz
Copy link
Contributor

iFoggz commented Apr 22, 2017

ah i haven't seen that directory lol I just followed the installation steps and did the stats.sh and gridcoin.chart.sh file ;p i'm gonna have a gander now

@iFoggz
Copy link
Contributor

iFoggz commented Apr 22, 2017

also explains why i couldn't request changes on her myself as in total wrong area

@iFoggz
Copy link
Contributor

iFoggz commented Apr 22, 2017

my bad it doesn't cause an issue but change GRCPATH='/home/gridcoin/.GridcoinResearch/' to GRCPATH='/home/gridcoin/.GridcoinResearch'

@iFoggz
Copy link
Contributor

iFoggz commented Apr 23, 2017

Pull request #10

@iFoggz
Copy link
Contributor

iFoggz commented Apr 24, 2017

this should be good to close with pull request #11 merged

@grctest grctest closed this as completed Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants