Changes between Version 9 and Version 10 of Old/CollectMeasurements
- Timestamp:
- Apr 19, 2006, 10:26:00 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Old/CollectMeasurements
v9 v10 7 7 The definition of a measurement point is shown below. 8 8 {{{ 9 <application id="foo"> 9 10 <measurement-points> 10 <measurement-point id="group -1">11 <measurement-point id="group1"> 11 12 <metric id="rssi" type="float"/> 12 13 <metric id="noise" type="float"/> 13 14 </measurement-point> 14 <measurement-point id="group -2">15 <measurement-point id="group2"> 15 16 <metric id="throughput" type="int"/> 16 17 </measurement-point> 17 18 </measurement-points> 19 </application> 18 20 }}} 19 21 20 Measurement point definitions are saved as an XML-based configuration file, and source code for the measurement client is automatically generated that contains application-specific methods that handle type-safe data collection. This source code can be compiled and linked with the application as illustrated by a Makefile and sample application code below. 22 Measurement point definitions are saved as an XML-based configuration file as shown above. The source code for the measurement client is automatically generated by the web-based OML service that accepts the xml file shown above and returns the autogenerated client API. This API contains application-specific methods that handle type-safe data collection. This source code can be compiled and linked with the application as illustrated by a Makefile and sample application code below. 23 24 The OML service returns a file called "wrapper" which is a tar+gzipped file containing the src,include and lib directories for the OML client API. The src directory need not be used as we already create a static library for the API (see lib directory). In the Makefile, note that the autogenerated filenames include the application id (foo) from the xml file above. Also note how we use the include and lib directories in CFLAGS and LDFLAGS and then link to the oml_client and the client_api libs in LIBS variable. The oml_client library is installed on the gateway machine and is part of the baseline image. 21 25 22 26 '''Makefile and include file for Measurement Points''' … … 24 28 {{{ 25 29 Sample Makefile: 26 $(INC_DIR)/oml_%.h : $(ETC_DIR)/%.xml 27 mkdir -p $(INC_DIR) 28 wget -q http://oml.orbit-lab.org/generator/wrapper\ 29 --post-file $< -O - \ 30 | tar -C $(BUILD_DIR) -xzf 30 APP = foo 31 CC = gcc 32 CFLAGS = -g -Wall -I./include 33 LDFLAGS = -L./lib/i386-linux 34 LIBS = -loml_client -loml_$(APP) 35 SRCS = app.c 31 36 32 oml_foo.h: 37 app: $(SRCS) oml_$(APP).h 38 $(CC) -o app $(CFLAGS) $(SRCS) $(LDFLAGS) $(LIBS) 39 40 oml_$(APP).h: $(APP)-def.xml 41 wget -q http://oml.orbit-lab.org/generator/wrapper --post-file $< -O -\ 42 | tar -xzf - 43 44 ---------------- End of Makefile -------------------- 45 46 ./include/oml_foo.h: 33 47 int oml_group1(float rssi, float noise); 34 48 int oml_group2(int throughput);