684 |
let unconnected_unknown_clients = ref 0 in |
let unconnected_unknown_clients = ref 0 in |
685 |
let uninteresting_clients = ref 0 in |
let uninteresting_clients = ref 0 in |
686 |
let aliased_clients = ref 0 in |
let aliased_clients = ref 0 in |
687 |
let connected_clients = ref 0 in |
let myconnected_clients = ref 0 in |
688 |
let closed_connections = ref 0 in |
let closed_connections = ref 0 in |
689 |
let unlocated_client = ref 0 in |
let unlocated_client = ref 0 in |
690 |
let bad_numbered_clients = ref 0 in |
let bad_numbered_clients = ref 0 in |
717 |
(try |
(try |
718 |
Hashtbl.find connected_clients_by_num num |
Hashtbl.find connected_clients_by_num num |
719 |
with _ -> |
with _ -> |
720 |
incr connected_clients; |
incr myconnected_clients; |
721 |
waiting_msgs := !waiting_msgs + nmsgs; |
waiting_msgs := !waiting_msgs + nmsgs; |
722 |
buffers := !buffers + buf_len; |
buffers := !buffers + buf_len; |
723 |
(* |
(* |
747 |
Printf.bprintf buf " Read Buffers: %d\n" !buffers; |
Printf.bprintf buf " Read Buffers: %d\n" !buffers; |
748 |
Printf.bprintf buf " Write Messages: %d\n" !waiting_msgs; |
Printf.bprintf buf " Write Messages: %d\n" !waiting_msgs; |
749 |
Printf.bprintf buf " Uninteresting clients: %d\n" !uninteresting_clients; |
Printf.bprintf buf " Uninteresting clients: %d\n" !uninteresting_clients; |
750 |
Printf.bprintf buf " Connected clients: %d\n" !connected_clients; |
Printf.bprintf buf " Connected clients: %d\n" !myconnected_clients; |
751 |
Printf.bprintf buf " Aliased clients: %d\n" !aliased_clients; |
Printf.bprintf buf " Aliased clients: %d\n" !aliased_clients; |
752 |
Printf.bprintf buf " Closed clients: %d\n" !closed_connections; |
Printf.bprintf buf " Closed clients: %d\n" !closed_connections; |
753 |
Printf.bprintf buf " Unlocated clients: %d\n" !unlocated_client; |
Printf.bprintf buf " Unlocated clients: %d\n" !unlocated_client; |
754 |
Printf.bprintf buf " Bad numbered clients: %d\n" !bad_numbered_clients; |
Printf.bprintf buf " Bad numbered clients: %d\n" !bad_numbered_clients; |
755 |
Printf.bprintf buf " Dead clients: %d\n" !dead_clients; |
Printf.bprintf buf " Dead clients: %d\n" !dead_clients; |
756 |
Printf.bprintf buf " Disconnected aliases: %d\n" !disconnected_alias; |
Printf.bprintf buf " Disconnected aliases: %d\n" !disconnected_alias; |
757 |
|
|
758 |
|
Printf.bprintf buf "Number of old files: %d\n" (List.length !!old_files); |
759 |
|
Printf.bprintf buf "Current files: %d\n" (List.length !current_files); |
760 |
|
|
761 |
|
let counter = ref 0 in |
762 |
|
UdpClientWHashtbl.iter (fun _ -> incr counter) udp_clients; |
763 |
|
Printf.bprintf buf " udp_clients: %d\n" !counter; |
764 |
|
|
765 |
|
Printf.bprintf buf " client_to_client_tags: %d\n" (List.length !client_to_client_tags); |
766 |
|
Printf.bprintf buf " client_to_server_tags: %d\n" (List.length !client_to_server_tags); |
767 |
|
Printf.bprintf buf " overnet_connectreply_tags: %d\n" (List.length !overnet_connectreply_tags); |
768 |
|
Printf.bprintf buf " overnet_connect_tags: %d\n" (List.length !overnet_connect_tags); |
769 |
|
Printf.bprintf buf " clients_root: %d\n" (List.length !clients_root); |
770 |
|
Printf.bprintf buf " servers_list: %d\n" (List.length !servers_list); |
771 |
|
Printf.bprintf buf " current_files: %d\n" (List.length !current_files); |
772 |
|
Printf.bprintf buf " xs_servers_list: %d\n" (List.length !xs_servers_list); |
773 |
|
Printf.bprintf buf " connected_server_list: %d\n" (List.length !connected_server_list); |
774 |
|
Printf.bprintf buf " udp_servers_list: %d\n" (List.length !udp_servers_list); |
775 |
|
Printf.bprintf buf " interesting_clients: %d\n" (List.length !interesting_clients); |
776 |
|
Printf.bprintf buf " shared_files: %d\n" (List.length !shared_files); |
777 |
|
Printf.bprintf buf " new_hsared_files: %d\n" (List.length !new_shared_files); |
778 |
|
Printf.bprintf buf " file_md4s_to_register: %d\n" (List.length !file_md4s_to_register); |
779 |
|
|
780 |
|
Printf.bprintf buf " servers_by_key: %d\n" (Hashtbl.length servers_by_key); |
781 |
|
Printf.bprintf buf " banned_ips: %d\n" (Hashtbl.length banned_ips); |
782 |
|
Printf.bprintf buf " old_requests: %d\n" (Hashtbl.length old_requests); |
783 |
|
Printf.bprintf buf " connected_clients: %d\n" (Hashtbl.length connected_clients); |
784 |
|
Printf.bprintf buf " files_by_md4: %d\n" (Hashtbl.length files_by_md4); |
785 |
|
Printf.bprintf buf " shared_files_info: %d\n" (Hashtbl.length shared_files_info); |
786 |
|
Printf.bprintf buf " file_groups: %d\n" (Hashtbl.length file_groups); |
787 |
|
Printf.bprintf buf " udp_servers_replies: %d\n" (Hashtbl.length udp_servers_replies); |
788 |
|
Printf.bprintf buf " join_queue_by_md4: %d\n" (Hashtbl.length join_queue_by_md4); |
789 |
|
Printf.bprintf buf " join_queue_by_id: %d\n" (Hashtbl.length join_queue_by_id); |
790 |
|
|
791 |
|
let list = H.to_list clients_by_kind in |
792 |
|
if level > 0 then begin |
793 |
|
List.iter (fun c -> |
794 |
|
Printf.bprintf buf "[%d ok: %s rating: %d]\n" |
795 |
|
(client_num c) |
796 |
|
(string_of_date (c.client_source.DonkeySources.source_age)) |
797 |
|
(* TODO: add connection state *) |
798 |
|
c.client_rating; |
799 |
|
) list; |
800 |
|
end; |
801 |
() |
() |
802 |
|
|
803 |
let remove_client c = |
let remove_client c = |
1013 |
**************************************************************) |
**************************************************************) |
1014 |
|
|
1015 |
let _ = |
let _ = |
|
Heap.add_memstat "DonkeyGlobals" (fun level buf -> |
|
|
Printf.bprintf buf "Number of old files: %d\n" (List.length !!old_files); |
|
|
Printf.bprintf buf "Current files: %d\n" (List.length !current_files); |
|
|
let list = H.to_list clients_by_kind in |
|
|
Printf.bprintf buf "Clients_by_kind: %d\n" (List.length list); |
|
|
if level > 0 then |
|
|
List.iter (fun c -> |
|
|
Printf.bprintf buf "[%d ok: %s rating: %d]\n" |
|
|
(client_num c) |
|
|
(string_of_date (c.client_source.DonkeySources.source_age)) |
|
|
(* TODO: add connection state *) |
|
|
c.client_rating |
|
|
; |
|
|
) list; |
|
|
); |
|
|
|
|
1016 |
Heap.add_memstat "DonkeyGlobals" local_mem_stats |
Heap.add_memstat "DonkeyGlobals" local_mem_stats |
1017 |
|
|
1018 |
(************************************************************* |
(************************************************************* |