<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.openstack.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Charles+Wang</id>
		<title>OpenStack - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.openstack.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Charles+Wang"/>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/wiki/Special:Contributions/Charles_Wang"/>
		<updated>2026-07-04T16:10:57Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.28.2</generator>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=69426</id>
		<title>MagnetoDB/specs/requestmetrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=69426"/>
				<updated>2014-12-03T00:37:53Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: Undo revision 69425 by Charles Wang (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Request Real Time Metrics ===&lt;br /&gt;
&lt;br /&gt;
Real time request metrics including latency/count/etc.&lt;br /&gt;
&lt;br /&gt;
=== Specification status ===&lt;br /&gt;
Draft&lt;br /&gt;
&lt;br /&gt;
=== Problem Description ===&lt;br /&gt;
To proactively address MagnetoDB operational issues, admin user needs real time visibility to request metrics data on each API node. Including:&lt;br /&gt;
* number of requests&lt;br /&gt;
* number of failures&lt;br /&gt;
* number of errors&lt;br /&gt;
* average latency&lt;br /&gt;
* median latency&lt;br /&gt;
* minimum latency&lt;br /&gt;
* maximum latency&lt;br /&gt;
* requests per second&lt;br /&gt;
* distribution of request latency for each type of REST API call, such as &amp;quot;50%&amp;quot;,&amp;quot;66%&amp;quot;,&amp;quot;75%&amp;quot;,&amp;quot;80%&amp;quot;,&amp;quot;90%&amp;quot;,&amp;quot;95%&amp;quot;,&amp;quot;98%&amp;quot;,&amp;quot;99%&amp;quot;,&amp;quot;100%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Proposed Change ===&lt;br /&gt;
&lt;br /&gt;
Request metrics can be reported to StatsD using a sample rate for API calls. Request metrics are either counters or timing data (in units of milliseconds). &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
StatsD can be utilized to expand timing data to min, max, avg, count, and 90th percentile per timing metric. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Middleware seems a natural place to collect the request metrics data. However, if admin user needs visibility into requests to each API endpoints, we will need to capture metrics before/after each call to the API endpoints. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We propose to introduce a new middleware to all API node services, including REST API and streaming.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially we will focus on request measurements on API node wide metrics, API endpoints and WSGI processing delays on each API node. Later on, we will expand to cover Cassandra request metrics.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each REST API call made to MagnetoDB will have the following request metrics:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* request receive time&lt;br /&gt;
* request receive error&lt;br /&gt;
* request receive timeout&lt;br /&gt;
* request receive bytes&lt;br /&gt;
* response send time&lt;br /&gt;
* response send error&lt;br /&gt;
* response send timeout&lt;br /&gt;
* response send bytes&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be further broken down to API endpoints.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WSGI will have the following metrics:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* backlog&lt;br /&gt;
* waits&lt;br /&gt;
* request processing time&lt;br /&gt;
* response processing time&lt;br /&gt;
* dispatch time&lt;br /&gt;
&lt;br /&gt;
Cassandra metrics is supported by Cassandra python driver and can be enabled. But metrics data is supported through Scales.&lt;br /&gt;
&lt;br /&gt;
==== Alternatives ====&lt;br /&gt;
Scales (bundled with Cassandra Python Driver) can be used instead of StatsD.&lt;br /&gt;
&lt;br /&gt;
==== Security Impact ====&lt;br /&gt;
&lt;br /&gt;
* Does this change touch sensitive data such as tokens, keys, or user data?&lt;br /&gt;
* Does this change alter the API in a way that may impact security, such as   a new way to access sensitive information or a new way to login?&lt;br /&gt;
* Does this change involve cryptography or hashing?&lt;br /&gt;
* Does this change require the use of sudo or any elevated privileges?&lt;br /&gt;
* Does this change involve using or parsing user-provided data? This could   be directly at the API level or indirectly such as changes to a cache layer.&lt;br /&gt;
* Can this change enable a resource exhaustion attack, such as allowing a   single API interaction to consume significant server resources? Some examples   of this include launching subprocesses for each connection, or entity  expansion attacks in XML.&lt;br /&gt;
&lt;br /&gt;
==== Notifications Impact ====&lt;br /&gt;
&lt;br /&gt;
==== Other End User Impact ====&lt;br /&gt;
&lt;br /&gt;
==== Performance Impact ====&lt;br /&gt;
&lt;br /&gt;
Performance impact should be minimal since if statsd is used. The metrics sent to statsd is through UDP.&lt;br /&gt;
&lt;br /&gt;
==== Other Deployer Impact ====&lt;br /&gt;
&lt;br /&gt;
A dependency in statsd will be introduced.&lt;br /&gt;
&lt;br /&gt;
==== Developer Impact ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Implementation ====&lt;br /&gt;
&lt;br /&gt;
===== Assignee(s) =====&lt;br /&gt;
&lt;br /&gt;
Charles Wang&lt;br /&gt;
&lt;br /&gt;
===== Work Items =====&lt;br /&gt;
&lt;br /&gt;
===== Dependencies =====&lt;br /&gt;
&lt;br /&gt;
* statsd&lt;br /&gt;
&lt;br /&gt;
==== Documentation Impact ====&lt;br /&gt;
&lt;br /&gt;
==== References ====&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=69425</id>
		<title>MagnetoDB/specs/requestmetrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=69425"/>
				<updated>2014-12-03T00:33:59Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Proposed Change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Request Real Time Metrics ===&lt;br /&gt;
&lt;br /&gt;
Real time request metrics including latency/count/etc.&lt;br /&gt;
&lt;br /&gt;
=== Specification status ===&lt;br /&gt;
Draft&lt;br /&gt;
&lt;br /&gt;
=== Problem Description ===&lt;br /&gt;
To proactively address MagnetoDB operational issues, admin user needs real time visibility to request metrics data on each API node. Including:&lt;br /&gt;
* number of requests&lt;br /&gt;
* number of failures&lt;br /&gt;
* number of errors&lt;br /&gt;
* average latency&lt;br /&gt;
* median latency&lt;br /&gt;
* minimum latency&lt;br /&gt;
* maximum latency&lt;br /&gt;
* requests per second&lt;br /&gt;
* distribution of request latency for each type of REST API call, such as &amp;quot;50%&amp;quot;,&amp;quot;66%&amp;quot;,&amp;quot;75%&amp;quot;,&amp;quot;80%&amp;quot;,&amp;quot;90%&amp;quot;,&amp;quot;95%&amp;quot;,&amp;quot;98%&amp;quot;,&amp;quot;99%&amp;quot;,&amp;quot;100%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Proposed Change ===&lt;br /&gt;
&lt;br /&gt;
Request metrics can be reported to StatsD using a sample rate for API calls. Request metrics are either counters or timing data (in units of milliseconds). &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
StatsD can be utilized to expand timing data to min, max, avg, count, and 90th percentile per timing metric. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Middleware seems a natural place to collect the request metrics data. However, if admin user needs visibility into requests to each API endpoints, we will need to capture metrics before/after each call to the API endpoints. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We propose to introduce a new middleware to all API node services, including REST API and streaming.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially we will focus on request measurements on API node wide metrics, API endpoints and WSGI processing delays on each API node. Later on, we will expand to cover Cassandra request metrics.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each REST API call made to MagnetoDB will have the following request metrics:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* request receive time&lt;br /&gt;
* request receive error&lt;br /&gt;
* request receive timeout&lt;br /&gt;
* request receive bytes&lt;br /&gt;
* response send time&lt;br /&gt;
* response send error&lt;br /&gt;
* response send timeout&lt;br /&gt;
* response send bytes&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be further broken down to API endpoints.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WSGI will have the following metrics:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* backlog&lt;br /&gt;
* waits&lt;br /&gt;
* request processing time&lt;br /&gt;
* response processing time&lt;br /&gt;
* dispatch time&lt;br /&gt;
&lt;br /&gt;
Cassandra metrics is supported by Cassandra python driver and can be enabled. But metrics data is supported through Scales.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=68319</id>
		<title>MagnetoDB/specs/requestmetrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=68319"/>
				<updated>2014-11-18T19:53:36Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Request Real Time Metrics ===&lt;br /&gt;
&lt;br /&gt;
Real time request metrics including latency/count/etc.&lt;br /&gt;
&lt;br /&gt;
=== Specification status ===&lt;br /&gt;
Draft&lt;br /&gt;
&lt;br /&gt;
=== Problem Description ===&lt;br /&gt;
To proactively address MagnetoDB operational issues, admin user needs real time visibility to request metrics data on each API node. Including:&lt;br /&gt;
* number of requests&lt;br /&gt;
* number of failures&lt;br /&gt;
* number of errors&lt;br /&gt;
* average latency&lt;br /&gt;
* median latency&lt;br /&gt;
* minimum latency&lt;br /&gt;
* maximum latency&lt;br /&gt;
* requests per second&lt;br /&gt;
* distribution of request latency for each type of REST API call, such as &amp;quot;50%&amp;quot;,&amp;quot;66%&amp;quot;,&amp;quot;75%&amp;quot;,&amp;quot;80%&amp;quot;,&amp;quot;90%&amp;quot;,&amp;quot;95%&amp;quot;,&amp;quot;98%&amp;quot;,&amp;quot;99%&amp;quot;,&amp;quot;100%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Proposed Change ===&lt;br /&gt;
&lt;br /&gt;
Request metrics can be reported to StatsD per API call. Request metrics are either counters or timing data (in units of milliseconds). &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
StatsD can be utilized to expand timing data to min, max, avg, count, and 90th percentile per timing metric. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Middleware seems a natural place to collect the request metrics data. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We propose to introduce a new middleware to all API node services, including api/streaming/task executor.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially we will focus on request measurements on API endpoint, WSGI processing delay, and Cassandra request metrics.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each API endpoint will have the following request metrics:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* request receive time&lt;br /&gt;
* request receive error&lt;br /&gt;
* request receive timeout&lt;br /&gt;
* request receive bytes&lt;br /&gt;
* response send time&lt;br /&gt;
* response send error&lt;br /&gt;
* response send timeout&lt;br /&gt;
* response send bytes&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WSGI will have the following metrics:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* backlog&lt;br /&gt;
* waits&lt;br /&gt;
* request processing time&lt;br /&gt;
* response processing time&lt;br /&gt;
* dispatch time&lt;br /&gt;
&lt;br /&gt;
Cassandra metrics is supported by Cassandra python driver and can be enabled. But metrics data is supported through Scales.&lt;br /&gt;
&lt;br /&gt;
==== Alternatives ====&lt;br /&gt;
Scales (bundled with Cassandra Python Driver) can be used instead of StatsD.&lt;br /&gt;
&lt;br /&gt;
==== Security Impact ====&lt;br /&gt;
&lt;br /&gt;
* Does this change touch sensitive data such as tokens, keys, or user data?&lt;br /&gt;
* Does this change alter the API in a way that may impact security, such as   a new way to access sensitive information or a new way to login?&lt;br /&gt;
* Does this change involve cryptography or hashing?&lt;br /&gt;
* Does this change require the use of sudo or any elevated privileges?&lt;br /&gt;
* Does this change involve using or parsing user-provided data? This could   be directly at the API level or indirectly such as changes to a cache layer.&lt;br /&gt;
* Can this change enable a resource exhaustion attack, such as allowing a   single API interaction to consume significant server resources? Some examples   of this include launching subprocesses for each connection, or entity  expansion attacks in XML.&lt;br /&gt;
&lt;br /&gt;
==== Notifications Impact ====&lt;br /&gt;
&lt;br /&gt;
==== Other End User Impact ====&lt;br /&gt;
&lt;br /&gt;
==== Performance Impact ====&lt;br /&gt;
&lt;br /&gt;
Performance impact should be minimal since if statsd is used. The metrics sent to statsd is through UDP.&lt;br /&gt;
&lt;br /&gt;
==== Other Deployer Impact ====&lt;br /&gt;
&lt;br /&gt;
A dependency in statsd will be introduced.&lt;br /&gt;
&lt;br /&gt;
==== Developer Impact ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Implementation ====&lt;br /&gt;
&lt;br /&gt;
===== Assignee(s) =====&lt;br /&gt;
&lt;br /&gt;
Charles Wang&lt;br /&gt;
&lt;br /&gt;
===== Work Items =====&lt;br /&gt;
&lt;br /&gt;
===== Dependencies =====&lt;br /&gt;
&lt;br /&gt;
* statsd&lt;br /&gt;
&lt;br /&gt;
==== Documentation Impact ====&lt;br /&gt;
&lt;br /&gt;
==== References ====&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=68318</id>
		<title>MagnetoDB/specs/requestmetrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=68318"/>
				<updated>2014-11-18T19:22:49Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Proposed Change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Request Real Time Metrics ===&lt;br /&gt;
&lt;br /&gt;
Real time request metrics including latency/count/etc.&lt;br /&gt;
&lt;br /&gt;
=== Specification status ===&lt;br /&gt;
Draft&lt;br /&gt;
&lt;br /&gt;
=== Problem Description ===&lt;br /&gt;
To proactively address MagnetoDB operational issues, admin user needs real time visibility to request metrics data on each API node. Including:&lt;br /&gt;
* number of requests&lt;br /&gt;
* number of failures&lt;br /&gt;
* number of errors&lt;br /&gt;
* average latency&lt;br /&gt;
* median latency&lt;br /&gt;
* minimum latency&lt;br /&gt;
* maximum latency&lt;br /&gt;
* requests per second&lt;br /&gt;
* distribution of request latency for each type of REST API call, such as &amp;quot;50%&amp;quot;,&amp;quot;66%&amp;quot;,&amp;quot;75%&amp;quot;,&amp;quot;80%&amp;quot;,&amp;quot;90%&amp;quot;,&amp;quot;95%&amp;quot;,&amp;quot;98%&amp;quot;,&amp;quot;99%&amp;quot;,&amp;quot;100%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Proposed Change ===&lt;br /&gt;
&lt;br /&gt;
Request metrics can be reported to StatsD per API call. Request metrics are either counters or timing data (in units of milliseconds). &lt;br /&gt;
&lt;br /&gt;
StatsD can be utilized to expand timing data to min, max, avg, count, and 90th percentile per timing metric. &lt;br /&gt;
&lt;br /&gt;
Middleware seems a natural place to collect the request metrics data. &lt;br /&gt;
&lt;br /&gt;
We propose to introduce a new middleware to all API node services, including api/streaming/task executor. Each category of REST APIs will have a corresponding request metrics.&lt;br /&gt;
&lt;br /&gt;
==== Alternatives ====&lt;br /&gt;
Scales (bundled with Cassandra Python Driver) can be used instead of StatsD.&lt;br /&gt;
&lt;br /&gt;
==== Security Impact ====&lt;br /&gt;
&lt;br /&gt;
* Does this change touch sensitive data such as tokens, keys, or user data?&lt;br /&gt;
* Does this change alter the API in a way that may impact security, such as   a new way to access sensitive information or a new way to login?&lt;br /&gt;
* Does this change involve cryptography or hashing?&lt;br /&gt;
* Does this change require the use of sudo or any elevated privileges?&lt;br /&gt;
* Does this change involve using or parsing user-provided data? This could   be directly at the API level or indirectly such as changes to a cache layer.&lt;br /&gt;
* Can this change enable a resource exhaustion attack, such as allowing a   single API interaction to consume significant server resources? Some examples   of this include launching subprocesses for each connection, or entity  expansion attacks in XML.&lt;br /&gt;
&lt;br /&gt;
==== Notifications Impact ====&lt;br /&gt;
&lt;br /&gt;
==== Other End User Impact ====&lt;br /&gt;
&lt;br /&gt;
==== Performance Impact ====&lt;br /&gt;
&lt;br /&gt;
Performance impact should be minimal since if statsd is used. The metrics sent to statsd is through UDP.&lt;br /&gt;
&lt;br /&gt;
==== Other Deployer Impact ====&lt;br /&gt;
&lt;br /&gt;
A dependency in statsd will be introduced.&lt;br /&gt;
&lt;br /&gt;
==== Developer Impact ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Implementation ====&lt;br /&gt;
&lt;br /&gt;
===== Assignee(s) =====&lt;br /&gt;
&lt;br /&gt;
Charles Wang&lt;br /&gt;
&lt;br /&gt;
===== Work Items =====&lt;br /&gt;
&lt;br /&gt;
===== Dependencies =====&lt;br /&gt;
&lt;br /&gt;
* statsd&lt;br /&gt;
&lt;br /&gt;
==== Documentation Impact ====&lt;br /&gt;
&lt;br /&gt;
==== References ====&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=68306</id>
		<title>MagnetoDB/specs/requestmetrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=68306"/>
				<updated>2014-11-18T18:46:49Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Request Real Time Metrics ===&lt;br /&gt;
&lt;br /&gt;
Real time request metrics including latency/count/etc.&lt;br /&gt;
&lt;br /&gt;
=== Specification status ===&lt;br /&gt;
Draft&lt;br /&gt;
&lt;br /&gt;
=== Problem Description ===&lt;br /&gt;
To proactively address MagnetoDB operational issues, admin user needs real time visibility to request metrics data on each API node. Including:&lt;br /&gt;
* number of requests&lt;br /&gt;
* number of failures&lt;br /&gt;
* number of errors&lt;br /&gt;
* average latency&lt;br /&gt;
* median latency&lt;br /&gt;
* minimum latency&lt;br /&gt;
* maximum latency&lt;br /&gt;
* requests per second&lt;br /&gt;
* distribution of request latency for each type of REST API call, such as &amp;quot;50%&amp;quot;,&amp;quot;66%&amp;quot;,&amp;quot;75%&amp;quot;,&amp;quot;80%&amp;quot;,&amp;quot;90%&amp;quot;,&amp;quot;95%&amp;quot;,&amp;quot;98%&amp;quot;,&amp;quot;99%&amp;quot;,&amp;quot;100%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Proposed Change ===&lt;br /&gt;
&lt;br /&gt;
==== Alternatives ====&lt;br /&gt;
&lt;br /&gt;
==== Security Impact ====&lt;br /&gt;
&lt;br /&gt;
* Does this change touch sensitive data such as tokens, keys, or user data?&lt;br /&gt;
* Does this change alter the API in a way that may impact security, such as   a new way to access sensitive information or a new way to login?&lt;br /&gt;
* Does this change involve cryptography or hashing?&lt;br /&gt;
* Does this change require the use of sudo or any elevated privileges?&lt;br /&gt;
* Does this change involve using or parsing user-provided data? This could   be directly at the API level or indirectly such as changes to a cache layer.&lt;br /&gt;
* Can this change enable a resource exhaustion attack, such as allowing a   single API interaction to consume significant server resources? Some examples   of this include launching subprocesses for each connection, or entity  expansion attacks in XML.&lt;br /&gt;
&lt;br /&gt;
==== Notifications Impact ====&lt;br /&gt;
&lt;br /&gt;
==== Other End User Impact ====&lt;br /&gt;
&lt;br /&gt;
==== Performance Impact ====&lt;br /&gt;
&lt;br /&gt;
Performance impact should be minimal since if statsd is used. The metrics sent to statsd is through UDP.&lt;br /&gt;
&lt;br /&gt;
==== Other Deployer Impact ====&lt;br /&gt;
&lt;br /&gt;
A dependency in statsd will be introduced.&lt;br /&gt;
&lt;br /&gt;
==== Developer Impact ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Implementation ====&lt;br /&gt;
&lt;br /&gt;
===== Assignee(s) =====&lt;br /&gt;
&lt;br /&gt;
Charles Wang&lt;br /&gt;
&lt;br /&gt;
===== Work Items =====&lt;br /&gt;
&lt;br /&gt;
===== Dependencies =====&lt;br /&gt;
&lt;br /&gt;
* statsd&lt;br /&gt;
&lt;br /&gt;
==== Documentation Impact ====&lt;br /&gt;
&lt;br /&gt;
==== References ====&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=68302</id>
		<title>MagnetoDB/specs/requestmetrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/requestmetrics&amp;diff=68302"/>
				<updated>2014-11-18T18:32:11Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: MagnetoDB Request Metrics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To proactively address MagnetoDB operational issues, admin user needs real time visibility to request metrics data on each API node. Including:&lt;br /&gt;
number of requests&lt;br /&gt;
number of failures&lt;br /&gt;
number of errors&lt;br /&gt;
average latency&lt;br /&gt;
median latency&lt;br /&gt;
minimum latency&lt;br /&gt;
maximum latency&lt;br /&gt;
requests per second&lt;br /&gt;
distribution of request latency for each type of REST API call, such as &amp;quot;50%&amp;quot;,&amp;quot;66%&amp;quot;,&amp;quot;75%&amp;quot;,&amp;quot;80%&amp;quot;,&amp;quot;90%&amp;quot;,&amp;quot;95%&amp;quot;,&amp;quot;98%&amp;quot;,&amp;quot;99%&amp;quot;,&amp;quot;100%&amp;quot;&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53861</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53861"/>
				<updated>2014-05-27T21:39:45Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes. This specification defines the notifications that can be used to generate events and aggregate metrics data.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on notifications of table/data item CRUD activities, and the notification mechanism. The monitoring tools and metering metrics will be deferred to later, possibly integrating with Ceilometer.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
* immediate notification&lt;br /&gt;
Event is created when a specific increment of usage occurs (such as creation of an table) and notification is sent to notifier immediately&lt;br /&gt;
* periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events =====&lt;br /&gt;
The data item events are generated for data item CRUD operations. They have all common attributes of standard MagnetoDB events. In addition, details of read/write operations, such as number of rows impacted, consistency level used, will be in the payload.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.data.getitem'''&lt;br /&gt;
* '''magnetodb.data.putitem'''&lt;br /&gt;
* '''magnetodb.data.updateitem'''&lt;br /&gt;
* '''magnetodb.data.deleteitem'''&lt;br /&gt;
* '''magnetodb.data.query,start/.end'''&lt;br /&gt;
* '''magnetodb.data.scan,start/.end'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
* Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
* AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
* AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
* No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
* Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53779</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53779"/>
				<updated>2014-05-27T14:59:43Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes. This specification defines the notifications that can be used to generate events and aggregate metrics data.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
* immediate notification&lt;br /&gt;
Event is created when a specific increment of usage occurs (such as creation of an table) and notification is sent to notifier immediately&lt;br /&gt;
* periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events =====&lt;br /&gt;
The data item events are generated for data item CRUD operations. They have all common attributes of standard MagnetoDB events. In addition, details of read/write operations, such as number of rows impacted, consistency level used, will be in the payload.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.data.getitem'''&lt;br /&gt;
* '''magnetodb.data.putitem'''&lt;br /&gt;
* '''magnetodb.data.updateitem'''&lt;br /&gt;
* '''magnetodb.data.deleteitem'''&lt;br /&gt;
* '''magnetodb.data.query,start/.end'''&lt;br /&gt;
* '''magnetodb.data.scan,start/.end'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
* Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
* AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
* AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
* No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
* Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53349</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53349"/>
				<updated>2014-05-23T15:45:33Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Design and Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
* immediate notification&lt;br /&gt;
Event is created when a specific increment of usage occurs (such as creation of an table) and notification is sent to notifier immediately&lt;br /&gt;
* periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events =====&lt;br /&gt;
The data item events are generated for data item CRUD operations. They have all common attributes of standard MagnetoDB events. In addition, details of read/write operations, such as number of rows impacted, consistency level used, will be in the payload.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.data.getitem'''&lt;br /&gt;
* '''magnetodb.data.putitem'''&lt;br /&gt;
* '''magnetodb.data.updateitem'''&lt;br /&gt;
* '''magnetodb.data.deleteitem'''&lt;br /&gt;
* '''magnetodb.data.query,start/.end'''&lt;br /&gt;
* '''magnetodb.data.scan,start/.end'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
* Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
* AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
* AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
* No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
* Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53342</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53342"/>
				<updated>2014-05-23T15:04:33Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Table Events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events =====&lt;br /&gt;
The data item events are generated for data item CRUD operations. They have all common attributes of standard MagnetoDB events. In addition, details of read/write operations, such as number of rows impacted, consistency level used, will be in the payload.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.data.getitem'''&lt;br /&gt;
* '''magnetodb.data.putitem'''&lt;br /&gt;
* '''magnetodb.data.updateitem'''&lt;br /&gt;
* '''magnetodb.data.deleteitem'''&lt;br /&gt;
* '''magnetodb.data.query,start/.end'''&lt;br /&gt;
* '''magnetodb.data.scan,start/.end'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
* Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
* AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
* AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
* No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
* Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53341</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53341"/>
				<updated>2014-05-23T14:56:31Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Data Item Events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events =====&lt;br /&gt;
The data item events are generated for data item CRUD operations. They have all common attributes of standard MagnetoDB events. In addition, details of read/write operations, such as number of rows impacted, consistency level used, will be in the payload.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.data.getitem'''&lt;br /&gt;
* '''magnetodb.data.putitem'''&lt;br /&gt;
* '''magnetodb.data.updateitem'''&lt;br /&gt;
* '''magnetodb.data.deleteitem'''&lt;br /&gt;
* '''magnetodb.data.query,start/.end'''&lt;br /&gt;
* '''magnetodb.data.scan,start/.end'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
* Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
* AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
* AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
* No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
* Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53339</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53339"/>
				<updated>2014-05-23T14:51:21Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Notification Drivers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events =====&lt;br /&gt;
These are generated for operations monitoring/profiling purposes and shouldn't directly affect usage/billing. They all follow the same signature as the above calls. Some of these notifications may be called from the above operations (for example, shutdown from delete).&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.data.getitem'''&lt;br /&gt;
* '''magnetodb.data.putitem'''&lt;br /&gt;
* '''magnetodb.data.updateitem'''&lt;br /&gt;
* '''magnetodb.data.deleteitem'''&lt;br /&gt;
* '''magnetodb.data.query,start/.end'''&lt;br /&gt;
* '''magnetodb.data.scan,start/.end'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
* Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
* AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
* AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
* No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
* Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53337</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53337"/>
				<updated>2014-05-23T14:50:11Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Data Item Events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events =====&lt;br /&gt;
These are generated for operations monitoring/profiling purposes and shouldn't directly affect usage/billing. They all follow the same signature as the above calls. Some of these notifications may be called from the above operations (for example, shutdown from delete).&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.data.getitem'''&lt;br /&gt;
* '''magnetodb.data.putitem'''&lt;br /&gt;
* '''magnetodb.data.updateitem'''&lt;br /&gt;
* '''magnetodb.data.deleteitem'''&lt;br /&gt;
* '''magnetodb.data.query,start/.end'''&lt;br /&gt;
* '''magnetodb.data.scan,start/.end'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
- Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
- AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
- AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
- No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
- Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53336</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53336"/>
				<updated>2014-05-23T14:49:42Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Data Item Events = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events =====&lt;br /&gt;
These are generated for operations monitoring/profiling purposes and shouldn't directly affect usage/billing. They all follow the same signature as the above calls. Some of these notifications may be called from the above operations (for example, shutdown from delete).&lt;br /&gt;
&lt;br /&gt;
'''magnetodb.data.getitem'''&lt;br /&gt;
'''magnetodb.data.putitem'''&lt;br /&gt;
'''magnetodb.data.updateitem'''&lt;br /&gt;
'''magnetodb.data.deleteitem'''&lt;br /&gt;
'''magnetodb.data.query,start/.end'''&lt;br /&gt;
'''magnetodb.data.scan,start/.end'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
- Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
- AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
- AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
- No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
- Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53335</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53335"/>
				<updated>2014-05-23T14:48:42Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Detailed Event Types and Payload data: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* '''magnetodb.table.create.{start,error,end}''':&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.delete.start/.end''':&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* '''magnetodb.table.usage''':&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events ======&lt;br /&gt;
These are generated for operations monitoring/profiling purposes and shouldn't directly affect usage/billing. They all follow the same signature as the above calls. Some of these notifications may be called from the above operations (for example, shutdown from delete).&lt;br /&gt;
&lt;br /&gt;
'''magnetodb.data.getitem&lt;br /&gt;
magnetodb.data.putitem&lt;br /&gt;
magnetodb.data.updateitem&lt;br /&gt;
magnetodb.data.deleteitem&lt;br /&gt;
magnetodb.data.query,start/.end&lt;br /&gt;
magnetodb.data.scan,start/.end&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
- Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
- AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
- AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
- No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
- Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53333</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53333"/>
				<updated>2014-05-23T14:44:37Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Event Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* - magnetodb.table.create.{start,error,end}:&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* - magnetodb.table.delete.start/.end:&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* - magnetodb.table.usage:&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events ======&lt;br /&gt;
These are generated for operations monitoring/profiling purposes and shouldn't directly affect usage/billing. They all follow the same signature as the above calls. Some of these notifications may be called from the above operations (for example, shutdown from delete).&lt;br /&gt;
&lt;br /&gt;
magnetodb.data.getitem&lt;br /&gt;
magnetodb.data.putitem&lt;br /&gt;
magnetodb.data.updateitem&lt;br /&gt;
magnetodb.data.deleteitem&lt;br /&gt;
magnetodb.data.query,start/.end&lt;br /&gt;
magnetodb.data.scan,start/.end&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
- Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
- AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
- AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
- No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
- Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53329</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53329"/>
				<updated>2014-05-23T14:35:56Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* Event Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
* priority&lt;br /&gt;
* timestamp&lt;br /&gt;
* event_type&lt;br /&gt;
* tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* - magnetodb.table.create.{start,error,end}:&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* - magnetodb.table.delete.start/.end:&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* - magnetodb.table.usage:&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events ======&lt;br /&gt;
These are generated for operations monitoring/profiling purposes and shouldn't directly affect usage/billing. They all follow the same signature as the above calls. Some of these notifications may be called from the above operations (for example, shutdown from delete).&lt;br /&gt;
&lt;br /&gt;
magnetodb.data.getitem&lt;br /&gt;
magnetodb.data.putitem&lt;br /&gt;
magnetodb.data.updateitem&lt;br /&gt;
magnetodb.data.deleteitem&lt;br /&gt;
magnetodb.data.query,start/.end&lt;br /&gt;
magnetodb.data.scan,start/.end&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
- Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
- AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
- AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
- No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
- Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53327</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53327"/>
				<updated>2014-05-23T14:33:34Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: /* MagnetoDB System Events and Notification Mechanism */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Summary =&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
= User Stories =&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
= Design and Implementation =&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
== Event Design ==&lt;br /&gt;
=== Event Attributes ===&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
- priority&lt;br /&gt;
- timestamp&lt;br /&gt;
- event_type&lt;br /&gt;
- tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Event Types ===&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
==== Detailed Event Types and Payload data: ====&lt;br /&gt;
&lt;br /&gt;
===== Table Events =====&lt;br /&gt;
* - magnetodb.table.create.{start,error,end}:&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* - magnetodb.table.delete.start/.end:&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
* - magnetodb.table.usage:&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
===== Data Item Events ======&lt;br /&gt;
These are generated for operations monitoring/profiling purposes and shouldn't directly affect usage/billing. They all follow the same signature as the above calls. Some of these notifications may be called from the above operations (for example, shutdown from delete).&lt;br /&gt;
&lt;br /&gt;
magnetodb.data.getitem&lt;br /&gt;
magnetodb.data.putitem&lt;br /&gt;
magnetodb.data.updateitem&lt;br /&gt;
magnetodb.data.deleteitem&lt;br /&gt;
magnetodb.data.query,start/.end&lt;br /&gt;
magnetodb.data.scan,start/.end&lt;br /&gt;
&lt;br /&gt;
=== Enable/Diable Notifications ===&lt;br /&gt;
&lt;br /&gt;
=== Notification Drivers ===&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
- Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
- AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
- AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
- No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
- Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53326</id>
		<title>MagnetoDB/specs/notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=MagnetoDB/specs/notification&amp;diff=53326"/>
				<updated>2014-05-23T14:29:20Z</updated>
		
		<summary type="html">&lt;p&gt;Charles Wang: MagnetoDB System Events and Notification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= MagnetoDB System Events and Notification Mechanism =&lt;br /&gt;
== Summary ==&lt;br /&gt;
MagnetoDB administrators want data on user usage for monitoring, capacity planning, billing, and chargeback purposes.&lt;br /&gt;
&lt;br /&gt;
== User Stories ==&lt;br /&gt;
The use case this blueprint tries to address: MongnetoDB administrators want to see user usage data including table creation/delete, data item put/delete/update/retrieval, aggregated into a graph of the total amount of reads, writes, and storage used by all services broken down by domain and project, in order to determine service health, project capacity and billing/chargeback needs. &lt;br /&gt;
&lt;br /&gt;
Initially we will focus on table/data item CRUD events, and event notification mechanism.&lt;br /&gt;
&lt;br /&gt;
== Design and Implementation ==&lt;br /&gt;
MagnetoDB system usage data is emitted in the form of usage events from using Oslo Messaging's Notifier component. Notifier is an Oslo incubator project right now. We will use Oslo Notifier to emit events through logging, or send them to a series of AMQP queues (one queue per notification priority), such as table and data item CRUD events. Different types of usage events are distinguished via the notifications' event_type, which is a hierarchical dotted string such as magnetodb.table.create. This way user usage data can be easily grouped for aggregation. &lt;br /&gt;
&lt;br /&gt;
Notifications can be delivered immediately or periodically:&lt;br /&gt;
- immediate notification&lt;br /&gt;
Notification is created when a specific increment of usage occurs (such as creation of an table)&lt;br /&gt;
- periodic notification&lt;br /&gt;
Notification is generated by a periodic task, like a cron job, covering usage data for a certain period of time. &lt;br /&gt;
&lt;br /&gt;
=== Event Design ===&lt;br /&gt;
==== Event Attributes ====&lt;br /&gt;
All MagnetoDB events contain the following attributes:&lt;br /&gt;
- priority&lt;br /&gt;
- timestamp&lt;br /&gt;
- event_type&lt;br /&gt;
- tenant_id&lt;br /&gt;
&lt;br /&gt;
The tenant_id is the same as the tenant_id concept in Keystone.&lt;br /&gt;
&lt;br /&gt;
Beside the standard MagnetoDB event attributes, usage events contain a payload of data that will vary depending on the event_type. This is presented as a json-formatted hash of key-value pairs. Some of the keys, such as tenant_id will always be present in any event, others will be data relevant to that event_type (For example, table related notifications will contain data describing the table.)&lt;br /&gt;
&lt;br /&gt;
MagnetoDB events follow the format below:&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Note that MagnetoDB itself should not be concerned with billing/charge-backs, but it needs to present a feed of usage data that an external application could use to aggregate the billing data for a requested time period.&lt;br /&gt;
&lt;br /&gt;
Also note that user usage data is for the local MagnetoDB server only, and that data must be aggregated across all MagnetoDB servers to have a full view of the cluster wide usage data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Event Types ====&lt;br /&gt;
For a simple and short activity, events are only generated when the activity completes or when error happens.&lt;br /&gt;
For a lengthy or asynchronous activity, there are two events generated: an event when the activity starts, and when the activity ends. The events are in the format of:&lt;br /&gt;
    magnetodb.table.&amp;lt;activity&amp;gt;.start' and 'magnetodb.table.&amp;lt;activity&amp;gt;.end'.&lt;br /&gt;
If error happens, instead of .end event, a .error event will be emitted.&lt;br /&gt;
&lt;br /&gt;
Detailed Event Types and Payload data:&lt;br /&gt;
&lt;br /&gt;
- Table Events&lt;br /&gt;
magnetodb.table.create.{start,error,end}:&lt;br /&gt;
&lt;br /&gt;
{'message_id': str(uuid.uuid4()),&lt;br /&gt;
 'publisher_id': 'magnetodb.host1',&lt;br /&gt;
 'timestamp': timeutils.utcnow(),&lt;br /&gt;
 'priority': 'INFO',&lt;br /&gt;
 'event_type': 'magnetodb.table.create',&lt;br /&gt;
 'tenant_id': user_default_tenant,&lt;br /&gt;
 'payload': {'schema': ... }}.&lt;br /&gt;
&lt;br /&gt;
Notification upon creation of a new user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;create.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
magnetodb.table.delete.start/.end:&lt;br /&gt;
&lt;br /&gt;
Notification upon deletion of a user table.&lt;br /&gt;
tenant_id: Tenant ID that owns the this user table (string)&lt;br /&gt;
user_id: User ID that owns this user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for this user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;delete.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
magnetodb.table.usage:&lt;br /&gt;
&lt;br /&gt;
There is no .start/.end event for this activity ... just the 'magnetodb.table.usage' event.&lt;br /&gt;
&lt;br /&gt;
Periodic usage notification generated by the magnetodb-table-usage-audit cron job. These usages are generated for each user table (including secondary indexes) that was active during the specified audit period.&lt;br /&gt;
tenant_id: Tenant ID that owns the the user table (string)&lt;br /&gt;
user_id: User ID that owns the user table (string)&lt;br /&gt;
table_name: user table name (string)&lt;br /&gt;
table_schema: user table schema (string)&lt;br /&gt;
state: user table status. (string, such as 'active' or 'deleting', 'creating', 'not_exist')&lt;br /&gt;
disk_gb: disk allocation for the user table (in gb)&lt;br /&gt;
message: High-level message describing the notification. If the event type is &amp;quot;usage.error&amp;quot;, it will contain error details.&lt;br /&gt;
&lt;br /&gt;
This notification is disabled by default.&lt;br /&gt;
&lt;br /&gt;
- Data Item Events&lt;br /&gt;
These are generated for operations monitoring/profiling purposes and shouldn't directly affect usage/billing. They all follow the same signature as the above calls. Some of these notifications may be called from the above operations (for example, shutdown from delete).&lt;br /&gt;
&lt;br /&gt;
magnetodb.data.getitem&lt;br /&gt;
magnetodb.data.putitem&lt;br /&gt;
magnetodb.data.updateitem&lt;br /&gt;
magnetodb.data.deleteitem&lt;br /&gt;
magnetodb.data.query,start/.end&lt;br /&gt;
magnetodb.data.scan,start/.end&lt;br /&gt;
&lt;br /&gt;
Enable/Diable Notifications&lt;br /&gt;
&lt;br /&gt;
Notification Drivers&lt;br /&gt;
Different notification drivers can be plugged in to define different notifiers. By default, the Log notifier will be used. Some pre-defined notifiers include:&lt;br /&gt;
- Log&lt;br /&gt;
Log notifier uses MagnetoDB's default logging system&lt;br /&gt;
- AMQP queues/RPC&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. &lt;br /&gt;
- AMQP queues/RPC with message envelop&lt;br /&gt;
RPC notifier uses AMQP (rabbitmq) queues to send events. The only difference between the above one and this one is the message envelop.&lt;br /&gt;
- No-OP&lt;br /&gt;
No-OP notifier doesn't do anything&lt;br /&gt;
- Test&lt;br /&gt;
Test notifier stores notification events in memory. This is convenient for unit test purpose.&lt;/div&gt;</summary>
		<author><name>Charles Wang</name></author>	</entry>

	</feed>