![]() |
anyone suggestions for my prob?
https://vborg.vbsupport.ru/showthrea...244#post230244 |
Quote:
|
Quote:
Instead I often get a negative value on the forumhome page, with about 35 queries. Some hacks installed, but even with the original index.php and templates, the query time has often strange values. I asked my host people, but they said it's an 'application' issue cause they use a standard MySQL configuration... :rolleyes: Pragmatically, I would findout a simple way to re-scale strange values with a not-totally-random algorithm... :classic: I though to 'sql time % 100', but it's too empiric.... :p Do you have any better idea ? Thanks and welcome back. As you can see, Nakkid, your work became very popular... :squareeyed: Bye |
So what's a good stat to have?
Most of my pages are like this: Page generated in 0.5019860 seconds (91.89% PHP - 8.11% MySQL) with 22 queries. I guess it's good that MySQL isn't bogging down right? :) |
looks good to me.. your stats are solid. not to many queries (very important for your server - keep it under 40)
|
Quote:
the way your host twisted the answer made me laugh. application prob? hmmm well, with a plain board installed there is nothing thay can commnet on it. i guarantee you will get the same probs. let me know please how it went. :) |
Quote:
Wish me luck :D |
Hi...
I have examined the code a little bit deeper, and I got a solution for these negative value problems, I think. In my opinion it is a little bug in your hack. I figured out that my pagestarttime was always set to zero. This is caused in global.php: PHP Code:
I changed it to: PHP Code:
replace this: PHP Code:
PHP Code:
Greets JDD If this may be wrong, just inform me and I edit this (but I think it should solve the problem) |
PHP Code:
leave the rest unchanged, it should work fine, the starttime must be set to zero. |
Quote:
Quote:
So, just give my modifications a chance and try them out, you'll see they would work. I have no clue why it is working on vB.org, but I doubt they use your code in it's original form. This is btw. a really nice hack - I like it very much therefore I tried to make it work and excamined it a little bit more than usual. JDD |
Extension: how could I use a similar replacement variable (or at least similar calculation) to show stats of some AdminCP pages ?
Note: db_mysql.php vars are of course always present (saw appending &explain=1 to the query_string) .... I tried to call dooutput(" ", 0) just before the end of AdminCP page and then use $microstats variable (correctly set), but got an unexpected behavior of that function... I saw unprintable chars .... for example. Thnx |
Quote:
PHP Code:
Thnx |
Hi...
Quote:
For the endtime var it doesn't matter because it is always set to the current time just before it is used. So only starttime could be a prob, I have a solution for it to fix.. just sent me a pm so we could try it out (unfortunately I couldn't test it, because the ftp server of my webpage is currently down, therefore I don't post it because I am not sure that it does work 100%) JDD |
Quote:
Let me try. Looking at php.net manual for microtime() I tried to use that sample function PHP Code:
Well. I got values of about 3-4 seconds, nearest to the actual latency time before displaying on a fast connection... many more than 0.7 seconds displayed by { getmicrostats } function at the end of the same page... :ermm: Heeeellllllllpppppppp !!!!!!!! :squareeyed: |
Quote:
Quote:
also, what time values you get when you load the page? can you post a website so i see the way it works on your server? |
Quote:
|
Quote:
Referred to FF only to identify the original hack and distinguish it from the variant by JDD. That's all. Btw, as I repeat, the 'empirical' way following the php.net gave numbers about 5-7 times larger than microstats values... That's my question. ;) Thnx |
This upgrade will fix the negative values some users get when loading a page.
CREDITS: JDD pagestarttime addon in [high]global.php[/high] VB2.2.4 forum/global.php (2 changes) 1. Find the code: PHP Code:
PHP Code:
PHP Code:
PHP Code:
1. Find the code: PHP Code:
PHP Code:
|
]works great :) thanx :)
|
At this point I can say I have not seen a negitive number with the fix above. Thank you.
|
i modified a little the [high]$pagestarttime[/high] code JDD posted initially.
let's hope that will cure all the probs...... ;) |
Quote:
PHP Code:
|
$showqueries is present and it asks for microtime.. the rest is for my hack.. :)
i did it this way so you dont get any wierd errors if u miss [high]isset[/high]. i like to leave VB unchanged in those areas.. you never know where it can hit you with an error. leave it this way, it will not hurt nothing. |
Quote:
|
Quote:
Code:
if ($me == $you) { |
Very cool hack, especially when debugging the board.
|
Quote:
|
in other order of ideas... can you post if there are still any negative values present at all time?
thanks. |
Quote:
Since installed 1.7 I never got negative values any more, even on the forumhome... :knockedout: Still I'm receiveing strange values for time. As JDD said before perhaps due to global.php reloaded many times (so even the pagestarttime many times reset), I always get too small values for microseconds elapsed. :( I made this check:
How could I force the pagestarttime reset only at the very beginning of the page and not other times within ???? Thanks again for all your upgrades and support . Bye |
hmm.. did you tried the simple plain microtime? instead of exploding it like at php.net?
|
Quote:
I put that getmicrotime() function in functions.php and used it both times, for start and stop time. Even used strange var names to be sure they weren't messing anything. And got a final global difference of about 4-6 seconds... The same page, at the end, I see the {gms} var about 0.56xxxxx seconds. That's very strange... :confused: Thanks |
strange indeed. so you get those values only with the microtime from php.net? as a .php file? or part of vBulletin?
|
I read this thread. Well I skipped through it, looking for an error like I'm getting. Didn't see one so I'm posting about it.
I've installed this hack on my webserver. it's pulling some strange information. here's the results of the query. Page generated in 1,017,549,010.701014 seconds (100.00% PHP - 0.00% MySQL) with 21 queries. Don't think I need to define much, pretty self explanitory. I'm converting a few UBB's over to vBulletin since I just bought it. (bring 5 UBB's down, and combining them into one VB. I've hacked the crud out of the UBB's but most of what I want in the boards are already here in VB. I'm sure it's a newbie thing. Just don't know where to go. I've completed the import of my threads and users, but just cannot figure this out, and want to resolve it before i go to production. You can see the test bed here: www.clanservers.net/forumtest If this has already been addressed, I apologize, and if someone could link me to where it's resolved I'd be very greatful. V |
and before anyone says how ugly the individual categories are inside, heehe I know, but I don't care about looks on this board, just functionality. So I'll correct the themes when I get everything working.
|
Quote:
check the file. |
Quote:
|
That sounds like exactly what I likely did.
Doesn't make sense to me that there'd be duplicate file names like that, but I'm no coder, so I'll keep my mouth shut prior to making a fool of myself. I found another error, so I wiped the entire board, and am setting it up again, so I'll hack the right file now :p thanks for the replies! |
Viruseater, check your code. you get those values only because vB is looking for [high]$pagestarttime[/high] and it can't find it.
if you check all the steps carefully, you will see your mistake. regards, nakkid. |
Quote:
statements against my modified files. Last, as said, I put the getmicrotime() function in admin/functions.php exactly as it's described on www.php.net This is exactly what I did: I used two files index.php, called index224_plain.php and index224_hackd.php and uploaded to forum home dir, respectively the original 2.2.4 version and the hacked one. Both with some mods: PHP Code:
PHP Code:
of the page, I ensured that script is called only ONCE by index.php... Note: last two days, for some unexplained reason, my server disabled GZip and any other encoding ... I hope it's a short time event... :( Code:
PLAIN index.php taken by the forumhome template processing. Much more than all the SELECTs (38 with hacks, 19 with the plain version). And the { getmicrostats } is evalued BEFORE the template is loaded and processed. Infact that value is almost similar to mine as computed immediately before the eval ("forumhome template"). Of course, the doubled number of queries in the hacked version reversed also the percentage ratio of php vs. sql ... Interesting, isn't it ? :) Hope I was able to explain myself :stupid: Thanks. |
i dont know what to say Jawelin. anyone else have the same problem? so far everyone is really happy with 1.7...
|
All times are GMT. The time now is 05:00 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|