HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Type definition file pal.Perception by barry
expand copy to clipboardexpand
uses time.DateTime

data Metric {
	char name[]
	char sourceComponent[]
	int totalValue
	int totalCount
	bool preferHigh
	DateTime timeFirst
	DateTime timeLast
	}

data Event {
	char name[]
	char sourceComponent[]
	int totalValue
	int totalCount
	DateTime timeFirst
	DateTime timeLast
	}

data Trace {
	char content[]
	}

data PerceptionData {
	Event events[]
	Metric metrics[]
	Trace trace[]
	}

/*
{ "description" : "Accepts perception data from components and returns all perception data recorded so far." }
*/

interface Perception {
	
	/*
	{ "@description" : "Records a metric with a given name. Metrics are used to understand the current performance of a component." }
	*/
	void addMetric(char name[], int value, bool preferHigh, opt bool overwrite)
	
	/*
	{ "@description" : "Records an event with a given name. Events are used to understand the deployment environment of a component." }
	*/
	void addEvent(char name[], int value, opt bool overwrite)
	
	/*
	{ "@description" : "Records trace data that is used for additional system diagnostics, for example from an injected proxy capturing data travelling across a specific interface." }
	*/
	void addTrace(char content[])
	
	/*
	{ "@description" : "Returns all perception data recorded since the last time this function was called." }
	*/
	PerceptionData getPerception()
	
	}
Revision history
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n pal.Perception.Perception -m "reason for update" -u yourUsername
Version 1 (this version) by barry
Notes for this version: Standard Library Initialisation