support clear_cache and cache_size methods in StringInterpolation, adjust specs

Fixes #4325
This commit is contained in:
Colin Surprenant 2015-12-09 15:10:53 -05:00 committed by Jordan Sissel
parent aaaa6de51a
commit 6a3e0215a3
5 changed files with 40 additions and 3 deletions

View file

@ -2,6 +2,7 @@
require "logstash/namespace"
require "logstash/json"
require "logstash/string_interpolation"
# transcient pipeline events for normal in-flow signaling as opposed to
# flow altering exceptions. for now having base classes is adequate and

View file

@ -0,0 +1,18 @@
# encoding: utf-8
module LogStash
module StringInterpolation
extend self
# clear the global compiled templates cache
def clear_cache
Java::ComLogstash::StringInterpolation.get_instance.clear_cache;
end
# @return [Fixnum] the compiled templates cache size
def cache_size
Java::ComLogstash::StringInterpolation.get_instance.cache_size;
end
end
end