Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 40 lines (38 sloc) 1.214 kb
04b210b @gnosek A .gdbinit file with show_fair_peers command
authored
1 define show_fair_peer
2 set $n = (ngx_http_upstream_fair_shm_block_t *)$arg0
3 set $peers = $n->peers
75840cf @gnosek Show upstream name in gdb show_fair_peers command
authored
4 printf "upstream id: 0x%08x (%s), current peer: %d/%d\n", $n->node.key, $peers->name.data, $peers->current, $peers->number
04b210b @gnosek A .gdbinit file with show_fair_peers command
authored
5 set $i = 0
743c501 @gnosek Update gdb macros to reflect latest changes
authored
6 while $i < $peers->number
46667a1 @gnosek Update gdb macros
authored
7 set $peer = &$peers->peer[$i]
8 printf "peer %d: %s weight: %d/%d fails: %d/%d acc: %d down: %d nreq: %u last_act: %u\n", $i, $peer->name.data,\
9 $peer->shared->current_weight, $peer->weight,\
10 $peer->shared->fails, $peer->max_fails,\
11 $peer->accessed, $peer->down,\
12 $peer->shared->nreq, $peer->shared->last_active
04b210b @gnosek A .gdbinit file with show_fair_peers command
authored
13 set $i = $i + 1
14 end
15 printf "-----------------\n"
16 if ($n->node.left != $arg1)
17 show_fair_peer $n->node.left $arg1
18 end
19 if ($n->node.right != $arg1)
20 show_fair_peer $n->node.right $arg1
21 end
22 end
23
24 define show_fair_peers
25 set $tree = ngx_http_upstream_fair_rbtree
26 if (!$tree)
27 printf "Cannot find the upstream_fair peer information tree\n"
28 else
29 set $root = (ngx_http_upstream_fair_shm_block_t *)($tree->root)
30 if ($root != $tree->sentinel)
31 show_fair_peer $root $tree->sentinel
32 else
33 printf "No upstream_fair peer information\n"
34 end
35 end
36 end
37 document show_fair_peers
38 Dump upstream_fair peer infromation
39 end
Something went wrong with that request. Please try again.