[Groonga-commit] groonga/groonga at cd65ac1 [master] mrb: support query log when cache is used

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jul 27 18:38:38 JST 2015


Kouhei Sutou	2015-07-27 18:38:38 +0900 (Mon, 27 Jul 2015)

  New Revision: cd65ac16d5c0c71c0900e0f931d2076c300a6732
  https://github.com/groonga/groonga/commit/cd65ac16d5c0c71c0900e0f931d2076c300a6732

  Message:
    mrb: support query log when cache is used

  Modified files:
    lib/mrb/scripts/command.rb

  Modified: lib/mrb/scripts/command.rb (+5 -0)
===================================================================
--- lib/mrb/scripts/command.rb    2015-07-27 18:38:26 +0900 (e50d362)
+++ lib/mrb/scripts/command.rb    2015-07-27 18:38:38 +0900 (eaa769b)
@@ -20,6 +20,10 @@ module Groonga
       @writer ||= context.writer
     end
 
+    def query_logger
+      @query_logger ||= context.query_logger
+    end
+
     def cache_key(input)
       nil
     end
@@ -33,6 +37,7 @@ module Groonga
         if cached_value
           context.output = cached_value
           cache.unref(key)
+          query_logger.log(:cache, ":", "cache(#{cached_value.bytesize})")
         else
           yield
           cache.update(key, context.output)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index