mirror of
https://github.com/ENSL/ensl_hlds.git
synced 2024-12-12 05:22:52 +00:00
Add renice script and update FPS script
This commit is contained in:
parent
408c831dda
commit
5c35b8a155
2 changed files with 13 additions and 3 deletions
|
@ -1,8 +1,14 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import rHLDS, yaml, re, time, os, argparse
|
import rHLDS, yaml, re, time, os, argparse
|
||||||
from bokeh.plotting import figure, output_file, show
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
from bokeh.plotting import figure, output_file, show
|
||||||
|
#from bokeh.charts import Area, show, output_file, defaults
|
||||||
|
#from bokeh.layouts import row
|
||||||
|
|
||||||
|
#defaults.width = 1024
|
||||||
|
#defaults.height = 1024
|
||||||
|
|
||||||
def write_data(filename):
|
def write_data(filename):
|
||||||
# Default port 27015
|
# Default port 27015
|
||||||
srv = rHLDS.Console(host=os.environ['RCON_HOST'], port=os.environ['RCON_PORT'], password=os.environ['RCON_PASSWORD'])
|
srv = rHLDS.Console(host=os.environ['RCON_HOST'], port=os.environ['RCON_PORT'], password=os.environ['RCON_PASSWORD'])
|
||||||
|
@ -39,14 +45,14 @@ def read_data(filename):
|
||||||
if fps and time:
|
if fps and time:
|
||||||
print('time: ' + time)
|
print('time: ' + time)
|
||||||
print('fps: ' + fps)
|
print('fps: ' + fps)
|
||||||
fps_time.append(datetime.fromtimestamp(int(time)/1000))
|
fps_time.append(datetime.fromtimestamp(int(time)))
|
||||||
fps_data.append(fps)
|
fps_data.append(fps)
|
||||||
|
|
||||||
# output to static HTML file
|
# output to static HTML file
|
||||||
output_file("%s.html" % filename)
|
output_file("%s.html" % filename)
|
||||||
|
|
||||||
# create a new plot with a title and axis labels
|
# create a new plot with a title and axis labels
|
||||||
p = figure(title="hlds_linux stats", x_axis_label='time', y_axis_label='FPS')
|
p = figure(title="hlds_linux stats", x_axis_label='time', y_axis_label='FPS', x_axis_type="datetime", width=1600)
|
||||||
|
|
||||||
# add a line renderer with legend and line thickness
|
# add a line renderer with legend and line thickness
|
||||||
p.line(fps_time, fps_data, legend="FPS", line_width=2)
|
p.line(fps_time, fps_data, legend="FPS", line_width=2)
|
||||||
|
|
4
scripts/renice.sh
Executable file
4
scripts/renice.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo taskset -a -p -c 1 `pgrep hlds_linux`
|
||||||
|
sudo renice -19 `pgrep hlds_linux`
|
Loading…
Reference in a new issue