Lately, SlapOS has been improving a lot on the accounting and billing frontline.
Progress on accounting and billing can be tracked in the on the slapos.core repository, in the "usage_report" branch:
This branch includes unit tests which check that the collection of usage reports - the key for further accounting and billing - is implemented as expected on the SlapOS Master side. The main unit test asserts that XML accounting and metering data which is sent to SlapOS Master can be imported without information loss into SlapOS master. Following the typical ERP5ish approach of "fixed point" data integration based, inspired by SyncML, imported data in XML format is compared to the already present data which itself is exported in XML format. Whenever the two match, we have a so-called "fixed point" which demonstrates that the data integration process is reliable.
The unit test which implements fixed point data integration can be found here:
A typical example of XML data which is used to exchange accounting and metering data is also available:
Accounting and metering data is based on an XML schema descibed here:
In a short distance future, JSON schema will also be support and JSON data will become the default option for accounting and metering information.
SlapOS includes a utility called "monitor" to implement process accounting and metering. It is part of slapos.toolbox repository. This utility tracks the memory and CPU usage of a group of processes. It is used in particular to track how much CPU and memory a KVM virtual machine instance uses. It could also be used to track similar information for a database (ex. MariaDB) or for a front-end process (ex. Apache). The "usage_report" branch includes its own version of the monitor utility:
The monitor tool is what is used in a typical SlapOS setup to generate the accounting and metering information which is then imported into SlapOS Master. Based on this information, SlapOS Master generated so-called "Packing Lists" which are the standard ERP5 object to represent the actual delivery of goods or services. Through ERP5 simulation, invoices can be generated automatically based on pricing information and pricing rules. This part is implemented but not yet fully tested.
This report was written by Seb and Jean-Paul.