Transaction Count

Description

Transaction count per knomi server per endpoint per month can be saved in database if server is started with necessary options. When remote database server cannot be reached, transaction counts will be stored in local filesystem database, and when remote database server is available, all saved data of local database will be sent to remote server. After this local database would be flushed to store only future transactions counts when remote database server is not reachable. As transaction counts are saved in local file system database (when remote db server is not available), the data is persistent.

A new rest server is available to access database server and generate reports. This rest server has endpoints to get knomi server’s transactions counts data and also endpoint to reset any counter.

Database Schema

remote postgres database server table ‘transactions’ have the following fields
database field names
id
server_name
year
month
endpoint
counter
local sqlite database table ‘transaction_local’ have the following fields
database field names
id
server_name
year
month
endpoint
counter

Config options for database server

Following options should be added to the config file of knomi rest server:

Example config file
   .. ..
   .. ..
   db-host=<remote db server url>
   db-user=<db server user name>
   db-pw=<db server corresponding password>
   db-name=<db name>
   db-poll-interval=<value to overwrite default 5 min>