/*
** CBLM v3
** $Id: data.h,v 1.13 2008/07/14 00:25:08 sella Exp $
** Copyright (c) 2004-2007 James M. Sella. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
** 
** Cheap Bastard Latency Monitor v3
*/

#ifndef __DGS_DATA_H
#define __DGS_DATA_H

#include "common.h"

#define SUMMARY_INTERVAL	(60 * 15) // Every 15 min check to see if a summary if needed.
#define QUEUE_DEPTH_MULT	90 // Max entries per probe (depth = probes * MULT)

/* Storage intervals (in sec) */
#define DATA_INTERVAL_MIN	60	// Use 60 sec of data for 1 min data point.
#define DATA_INTERVAL_HOUR	3600 // Use 3600 of data for 1 hour data point.
#define DATA_INTERVAL_DAY	86400 // Use 86400 of data for 1 day data point.
#define DATA_MULTIPLIER		3 // 3x extra precision data beyond rollup.
#define DATA_EXPIRATION		(86400 * 365 * DATA_MULTIPLIER) // Expire data after 3 years
#define DATA_ROLLUP_DELAY	1800 // Delay 1800 seconds after reconnect to attempt rollup.
/*
	Max Samples is S where P is the number of probes in mesh:
	(P * (P - 1)) * ((DATA_MULTIPLIER * 180) + (DATA_MULTIPLIER * 24) + (DATA_MULTIPLIER * 365)) = S
*/

/* Function definitions. */
void process_packet(struct packet_t *packet);
int write_data(struct data_t *data);
int summarize_data();

#endif

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim: noet ts=3 sw=3
*/
