Changes between Version 9 and Version 10 of Old/CollectMeasurements


Ignore:
Timestamp:
Apr 19, 2006, 10:26:00 PM (18 years ago)
Author:
pkamat
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/CollectMeasurements

    v9 v10  
    77The definition of a measurement point is shown below.   
    88{{{
     9<application id="foo">
    910<measurement-points>
    10   <measurement-point id="group-1">
     11  <measurement-point id="group1">
    1112    <metric id="rssi" type="float"/>
    1213    <metric id="noise" type="float"/>
    1314  </measurement-point>
    14   <measurement-point id="group-2">
     15  <measurement-point id="group2">
    1516    <metric id="throughput" type="int"/>
    1617  </measurement-point>
    1718</measurement-points>
     19</application>
    1820}}}
    1921
    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.
     22Measurement 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
     24The 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.
    2125
    2226'''Makefile and include file for Measurement Points'''
     
    2428{{{
    2529Sample 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
     30APP = foo
     31CC  = gcc
     32CFLAGS  = -g -Wall -I./include
     33LDFLAGS = -L./lib/i386-linux
     34LIBS    = -loml_client -loml_$(APP)
     35SRCS = app.c
    3136
    32 oml_foo.h:
     37app: $(SRCS) oml_$(APP).h
     38        $(CC) -o app $(CFLAGS) $(SRCS) $(LDFLAGS) $(LIBS)
     39
     40oml_$(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:
    3347        int oml_group1(float rssi, float noise);
    3448        int oml_group2(int throughput);