From 5c35b8a1552d1ea61919389754b893a25b8c4629 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Sat, 28 Apr 2018 06:17:58 +0000 Subject: [PATCH] Add renice script and update FPS script --- scripts/fps.py | 12 +++++++++--- scripts/renice.sh | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 scripts/renice.sh diff --git a/scripts/fps.py b/scripts/fps.py index f1ebcf0..e702286 100755 --- a/scripts/fps.py +++ b/scripts/fps.py @@ -1,8 +1,14 @@ #!/usr/bin/env python3 import rHLDS, yaml, re, time, os, argparse -from bokeh.plotting import figure, output_file, show 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): # Default port 27015 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: print('time: ' + time) print('fps: ' + fps) - fps_time.append(datetime.fromtimestamp(int(time)/1000)) + fps_time.append(datetime.fromtimestamp(int(time))) fps_data.append(fps) # output to static HTML file output_file("%s.html" % filename) # 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 p.line(fps_time, fps_data, legend="FPS", line_width=2) diff --git a/scripts/renice.sh b/scripts/renice.sh new file mode 100755 index 0000000..0b50c70 --- /dev/null +++ b/scripts/renice.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sudo taskset -a -p -c 1 `pgrep hlds_linux` +sudo renice -19 `pgrep hlds_linux`