Event Builder REST

Name

Event Builder REST -- Event Builder Statistics REST Protocol

Synopsis


/statistics/inputstats
/statistics/queue
/statistics/outputstats
/statistics/barrierstats
/statistics/completebarrierdetails
/statistics/incompletebarrierdetails
/statistics/datalatestatistics
/statistics/oostatistics
/statistics/connections
/statistics/flowcontrol
/statistics/shutdown
      

DESCRIPTION

The Orderer stage of the the event builder can be run with a REST interface to its internal statistics through the EVBREST package, which starts the server and EVBStatistics package which maintains statistics for the server in an easy to manage set of dicts.

The server advertises the service ORDERER_REST by default. The service name can be modified by defining the SERVICE_NAME environment variable or the Tcl global variable ServiceName prior to starting including the EVBREST package.

All REST requests have URLs of the form http://hostname:port/statistics/request where hostname is the name of the host in which the event builder is running, port is the port number of the server as translated from its advertised service name and request identifies the request.

Successful returns produce a JSON encoded object (mimetype application/json). The remainder of this manpage describes the requests and the JSON object returned by each of them.

All of these objects have two common attributes; status which has the string value OK on success or ERROR on failure and message which is an empty string if status was OK or a human readable error string if not.

/status/inputstats

Returns input statistics. The additional attributes returned are:

oldest

Oldest queued fragment timestamp.

newest

Newest queued fragment timestamp.

fragments

Number of in-flight fragments in the orderer.

/status/queue

Returns information about all of the queues. Each data source id has an associated queue into which its fragments go until they can be emitted. The JSON attribute queues contains information about each queue. The value of this attribute is a JSON array of objects. Each of the objects in the array has the following attributes:

id

The source id of the queue described by this object.

depth

The number of fragments currently in that queue.

olddest

The timestamp of the oldest fragment in this queue (the queue head).

bytes

The number of bytes of data in this queue.

dequeued

The total number of bytes of data that have been dequeued from this queue since the event builder started.

totalqueued

The total number of bytes of data that have ever been sent to this queue.

/statistics/outputstats

This request provides output statistics. The resulting object has two attributes: fragments and perqueue

The fragments value is just the total number of fragments that have been output from the orderer.

The perqueue value is a bit more complex. It is a JSON array of JSON objects that provide output statistics from the event queues. Each object in the array contains the following attributes:

id

The source id associated with the output statistics in this object.

fragments

The number of fragments outupt from this queue.

/status/barrierstats

Provides an overview of the barrier statistics from the event bulder orderer stage. The data are returned in two attributes: complete which provides statistics for complete (successful) barriers and incomplete which provides statistics for incomplete (failed) barriers. The values of these attributes are JSON encoded objects as well. Both objects have the same attributes:

barriers

Number of barriers of this type (complete or incomplete).

homogeneous

Number of barriers that were complete or not but whose fragments all had the same barrier type.

heterogeneous

Number of barriers that were complete or not but whose fragments had more than one barrier type.

/statistics/completebarrierdetails

Returns more detailed statistics about the complete (successful) barriers. The returned object has the two attributes: bytype which provides statistics by barrier type and bySource which provides statistics by data source. The values of both of these are arrays of objects.

bytype array element object attributes

type

Contains a barrier type.

count

Contains a count of the number of times a fragment with that barrier type has been seen.

bySource array element object attributes

id

Source id this object provides statistics for.

count

Total number of barrier fragments from that source.

details

Array of objects that have attributes: type - a barrier type and count - the number of times that barrier type has been see in in that source id's queue.

/statistics/incompletebarrierdetails Detailed Incomplete Barrier Statistics

Provides detailed statistics for incomplete barriers. An incomplete barrier is a failure of barrier synchronization. The statistics for these events are captured in data in the following two attributes: histogram which captures a histogram of number of missing fragments and bysource whichcaptures per source statistics. Both of these attributes contain list of JSON objects:

histogram Array Element Attributes

number

Number of missing fragments.

count

Number of times that number of fragments was missing.

bysource Array Element Attributes

id

Source id

count

Number of times that source id was among the missing sources in a barrier synchronization.

/statistics/datalatestatistics Data Late Statistics

Provides statistics that describe the data late conditions detected by the orderer. This provides the following attributes:

count

Total number of data late conditions.

worst

Worst case time stamp difference.

details

An array of objects that provide per source data late statistics. Each object has the attributes: id the data source id, count the number of times the source has had a data late condition. and worst the worst case timestamp deviation for that source.

/statistics/oostatistics Out of Order Statistics

Provide information about out of order statistics. This object has two attributes: summary providing summary statistics and bysource providing per source statistics.

The summary attribute contains an objec with the attribues count - the number of out of order fragments, prior the timestamp of the fragment prior to the most recent out of order fragment and offending the timestamp of the most recent out of order fragments.

bysource contains an array that provides per source statistics. Each element has the id attribute which is the source id and the attributs in summary which, in this case are confined to the specific data source.

/statistics/connections Connection List

Data are fed to the event orderer via TCP/IP block transfer connections. This request provides an object with the connections attribute. The value of connections is an array of objects. The attributes of each object describe one connection:

host

Name or IP of host from which the connection was made.

description

A textual description of the connection supplied by the client.

state

Textual connection state.

idle

Boolean idle flag. If nonzero, the connection has been idel.

/status/flowcontrol Flow Control State

The object returned has the atribute state which is non-zero if the even builder is asserting flow control to its clients.

/status/shutdown Shutdown Event Builder (POST)

This request will shutdown the event builder. The request must be issued using a POST request. At present a fixed delay is used to shut down the event builder. In the future, the POST parameter delay will be the delay in seconds.