public class SimpleStatsCollector extends AbstractStatsCollector
MustacheListener
collecting template rendering statistics.
Note that the template is identified with the name/id - so data will not be
correct if there's more than one templates with the same name (which is
possible if using MustacheEngine.compileMustache(String, String)
).
This listener is not able to detect rendering errors.Modifier and Type | Class and Description |
---|---|
class |
SimpleStatsCollector.SimpleStats |
AbstractStatsCollector.Stats
Modifier and Type | Field and Description |
---|---|
static String |
COMPUTING_CACHE_CONSUMER_ID |
protected ComputingCache<String,ComputingCache<Long,AtomicLong>> |
data
Map of name to map of time to amount
|
IS_NOT_ONEOFF_LAMBA_TEMPLATE
configuration
Constructor and Description |
---|
SimpleStatsCollector() |
SimpleStatsCollector(Predicate<String> templatePredicate,
TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
void |
clearData()
Drop all the collected data.
|
Map<String,Map<Long,Long>> |
getData() |
Map<Long,Long> |
getData(String templateId) |
Set<SimpleStatsCollector.SimpleStats> |
getSimpleStats() |
SimpleStatsCollector.SimpleStats |
getSimpleStats(String templateId) |
void |
init()
Can be overridden so that there's no need to call
super.init(Configuration) . |
void |
renderingStarted(MustacheRenderingEvent event)
Rendering of a
Mustache is about to start. |
convert, getTimeUnit, isApplied
compilationFinished, parsingStarted, renderingFinished
checkNotInitialized, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfigurationKeys, init
public static final String COMPUTING_CACHE_CONSUMER_ID
protected ComputingCache<String,ComputingCache<Long,AtomicLong>> data
public void init()
AbstractConfigurationAware
super.init(Configuration)
.init
in class AbstractConfigurationAware
public void renderingStarted(MustacheRenderingEvent event)
MustacheListener
Mustache
is about to start. Always use
ReleaseCallbackContainer.registerReleaseCallback(ReleaseCallback)
to release all the necessary resources.renderingStarted
in interface MustacheListener
renderingStarted
in class AbstractMustacheListener
public void clearData()
public Map<Long,Long> getData(String templateId)
templateId
- public SimpleStatsCollector.SimpleStats getSimpleStats(String templateId)
templateId
- public Set<SimpleStatsCollector.SimpleStats> getSimpleStats()
Copyright © 2017. All rights reserved.