Module Tezos_oxymeter__.Observer
Observer modules
module Smartpower : sig ... endModule that represents the abstract communication with a smartpower through sockets.
module Blind : sig ... endModule that represents an observation without any metric returned.
module Mock : sig ... endModule to generate random number when you observe it.
type observer=|BlindReturn a report with 0 everywhere.
|MockReturn a report with random numbers. For test purpose.
|Smartpower of Smartpower.station Lwt.tReturn a report from smartpower.
Wrapper type to define the way to observe the consumption.
Interact with observer
val create : string list -> observerCreate an observer from an argument list.
The arguments can be:
or"off"for aBlindobserver."mock"for aMockobserver."power" ; host ; portfor aSmartpowerobserver on host:port.
val observe : observer -> Tezos_oxymeter.Report.t Lwt.tTakes an
observerand returns theReport.tobtained. As some observers introduces asynchronous interactions, it's wrapped into anLwt.t.
val to_string : Tezos_oxymeter.Report.t -> stringto_string reportconverts aReport.tinto a sendable string.