TickTimer
#1
TickTimer is a plugin that counts the time between ticks: essentially a measure of lag on the server. The plugin also allows access via the console.

Commands:

Code:
/lag
- Gives the average TPS over the last 40 (configurable) ticks.

Permissions:

Code:
ticktimer.tps
- Allows access to the /tps command.

Download:

Github; zipfile.
Reply
Thanks given by:
#2
Good job! Something similar to what I've been planning for quite some time, just never got around to it.
May I suggest a second feature? If a tick takes longer than a configurable threshold (let's say half a second), log that to the server console:
"INFO: Tick took too long: 985 ms instead of 50 ms. Last such overload: 5 ticks ago". That would be quite helpful for me as a developer.

Also, there's a small mistmatch between /tps and /lag commands in the description.
Reply
Thanks given by:
#3
Ah, I'll clarify (/lag and /tps both work). The extra feature sounds great, I'll add it straight away.
Reply
Thanks given by:
#4
Maybe for the extra feature add a command to turn it off temporarily - in case it floods the server console Wink
Reply
Thanks given by:
#5
I added a config switch, I'll add a configurable delay it will wait before it says it again.

Done!
Reply
Thanks given by:
#6
Does that even work? I thought I clamped the delta time somewhere - high delta time values can make things overshoot - or are you using other methods for measuring the time between ticks?
Reply
Thanks given by:
#7
I have no idea! If the delta is clamped to 20tps, then the plugin may not work. If it's higher it may work, just not properly. Maybe you can make a new hook for the full amount of time it takes. Or maybe HOOK_TICK_FINISHED which calls OnTickFinished(TimeTaken) where timetaken is the amount of time MCServer took to compute ontick events in ms?
Reply
Thanks given by:
#8
There is no cap; only if a tick takes less than 50 ms, the server sleeps for whatever milliseconds are left until a full tick (Server.cpp lines 367 - 394, function ServerTickThread() )
Reply
Thanks given by:
#9
Actually ...

bool cServer::Tick(float a_Dt)
{
    //LOG("1. Tick %0.2f", a_Dt);
	if( a_Dt > 100.f ) a_Dt = 100.f; // Don\'t go over 1/10 second
....
Reply
Thanks given by:
#10
OkTongue Why is the tick set at max 100ms? Is there any way to get the actual duration, not capped?
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)