[asterisk-commits] eliel: branch group/data_api_gsoc2009 r204408 - /team/group/data_api_gsoc2009...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jun 30 11:09:02 CDT 2009
Author: eliel
Date: Tue Jun 30 11:08:59 2009
New Revision: 204408
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=204408
Log:
Simple benchmark.
Modified:
team/group/data_api_gsoc2009/tests/test_data.c
Modified: team/group/data_api_gsoc2009/tests/test_data.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/tests/test_data.c?view=diff&rev=204408&r1=204407&r2=204408
==============================================================================
--- team/group/data_api_gsoc2009/tests/test_data.c (original)
+++ team/group/data_api_gsoc2009/tests/test_data.c Tue Jun 30 11:08:59 2009
@@ -78,6 +78,12 @@
static char *handle_cli_data_get_bench(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
+ struct ast_data_query query = {
+ .path = "test",
+ };
+ struct ast_data *res;
+ struct timeval start;
+
switch (cmd) {
case CLI_INIT:
e->command = "data test get benchmark";
@@ -88,6 +94,14 @@
case CLI_GENERATE:
return NULL;
}
+
+ start = ast_tvnow();
+
+ res = ast_data_get(&query);
+
+ ast_cli(a->fd, "Test complete - %" PRIi64 " us\n", ast_tvdiff_us(ast_tvnow(), start));
+
+ ast_data_free(res);
return CLI_SUCCESS;
}
More information about the asterisk-commits
mailing list