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
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