uw-ictd / haulage

A single-node tool for measuring and logging network usage to allow billing and analysis
Mozilla Public License 2.0
22 stars 5 forks source link

Add logging of data used by services of interest #18

Closed infrared0 closed 5 years ago

infrared0 commented 5 years ago

These changes add the functionality of logging data used by services of interest, modifying the following files: haulage.sql, main.go, custom.go, internal/storage/dbface.go, and adding the file read_db.py. The script read_db.py pulls the most recent usage data from the new db table servicelogs and writes it to a tsv file; it may be run at some time interval. The services of interest are currently hardcoded in the initialization of the servicelogs table, done in haulage.sql. The following new code was added: In custom.go: FindService, LogServiceUsage In dbface.go: storage.LogServiceDB, QueryServiceIPs In main.go: inside flowHandler, code to log total usage amount In haulage.sql: code to create servicelogs table and initialize services of interest

matt9j commented 5 years ago

I'm going to close this PR to master, but incorporate these commits into a separate branch.