Revision 14d30d82 include/HostPool.h

View differences:

include/HostPool.h
197 197
        return PoolSQL::search(oids, Host::table, where);
198 198
    };
199 199

  
200
    /**
201
     *  Dumps the host monitoring information entries in XML format. A filter
202
     *  can be also added to the query.
203
     *
204
     *  @param oss the output stream to dump the pool contents
205
     *  @param where filter for the objects, defaults to all
206
     *
207
     *  @return 0 on success
208
     */
209
    int dump_monitoring(ostringstream& oss,
210
                        const string&  where);
211

  
212
    /**
213
     * Inserts the last monitoring, and deletes old monitoring entries for this
214
     * host
215
     *
216
     * @param host pointer to the host object
217
     * @return 0 on success
218
     */
219
    int update_monitoring(Host * host)
220
    {
221
        if ( _host_monitoring_history <= 0 )
222
        {
223
            return 0;
224
        }
225

  
226
        return host->update_monitoring(db);
227
    };
228

  
229
    /**
230
     * Deletes all monitoring entries for this host
231
     *
232
     * @param host pointer to the virtual machine object
233
     * @return 0 on success
234
     */
235
    int clean_monitoring(Host * host)
236
    {
237
        return host->clean_monitoring(db);
238
    };
239

  
240
    /**
241
     *  Get the size, in seconds, of the historical monitoring information
242
     *  @return the seconds
243
     */
244
    static const int& host_monitoring_history()
245
    {
246
        return _host_monitoring_history;
247
    };
248

  
200 249
private:
201 250

  
202 251
    /**
......
217 266
     *    @return 0 on success
218 267
     */
219 268
    int discover_cb(void * _map, int num, char **values, char **names);
269

  
270
    /**
271
     * Size, in seconds, of the historical monitoring information
272
     */
273
    static int _host_monitoring_history;
220 274
};
221 275

  
222 276
#endif /*HOST_POOL_H_*/

Also available in: Unified diff