Skip to content
Hari haran edited this page Aug 13, 2015 · 1 revision

There is an Agent type which represents the data as it is stored in MongoDB, while the agentOutput type represents the JSON output structure.

Currently, collections are stored as globals and are used in various handlers. This might seem like an anti pattern but it works pretty well as the program is pretty simple.

Agent has a Status() string method and not as a field in the struct as the state is calculated on-demand. If the last metric update was received less than 10 seconds ago, the agent status is online, else it is offline. (Can we make it simpler?)

We are not using the MongoDB _id, as the uid is generated by the recond running on a machine.

Clone this wiki locally