You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2017/07/11 23:56:42 UTC
[couchdb] 02/02: update compression comparison tests
This is an automated email from the ASF dual-hosted git repository.
tonysun83 pushed a commit to branch 3430-external-size-views
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 0f150fb68485ba9f5eea0dbae133c0f9c75d4e36
Author: Tony Sun <to...@cloudant.com>
AuthorDate: Tue Jul 11 17:01:43 2017 -0700
update compression comparison tests
---
src/couch/test/couchdb_file_compression_tests.erl | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/couch/test/couchdb_file_compression_tests.erl b/src/couch/test/couchdb_file_compression_tests.erl
index a91a924..4b4fec8 100644
--- a/src/couch/test/couchdb_file_compression_tests.erl
+++ b/src/couch/test/couchdb_file_compression_tests.erl
@@ -115,12 +115,14 @@ compare_compression_methods(DbName) ->
compact_view(DbName),
DbSizeNone = db_disk_size(DbName),
ViewSizeNone = view_disk_size(DbName),
+ ViewExternalSizeNone = view_external_size(DbName),
config:set("couchdb", "file_compression", "snappy", false),
compact_db(DbName),
compact_view(DbName),
DbSizeSnappy = db_disk_size(DbName),
ViewSizeSnappy = view_disk_size(DbName),
+ ViewExternalSizeSnappy = view_external_size(DbName),
?assert(DbSizeNone > DbSizeSnappy),
?assert(ViewSizeNone > ViewSizeSnappy),
@@ -139,9 +141,12 @@ compare_compression_methods(DbName) ->
compact_view(DbName),
DbSizeDeflate9 = db_disk_size(DbName),
ViewSizeDeflate9 = view_disk_size(DbName),
+ ViewExternalSizeDeflate9 = view_external_size(DbName),
?assert(DbSizeDeflate1 > DbSizeDeflate9),
- ?assert(ViewSizeDeflate1 > ViewSizeDeflate9).
+ ?assert(ViewSizeDeflate1 > ViewSizeDeflate9),
+ ?assert(ViewExternalSizeNone =:= ViewExternalSizeSnappy),
+ ?assert(ViewExternalSizeNone =:= ViewExternalSizeDeflate9).
populate_db(_Db, NumDocs) when NumDocs =< 0 ->
@@ -193,9 +198,19 @@ view_disk_size(DbName) ->
ok = couch_db:close(Db),
active_size(Info).
+view_external_size(DbName) ->
+ {ok, Db} = couch_db:open_int(DbName, []),
+ {ok, DDoc} = couch_db:open_doc(Db, ?DDOC_ID, [ejson_body]),
+ {ok, Info} = couch_mrview:get_info(Db, DDoc),
+ ok = couch_db:close(Db),
+ external_size(Info).
+
active_size(Info) ->
couch_util:get_nested_json_value({Info}, [sizes, active]).
+external_size(Info) ->
+ couch_util:get_nested_json_value({Info}, [sizes, external]).
+
wait_compaction(DbName, Kind, Line) ->
WaitFun = fun() ->
case is_compaction_running(DbName) of
--
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.