Crossfire Client, Trunk
crossfire-crossfire-client
utils
pprof-latency.py
Go to the documentation of this file.
1
"""
2
pprof-latency.py -- process Crossfire client latency profile
3
usage:
4
1. gather a profile using:
5
6
$ crossfire-client-gtk2 --profile-latency > out.txt
7
8
2. process the profile:
9
10
$ python3 utils/pprof-latency.py out.txt
11
"""
12
import
sys
13
14
def
main
():
15
if
len(sys.argv) < 2:
16
print(
"usage: python3 pprof-latency.py FILE"
)
17
return
18
19
path = sys.argv[1]
20
with
open(path,
'r'
)
as
dat, open(path +
".hist"
,
'w'
)
as
hist:
21
data = dat.readlines()
22
fields =
map
(
lambda
l: l.strip().split(
'\t'
), data)
23
pending = {}
24
for
f
in
fields:
25
if
f[0] ==
'profile/com'
:
26
n, cmd = f[1:]
27
n = int(n)
28
pending[n] = cmd
29
elif
f[0] ==
'profile/comc'
:
30
n, t, s, _ = f[1:]
31
n = int(n)
32
t = int(t)
33
tdiff = t
34
cmd = pending[n]
35
del pending[n]
36
print(
"%d,%s"
% (tdiff, cmd))
37
print(
"%d"
% tdiff, file=hist)
38
39
if
__name__ ==
'__main__'
:
40
main
()
is
cfmaplog py A Crossfire Map Log Plug In designed for the Crossfire GTK2 Client Conceptualized Last with or without are permitted in any medium without royalty provided the copyright notice and this notice are preserved This file is offered as is
Definition:
cfmaplog.txt:11
cfmaplog
Definition:
cfmaplog.py:1
by
cfmaplog py A Crossfire Map Log Plug In designed for the Crossfire GTK2 Client Conceptualized by
Definition:
cfmaplog.txt:4
races
Race_Class_Info * races
Definition:
commands.c:98
commands
struct CmdMapping commands[]
Definition:
client.c:101
playing
static bool playing
Definition:
main.c:63
keybind
Definition:
keys.c:99
in
static GInputStream * in
Definition:
client.c:71
cfmaplog.maps
maps
Definition:
cfmaplog.py:448
client
To create a Windows client you need NSIS First build the client
Definition:
nsis.txt:3
cfmaplog.debug
bool debug
Definition:
cfmaplog.py:39
cfmaplog.completed
int completed
Definition:
cfmaplog.py:599
Map
Definition:
mapdata.h:80
scripts
static struct script * scripts
Definition:
script.c:147
pprof-latency.main
def main()
Definition:
pprof-latency.py:14
player
static item * player
Definition:
item.c:27
cfmaplog.visits
int visits
Definition:
cfmaplog.py:542
map
static item * map
Definition:
item.c:27
cfmaplog.servers
int servers
Definition:
cfmaplog.py:205
modification
cfmaplog py A Crossfire Map Log Plug In designed for the Crossfire GTK2 Client Conceptualized Last modification
Definition:
cfmaplog.txt:9
cfmaplog.players
int players
Definition:
cfmaplog.py:279
script
Definition:
script.c:120
config
static GKeyFile * config
Definition:
config.c:29
classes
Race_Class_Info * classes
Definition:
client.h:610
Generated by
1.8.17