(file) Return to PacketTypes.h CVS log (file) Jump to this file's LXR Page (dir) Up to [CENS] / tos-contrib / StatisticsTracker

File: [CENS] / tos-contrib / StatisticsTracker / PacketTypes.h (download) / (as text)
Revision: 1.1, Wed Sep 22 17:51:26 2004 UTC (5 years, 2 months ago) by nithya
Branch: MAIN
CVS Tags: rdd_alpha_version_1, pregeonet, acoustic-05-18-06, PRE_TOSNIC_FIX, PRE_NOMEGA_MOTENIC, PRE_CEILING_FIX, PRE_64BIT, MOTENIC_PRE_BUGFIX_20050415, LAURA_CALIBRATION_EXPERIMENTS, HOSTMOTE_PROTOCOL_VERSION_7, HEAD, ESS_RELEASE_3_5, ESS_RELEASE_3_4, ESS_RELEASE_3_3, ESS_RELEASE_3_2, ESS_RELEASE_3_1, ESS_RELEASE_3_0, ESS_RELEASE_2_0, ESS_CONNECTIVITY, ESS_CENTROUTE_TESTING, ESS2-CMS-V1_5_pretest, ESS2-CMS-V1_4cMergeSympathy_2, ESS2-CMS-V1_4c, ESS2-CMS-V1_4b, ESS2-CMS-V1_4a, ESS2-CMS-V1_3, ESS2-CMS-V1_2, ESS2-CMS-V1_1, ESS2-CMS-V1_0, EMSTAR_RELEASE_2_5, EMSTAR_RELEASE_2_1_BRANCH, EMSTAR_RELEASE_2_1, EMSTAR_PRE_HTML, CYCLOPS_RELEASE_CANDIDATE_2_0, CYCLOPS_PRERELEASE_STABLE, CENTROUTE_EMSTAR_SOCKETS, BG_1_0, BANGLADESH_ARSENIC_1_2, BANGLADESH_ARSENIC_1_1, AMARSS_JR_DEPLOYMENT_6_05_07
This module can be used to track various power-related statistics (e.g.
time the radio is on, number of packets sent, time spent transmitting).

It is very easy to use - in order to indicate the start/stop of an
event, the ReportPacketEvent interface is used. n order to retreive
the latest snapshot, or to reset the stats, the RetreiveStatistics interface
is used.

StatisticsC/M provide both of these interfaces.

I implemented a milli-second granularity clock as well in order to
get ms times (o/w the options were micro-second, or 32 millisecond granularities).

// Possible actions handled by the power-tracker
enum {
  RT_SEND_DATA  = 1,
  RT_RECV_DATA,
  RT_SEND_NACK, 
  RT_RECV_NACK,
  MOTE_OFF, 
  MOTE_ON,  
  RADIO_ON,  // includes idle mode and Receive mode
  RADIO_OFF,  

  // MUST call RADIO_STOP_SEND after RADIO_START_SEND!
  RADIO_START_SEND, 
  RADIO_STOP_SEND, 
  SENSOR_ON, 
  SENSOR_OFF,
  ANALOG_SENSOR_ON ,
  ANALOG_SENSOR_OFF ,
  DSDV_MSG_SEND ,
  DSDV_MSG_RECV ,
  CONTROL_POWERSAVE_PACKETS_SEND,  
  CONTROL_POWERSAVE_PACKETS_RECV ,
  CONTROL_DATASCHEDULER_PACKETS_SEND, 
  CONTROL_DATASCHEDULER_PACKETS_RECV, 
  MISC_PACKET_TX, 
  MISC_PACKET_RX, 
};

// Struct used to transfer statistics between components
typedef struct Statistics {
  // Power Tracker
  // Naming convention <type>_<module>_<action>_<units>
  // type = num or time
  uint32_t time_mote_on_msec;
  uint32_t time_radio_on_msec;
  uint32_t time_radio_tx_msec;
  uint32_t time_sensor_on_msec;
  uint32_t time_analog_sensor_on_msec;
  uint32_t time_total_sec; // Total time these counters were running

  // Packet Counters
  // Naming convention <type>_<protocol>_<action>_<pkt_type>
  // type = num or time
  // protocol => rt = reliability, dsdv = routing, ps => power-save, 
  // 	ds => data-scheduler
  uint16_t num_rt_send_data;
  uint16_t num_rt_recv_data;
  uint16_t num_rt_send_nack;
  uint16_t num_rt_recv_nack;
  uint16_t num_dsdv_sent;
  uint16_t num_dsdv_recv;
  uint16_t num_packets_send_total;
  uint16_t num_packets_recv_total;
  uint16_t num_ps_send_ctrl;
  uint16_t num_ps_recv_ctrl;
  uint32_t num_ds_send_ctrl;
  uint32_t num_ds_recv_ctrl;
} Statistics_t;

CENS CVS Mailing List
Powered by
ViewCVS 0.9.2