'''[wiki:GEC16Agenda/WiMAX-Tutorial/Coop/01 Previous]''' == Instrumenting Coopshim with OML == The coopshim application is written in Python. After verifying that it works, we used the instructions [https://pypi.python.org/pypi/oml4py/ oml4py] library homepage to instrument the script. We set up three ''measurement points'' (database tables) in the script: * ''req'' - used to store information about requests between nodes * ''recv'' - used to store information about recovered packets between nodes * ''sent'' - used to store information about recovery packets sent from nodes {{{ #!python from oml4py import OMLBase class CoopShim(BaseShim): coop = {} coop['oml'] = OMLBase("coopshim") coop['oml'].addmp("req", "id:long total:long") coop['oml'].addmp("recv", "id:long total:long source:string") coop['oml'].addmp("sent", "id:long total:long dest:string") coop['oml'].start() ... self.coop['oml'].inject("req", [pkt_id, self.coop['n_req']]) ... self.coop['oml'].inject("recv", [pkt_id, self.coop['n_recv'], str(srcip)]) ... self.coop['oml'].inject("sent", [str(pkt_id), self.coop['n_sent'], str(srcip)]) }}} [[br]] > Note: In addition to the [https://pypi.python.org/pypi/oml4py/ oml4py] module for Python, there is also the [http://rubydoc.info/gems/oml4r/ oml4r] gem for instrumenting Python applications, and a [https://mytestbed.net/projects/oml/wiki/Client_Programming C library] for C/C++ applications. There is also a [http://mytestbed.net/projects/oml/wiki/Description_of_Text_protocol text protocol] which can be used with any language. [[br]] '''[wiki:GEC16Agenda/WiMAX-Tutorial/Coop/03 Next]'''