Remove bogus =end from end of manpage.
[virt-top.git] / virt-ctrl / vc_connections.mli
1 (* virt-ctrl: A graphical management tool.
2    (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
3    http://libvirt.org/
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19    Handle connections and the complicated GtkTreeView which
20    displays the connections / domains.
21 *)
22
23 (** Get the list of current connections. *)
24 val get_conns : unit -> (int * Libvirt.rw Libvirt.Connect.t) list
25
26 (** The current/previous state last time repopulate was called.  The
27     repopulate function uses this state to determine what has changed
28     (eg. domains added, removed) since last time.
29 *)
30 type state
31
32 type columns = string GTree.column * string GTree.column * string GTree.column * string GTree.column * string GTree.column * int GTree.column
33
34 (** This function should be called once per second in order to
35     redraw the GtkTreeView.
36
37     Takes the previous state as a parameter and returns the new state.
38 *)
39 val repopulate : GTree.view -> GTree.tree_store -> columns -> state -> state
40
41 (** Create the GtkTreeView.  Returns the widget itself, the model,
42     the list of columns, and the initial state.
43 *)
44 val make_treeview :
45   ?packing:(GObj.widget -> unit) -> unit ->
46     GTree.view * GTree.tree_store * columns * state
47
48 (** Open a new connection to the hypervisor URI given. *)
49 val open_connection : string -> unit
50
51 (** Return the amount of historical data that we hold about a
52     domain (in seconds).
53
54     The parameters are connection ID (see {!get_conns}) and domain ID.
55
56     This can return from [0] to [86400] (or 1 day of data).
57 *)
58 val get_hist_size : int -> int -> int
59
60 (** Return a slice of historical %CPU data about a domain.
61
62     The required parameters are connection ID (see {!get_conns})
63     and domain ID.
64
65     The optional [latest] parameter is the latest data we should
66     return.  It defaults to [0] meaning to return everything up to now.
67
68     The optional [earliest] parameter is the earliest data we should
69     return.  This is a positive number representing number of seconds
70     back in time.  It defaults to returning all data.
71
72     The optional [granularity] parameter is the granularity of data
73     that we should return, in seconds.  This defaults to [1], meaning
74     to return all data (once per second), but you might for example
75     set this to [60] to return data for each minute.
76
77     This returns an array of data.  The first element of the array is
78     the oldest data.  The last element of the array is the most recent
79     data.  The array returned might be shorter than you expect (if
80     data is missing or for some other reason) so always check the
81     length.
82
83     Entries in the array are clamped to [0..100], except that if an
84     entry is [-1] it means "no data".
85
86     This returns a zero-length array if we don't know about the domain.
87 *)
88 val get_hist_cpu : ?latest:int -> ?earliest:int -> ?granularity:int ->
89   int -> int ->
90   int array
91
92 (** Return a slice of historical memory data about a domain.
93
94     Parameters as above.
95
96     Entries in the array are 64 bit integers corresponding to the
97     amount of memory in KB allocated to the domain (not necessarily
98     the amount being used, which we don't know about).
99 *)
100 val get_hist_mem : ?latest:int -> ?earliest:int -> ?granularity:int ->
101   int -> int ->
102   int64 array