Raised This Month: $2 Target: $400
 0% 

[CS:GO] Getting "SV" and "Var" values


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
psychonic

BAFFLED
Join Date: May 2008
Old 02-28-2017 , 15:33   [CS:GO] Getting "SV" and "Var" values
Reply With Quote #1

Since CS:GO's release, multiple people have asked how to get the "SV" and "Var" netgraph values server-side. I don't know of anyone posting anything for this yet (and I did do a quick search), so I finally looked into it.

The attached include, with gamedata, exposes the three values used for this.

It contains three functions:
PHP Code:
float GetFrameTimeStdDev();

float GetFrameStartTimeStdDev();

float GetFrameComputationTime(); 
For example, to reproduce the netgraph display line, you can do:
PHP Code:
#include <sourcemod>
#include <sv-var>

public void OnPluginStart()
{
    
RegServerCmd("show_sv_stats"show_sv_stats);
}

public 
Action show_sv_stats(int argc)
{
    
PrintToServer("sv:%5.1f +-%4.1f ms   var: %6.3f ms"GetFrameComputationTime()*1000.0,
        
GetFrameTimeStdDev() * 1000.0GetFrameStartTimeStdDev() * 1000.0 );

    return 
Plugin_Handled;

Here's some test output:
Code:
Server empty, hibernating
sv:123.0 +- 9.9 ms   var: 10.091 ms

Server empty, awake
sv:  0.2 +- 0.5 ms   var:  0.551 ms

Server with 12 bots
sv:  6.5 +- 3.1 ms   var:  4.416 ms
I haven't tested the Linux gamedata, but it should work. Let me know otherwise.
Attached Files
File Type: inc sv-var.inc (1.5 KB, 159 views)
File Type: txt sv-var.games.txt (1.0 KB, 253 views)

Last edited by psychonic; 03-01-2017 at 06:50.
psychonic is offline
b3none
AlliedModders Donor
Join Date: Oct 2016
Location: GetUserLocation();
Old 04-24-2017 , 08:08   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #2

Great share, thanks very much
__________________
b3none is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 07-02-2017 , 14:44   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #3

Thanks for this
__________________
ImACow is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 07-02-2017 , 16:26   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #4

Is adding any of these values possible?

Code:
  CPU   NetIn   NetOut    Uptime  Maps   FPS   Players  Svms    +-ms   ~tick
  10.0 325262.6 2923122.8    1521    32  102.43      27    6.93    1.65    0.02
The CPU and FPS would be awesome!
__________________
ImACow is offline
sarangkaith
New Member
Join Date: Jun 2017
Old 07-03-2017 , 01:10   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #5

Hi,

I tried writing code for some complex values as input but was not able to succeed with it. The code ran perfectly for two inputs but yielded abrupt values for the third one.

------
Regards,
Sarang kaith
Theappsmiths Reviews

Last edited by sarangkaith; 07-04-2017 at 02:43.
sarangkaith is offline
AlpenPL
New Member
Join Date: Feb 2012
Location: Poland
Old 05-24-2020 , 19:17   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #6

HTML Code:
[SM] Exception reported: Failed to look up host_framestarttime_stddeviation address
Hello,
Does anyone have current valid gamedata file?
AlpenPL is online now
boboffuture
Junior Member
Join Date: Jun 2017
Old 06-15-2020 , 10:27   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #7

Here are the updated sigs for Linux
Attached Files
File Type: txt sv-var.games.txt (1.5 KB, 8 views)
boboffuture is offline
AlpenPL
New Member
Join Date: Feb 2012
Location: Poland
Old 06-16-2020 , 18:32   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #8

Quote:
Originally Posted by boboffuture View Post
Here are the updated sigs for Linux
thanks a lot, you are amazing!
AlpenPL is online now
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:22.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode