Forum

> > CS2D > General > Graph updates in serverstats.html
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Graph updates in serverstats.html

7 replies
To the start Previous 1 Next To the start

old Graph updates in serverstats.html

Nekomata
User Off Offline

Quote
So I just came to realization why my project; S.E wasn't displaying the players in the graph from the past 2 hours. Now I just want to confirm this but which one is the most recent value displayed in the graph.

00 or 23.

So. when an hour passes, does values to a bar get assigned to 00 or to 23.


user DC I'd be grateful if you could elaborate in details as to how the serverstats.html gets updated (here, so if anyone else wishes to know this post could help them). Thanks. ._.
edited 2×, last 06.03.15 01:54:21 pm

old Re: Graph updates in serverstats.html

DC
Admin Off Offline

Quote
The graph simply uses the current hour. There is no 24 because:
23:59:59 + 00:00:01 = 00:00:00

So when you're asking for the last hour of the day: It's 23. After that it starts with 0 which is the first hour of the next day. It just works like a digital clock.

Everything which starts with 23 in the time will be part of the 23 stats:
23:00:00 to 23:59:59
same for all other hours:
e.g.: 00:00:00 to 00:59:59 for the first hour of a day.

old Re: Graph updates in serverstats.html

Nekomata
User Off Offline

Quote
Oh. So if a server would start at 5am it would directly start inserting values in the 5th bar and onwards instead of hour 0.
Thought it worked as it kept on updating values to new bars every hour. o.o

So if i wanted to do something like "traffic (last 5 hours)" and have it insert the last/first 5 bars, that won't be what I really expected it to be doing but rather just from 0-5am and 18-23. .______.


Edit: Redacted
Nevermind!
edited 3×, last 06.03.15 01:54:50 pm

old Re: Graph updates in serverstats.html

DC
Admin Off Offline

Quote
Of course the hours in the stats are equal to the real time hours. Everything else would be not intuitive and rather strange. It basically shows you how much traffic you have at which daytime.

Edit:
The answer to your removed other question (just in case you are still using the script:)


Yes, serverinfo.php is extremly inefficient and you should NOT use it. It is for the website only and not intended for external use. It's just in the inc_pub folder because it's accessed by the website using AJAX.

Background:
serverinfo.php simply opens a UDP socket and requests the info directly from the provided server. No caching or anything.

You should do the same thing instead of using the script.

old Re: Graph updates in serverstats.html

Nekomata
User Off Offline

Quote
I see. o.O
Right now my script is pretty much just connecting to the file in inc_pub with the IP and Port and retrieving the file output content, then from there extracting the values.

I do not really have much experience with Sockets other than opening one to check if a dns is online
So I require a bit more help with what I'm supposed to be listening for. Managing the process would be simple but how exactly will the server be sending me the information? In chunks, all together, encoded, how? o.o
Can I get an example of the output of what the server would be sending?

And thank you for the help so far!
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview